Propagate AconfigFiles in ModuleBase.
Aconfig file dependencies are module-independent, and properly part of
ModuleBase.
Bug: b/308625757
Test: manual
Change-Id: I38c5907d1671cc69bb198345201316ae781fdc9f
diff --git a/apex/androidmk.go b/apex/androidmk.go
index bc68ad3..619be8d 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -124,6 +124,10 @@
pathForSymbol := filepath.Join("$(PRODUCT_OUT)", "apex", apexBundleName, fi.installDir)
modulePath := pathForSymbol
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", modulePath)
+ // AconfigUpdateAndroidMkData may have added elements to Extra. Process them here.
+ for _, extra := range apexAndroidMkData.Extra {
+ extra(w, fi.builtFile)
+ }
// For non-flattend APEXes, the merged notice file is attached to the APEX itself.
// We don't need to have notice file for the individual modules in it. Otherwise,
@@ -229,6 +233,7 @@
func (a *apexBundle) androidMkForType() android.AndroidMkData {
return android.AndroidMkData{
+ // While we do not provide a value for `Extra`, AconfigUpdateAndroidMkData may add some, which we must honor.
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
moduleNames := []string{}
if a.installable() {
@@ -269,6 +274,10 @@
android.AndroidMkEmitAssignList(w, "LOCAL_OVERRIDES_MODULES", a.overridableProperties.Overrides)
a.writeRequiredModules(w, moduleNames)
+ // AconfigUpdateAndroidMkData may have added elements to Extra. Process them here.
+ for _, extra := range data.Extra {
+ extra(w, a.outputFile)
+ }
fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
fmt.Fprintln(w, "ALL_MODULES.$(my_register_name).BUNDLE :=", a.bundleModuleFile.String())