Remove duplicated CollectDependencyAconfigFiles()
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().
To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.
Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()
Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
diff --git a/apex/apex.go b/apex/apex.go
index 40eb712..9a80ec6 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -490,9 +490,6 @@
javaApisUsedByModuleFile android.ModuleOutPath
aconfigFiles []android.Path
-
- // Single aconfig "cache file" merged from this module and all dependencies.
- mergedAconfigFiles map[string]android.Paths
}
// apexFileClass represents a type of file that can be included in APEX.
@@ -2326,7 +2323,7 @@
}
func addAconfigFiles(vctx *visitorContext, ctx android.ModuleContext, module blueprint.Module) {
- if dep, ok := android.OtherModuleProvider(ctx, module, android.AconfigTransitiveDeclarationsInfoProvider); ok {
+ if dep, ok := android.OtherModuleProvider(ctx, module, android.AconfigPropagatingProviderKey); ok {
if len(dep.AconfigFiles) > 0 && dep.AconfigFiles[ctx.ModuleName()] != nil {
vctx.aconfigFiles = append(vctx.aconfigFiles, dep.AconfigFiles[ctx.ModuleName()]...)
}
@@ -2414,7 +2411,6 @@
return
}
}
- android.CollectDependencyAconfigFiles(ctx, &a.mergedAconfigFiles)
////////////////////////////////////////////////////////////////////////////////////////////
// 3) some fields in apexBundle struct are configured
@@ -2586,9 +2582,6 @@
type Defaults struct {
android.ModuleBase
android.DefaultsModuleBase
-
- // Single aconfig "cache file" merged from this module and all dependencies.
- mergedAconfigFiles map[string]android.Paths
}
// apex_defaults provides defaultable properties to other apex modules.
@@ -2611,10 +2604,6 @@
android.OverrideModuleBase
}
-func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- android.CollectDependencyAconfigFiles(ctx, &d.mergedAconfigFiles)
-}
-
func (o *OverrideApex) GenerateAndroidBuildActions(_ android.ModuleContext) {
// All the overrides happen in the base module.
}