Merge "AFDO: Do not mutate on disabled modules" into main am: 66b451b8ae

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3156719

Change-Id: Ib80308a803819b7547f49dae1143f6acddf43188
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2024-07-02 18:07:27 +00:00
committed by Automerger Merge Worker

View File

@@ -176,6 +176,9 @@ func (a *afdoTransitionMutator) IncomingTransition(ctx android.IncomingTransitio
func (a *afdoTransitionMutator) Mutate(ctx android.BottomUpMutatorContext, variation string) { func (a *afdoTransitionMutator) Mutate(ctx android.BottomUpMutatorContext, variation string) {
if m, ok := ctx.Module().(*Module); ok && m.afdo != nil { if m, ok := ctx.Module().(*Module); ok && m.afdo != nil {
if !m.Enabled(ctx) {
return
}
if variation == "" { if variation == "" {
// The empty variation is either a module that has enabled AFDO for itself, or the non-AFDO // The empty variation is either a module that has enabled AFDO for itself, or the non-AFDO
// variant of a dependency. // variant of a dependency.