Properly initialize android_system_image modules
android_system_image just passed its embedded filesystem module to InitAndroidModule (transitively via initFilesystemModule). This meant that ModuleBase.module was pointing to the filesystem module, not the system image module. This was a problem for the new "changeable configuration" feature I'm working on, but you can also more readily see the issue if you add a GenerateAndroidBuildActions function to android_system_image: it won't be called. Bug: 361816274 Test: Presubmits Change-Id: I41978037b81910309a000dc1bba327e513ba5dce
This commit is contained in:
@@ -147,14 +147,14 @@ type filesystemProperties struct {
|
||||
func filesystemFactory() android.Module {
|
||||
module := &filesystem{}
|
||||
module.filterPackagingSpec = module.filterInstallablePackagingSpec
|
||||
initFilesystemModule(module)
|
||||
initFilesystemModule(module, module)
|
||||
return module
|
||||
}
|
||||
|
||||
func initFilesystemModule(module *filesystem) {
|
||||
module.AddProperties(&module.properties)
|
||||
android.InitPackageModule(module)
|
||||
module.PackagingBase.DepsCollectFirstTargetOnly = true
|
||||
func initFilesystemModule(module android.DefaultableModule, filesystemModule *filesystem) {
|
||||
module.AddProperties(&filesystemModule.properties)
|
||||
android.InitPackageModule(filesystemModule)
|
||||
filesystemModule.PackagingBase.DepsCollectFirstTargetOnly = true
|
||||
android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon)
|
||||
android.InitDefaultableModule(module)
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ func systemImageFactory() android.Module {
|
||||
module.AddProperties(&module.properties)
|
||||
module.filesystem.buildExtraFiles = module.buildExtraFiles
|
||||
module.filesystem.filterPackagingSpec = module.filterPackagingSpec
|
||||
initFilesystemModule(&module.filesystem)
|
||||
initFilesystemModule(module, &module.filesystem)
|
||||
return module
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user