diff options
Diffstat (limited to 'android/prebuilt.go')
-rw-r--r-- | android/prebuilt.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/android/prebuilt.go b/android/prebuilt.go index e7b79796e..5acef1de4 100644 --- a/android/prebuilt.go +++ b/android/prebuilt.go @@ -435,6 +435,10 @@ func checkInvariantsForSourceAndPrebuilt(ctx BaseModuleContext, s, p Module) { // PrebuiltSelectModuleMutator marks prebuilts that are used, either overriding source modules or // because the source module doesn't exist. It also disables installing overridden source modules. +// +// If the visited module is the metadata module `all_apex_contributions`, it sets a +// provider containing metadata about whether source or prebuilt of mainline modules should be used. +// This logic was added here to prevent the overhead of creating a new mutator. func PrebuiltSelectModuleMutator(ctx TopDownMutatorContext) { m := ctx.Module() if p := GetEmbeddedPrebuilt(m); p != nil { @@ -455,6 +459,11 @@ func PrebuiltSelectModuleMutator(ctx TopDownMutatorContext) { } }) } + // If this is `all_apex_contributions`, set a provider containing + // metadata about source vs prebuilts selection + if am, ok := m.(*allApexContributions); ok { + am.SetPrebuiltSelectionInfoProvider(ctx) + } } // PrebuiltPostDepsMutator replaces dependencies on the source module with dependencies on the |