Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
diff --git a/aconfig/aconfig_declarations_test.go b/aconfig/aconfig_declarations_test.go
index 5483295..e89cd31 100644
--- a/aconfig/aconfig_declarations_test.go
+++ b/aconfig/aconfig_declarations_test.go
@@ -40,7 +40,7 @@
module := result.ModuleForTests("module_name", "").Module().(*DeclarationsModule)
// Check that the provider has the right contents
- depData, _ := android.SingletonModuleProvider(result, module, android.AconfigDeclarationsProviderKey)
+ depData, _ := android.OtherModuleProvider(result, module, android.AconfigDeclarationsProviderKey)
android.AssertStringEquals(t, "package", depData.Package, "com.example.package")
android.AssertStringEquals(t, "container", depData.Container, "com.android.foo")
android.AssertBoolEquals(t, "exportable", depData.Exportable, true)
@@ -67,7 +67,7 @@
result := runTest(t, android.FixtureExpectsNoErrors, bp)
module := result.ModuleForTests("module_name", "").Module().(*DeclarationsModule)
- depData, _ := android.SingletonModuleProvider(result, module, android.AconfigDeclarationsProviderKey)
+ depData, _ := android.OtherModuleProvider(result, module, android.AconfigDeclarationsProviderKey)
android.AssertBoolEquals(t, "exportable", depData.Exportable, false)
}
@@ -205,7 +205,7 @@
}
result := fixture.RunTestWithBp(t, test.bp)
module := result.ModuleForTests("module_name", "").Module().(*DeclarationsModule)
- depData, _ := android.SingletonModuleProvider(result, module, android.AconfigReleaseDeclarationsProviderKey)
+ depData, _ := android.OtherModuleProvider(result, module, android.AconfigReleaseDeclarationsProviderKey)
expectedKeys := []string{""}
for _, rc := range strings.Split(test.buildFlags["RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS"], " ") {
expectedKeys = append(expectedKeys, rc)
diff --git a/aconfig/aconfig_value_set_test.go b/aconfig/aconfig_value_set_test.go
index 7d18999..32c31cb 100644
--- a/aconfig/aconfig_value_set_test.go
+++ b/aconfig/aconfig_value_set_test.go
@@ -38,6 +38,6 @@
module := result.ModuleForTests("module_name", "").Module().(*ValueSetModule)
// Check that the provider has the right contents
- depData, _ := android.SingletonModuleProvider(result, module, valueSetProviderKey)
+ depData, _ := android.OtherModuleProvider(result, module, valueSetProviderKey)
android.AssertStringEquals(t, "AvailablePackages", "blah.aconfig_values", depData.AvailablePackages["foo.package"][0].String())
}
diff --git a/aconfig/aconfig_values_test.go b/aconfig/aconfig_values_test.go
index 526579c..ddbea57 100644
--- a/aconfig/aconfig_values_test.go
+++ b/aconfig/aconfig_values_test.go
@@ -33,7 +33,7 @@
module := result.ModuleForTests("module_name", "").Module().(*ValuesModule)
// Check that the provider has the right contents
- depData, _ := android.SingletonModuleProvider(result, module, valuesProviderKey)
+ depData, _ := android.OtherModuleProvider(result, module, valuesProviderKey)
android.AssertStringEquals(t, "package", "foo.package", depData.Package)
android.AssertPathsEndWith(t, "srcs", []string{"blah.aconfig_values"}, depData.Values)
}
diff --git a/aconfig/all_aconfig_declarations.go b/aconfig/all_aconfig_declarations.go
index 0437c26..6ad54da 100644
--- a/aconfig/all_aconfig_declarations.go
+++ b/aconfig/all_aconfig_declarations.go
@@ -15,9 +15,10 @@
package aconfig
import (
- "android/soong/android"
"fmt"
"slices"
+
+ "android/soong/android"
)
// A singleton module that collects all of the aconfig flags declared in the
@@ -55,7 +56,7 @@
var packages = make(map[string]int)
var cacheFiles android.Paths
ctx.VisitAllModules(func(module android.Module) {
- decl, ok := android.SingletonModuleProvider(ctx, module, android.AconfigReleaseDeclarationsProviderKey)
+ decl, ok := android.OtherModuleProvider(ctx, module, android.AconfigReleaseDeclarationsProviderKey)
if !ok {
return
}
diff --git a/aconfig/build_flags/all_build_flag_declarations.go b/aconfig/build_flags/all_build_flag_declarations.go
index 282c9dc..5f02912 100644
--- a/aconfig/build_flags/all_build_flag_declarations.go
+++ b/aconfig/build_flags/all_build_flag_declarations.go
@@ -38,7 +38,7 @@
// Find all of the build_flag_declarations modules
var intermediateFiles android.Paths
ctx.VisitAllModules(func(module android.Module) {
- decl, ok := android.SingletonModuleProvider(ctx, module, BuildFlagDeclarationsProviderKey)
+ decl, ok := android.OtherModuleProvider(ctx, module, BuildFlagDeclarationsProviderKey)
if !ok {
return
}
diff --git a/aconfig/exported_java_aconfig_library.go b/aconfig/exported_java_aconfig_library.go
index 291938f..a64cac8 100644
--- a/aconfig/exported_java_aconfig_library.go
+++ b/aconfig/exported_java_aconfig_library.go
@@ -30,7 +30,7 @@
// Find all of the aconfig_declarations modules
var cacheFiles android.Paths
ctx.VisitAllModules(func(module android.Module) {
- decl, ok := android.SingletonModuleProvider(ctx, module, android.AconfigDeclarationsProviderKey)
+ decl, ok := android.OtherModuleProvider(ctx, module, android.AconfigDeclarationsProviderKey)
if !ok {
return
}