Merge changes I41978037,I19e8a9e8 into main
* changes:
Properly initialize android_system_image modules
Add otherModuleProvider to ConfigurableEvaluatorContext
diff --git a/android/defaults.go b/android/defaults.go
index 0d51d9d..3711067 100644
--- a/android/defaults.go
+++ b/android/defaults.go
@@ -101,6 +101,7 @@
// A restricted subset of context methods, similar to LoadHookContext.
type DefaultableHookContext interface {
EarlyModuleContext
+ OtherModuleProviderContext
CreateModule(ModuleFactory, ...interface{}) Module
AddMissingDependencies(missingDeps []string)
diff --git a/android/module.go b/android/module.go
index f5a611c..1a3f328 100644
--- a/android/module.go
+++ b/android/module.go
@@ -2211,6 +2211,7 @@
}
type ConfigurableEvaluatorContext interface {
+ OtherModuleProviderContext
Config() Config
OtherModulePropertyErrorf(module Module, property string, fmt string, args ...interface{})
HasMutatorFinished(mutatorName string) bool
diff --git a/android/paths.go b/android/paths.go
index 0a4f891..0d94f03 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -91,6 +91,7 @@
// the Path methods that rely on module dependencies having been resolved.
type ModuleWithDepsPathContext interface {
EarlyModulePathContext
+ OtherModuleProviderContext
VisitDirectDepsBlueprint(visit func(blueprint.Module))
OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag
HasMutatorFinished(mutatorName string) bool
diff --git a/android/testing.go b/android/testing.go
index 1ee6e4c..196b22e 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -1330,6 +1330,10 @@
return ctx.ctx.HasMutatorFinished(mutatorName)
}
+func (ctx *panickingConfigAndErrorContext) otherModuleProvider(m blueprint.Module, p blueprint.AnyProviderKey) (any, bool) {
+ return ctx.ctx.otherModuleProvider(m, p)
+}
+
func PanickingConfigAndErrorContext(ctx *TestContext) ConfigurableEvaluatorContext {
return &panickingConfigAndErrorContext{
ctx: ctx,
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 0b39062..0353992 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -147,14 +147,14 @@
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)
}
diff --git a/filesystem/system_image.go b/filesystem/system_image.go
index 805249e..63cb627 100644
--- a/filesystem/system_image.go
+++ b/filesystem/system_image.go
@@ -38,7 +38,7 @@
module.AddProperties(&module.properties)
module.filesystem.buildExtraFiles = module.buildExtraFiles
module.filesystem.filterPackagingSpec = module.filterPackagingSpec
- initFilesystemModule(&module.filesystem)
+ initFilesystemModule(module, &module.filesystem)
return module
}