Remove overriden modules from deps of autogenerated filesystem modules
`android_filesystem` supports overrides, but only if the module is
overriden by another module in its deps. For AOSP CF, the autogenerated
system.img contains an additional /bin/charger. The Kati system.img does
not contain this file because it is overriden by a module which is
installed in /vendor.
This CL updates the autogen mutators to remove a module from deps if it
is overriden by another module in PRODUCT_PACKAGES or by a transitve
required module dependency of PRODUCT_PACKAGES
Test: go test ./fsgen
Test: verified that /bin/charger no longer appears in diff_test of
system for aosp_cf_x86_64
Change-Id: Idafa1db07a42519ba3c441f851480b1c6faa63b8
Change-Id: If09050a6fd110d07d975595644dba85c740027e2
diff --git a/android/module.go b/android/module.go
index ec0f446..06754e8 100644
--- a/android/module.go
+++ b/android/module.go
@@ -118,6 +118,10 @@
// The usage of this method is experimental and should not be used outside of fsgen package.
// This will be removed once product packaging migration to Soong is complete.
DecodeMultilib(ctx ConfigContext) (string, string)
+
+ // WARNING: This should not be used outside build/soong/fsgen
+ // Overrides returns the list of modules which should not be installed if this module is installed.
+ Overrides() []string
}
// Qualified id for a module
@@ -2291,6 +2295,10 @@
return decodeMultilib(ctx, m)
}
+func (m *ModuleBase) Overrides() []string {
+ return m.commonProperties.Overrides
+}
+
type ConfigContext interface {
Config() Config
}
diff --git a/android/module_proxy.go b/android/module_proxy.go
index 0f552dd..2a65072 100644
--- a/android/module_proxy.go
+++ b/android/module_proxy.go
@@ -205,3 +205,7 @@
func (m ModuleProxy) DecodeMultilib(ctx ConfigContext) (string, string) {
panic("method is not implemented on ModuleProxy")
}
+
+func (m ModuleProxy) Overrides() []string {
+ panic("method is not implemented on ModuleProxy")
+}