Add comment for imageMutatorBeginMutator
Bug: 372091092
Test: m nothing
Change-Id: I4446b66da02728e968c6a8656fe477d4432f0ab6
diff --git a/android/image.go b/android/image.go
index e8b6352..78343db 100644
--- a/android/image.go
+++ b/android/image.go
@@ -125,6 +125,12 @@
return e.kind == systemExtSpecificModule
}
+// imageMutatorBeginMutator calls ImageMutatorBegin on all modules that may have image variants.
+// This happens right before the imageTransitionMutator runs. It's needed to initialize these
+// modules so that they return the correct results for all the other ImageInterface methods,
+// which the imageTransitionMutator will call. Transition mutators should also not mutate modules
+// (except in their Mutate() function), which this method does, so we run it in a separate mutator
+// first.
func imageMutatorBeginMutator(ctx BottomUpMutatorContext) {
if m, ok := ctx.Module().(ImageInterface); ok && ctx.Os() == Android {
m.ImageMutatorBegin(ctx)