Convert ModuleProvder to generic providers API

Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
This commit is contained in:
Colin Cross
2023-12-14 14:46:23 -08:00
parent 313aa5475f
commit 5a37718c95
31 changed files with 51 additions and 88 deletions

View File

@@ -272,7 +272,7 @@ func TestBootclasspathFragment_StubLibs(t *testing.T) {
`)
fragment := result.Module("myfragment", "android_common")
info := result.ModuleProvider(fragment, HiddenAPIInfoProvider).(HiddenAPIInfo)
info, _ := android.SingletonModuleProvider(result, fragment, HiddenAPIInfoProvider)
stubsJar := "out/soong/.intermediates/mystublib/android_common/dex/mystublib.jar"
@@ -456,7 +456,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) {
// Make sure that the library exports hidden API properties for use by the bootclasspath_fragment.
library := result.Module("mynewlibrary", "android_common")
info := result.ModuleProvider(library, hiddenAPIPropertyInfoProvider).(HiddenAPIPropertyInfo)
info, _ := android.SingletonModuleProvider(result, library, hiddenAPIPropertyInfoProvider)
android.AssertArrayString(t, "split packages", []string{"sdklibrary", "newlibrary"}, info.SplitPackages)
android.AssertArrayString(t, "package prefixes", []string{"newlibrary.all.mine"}, info.PackagePrefixes)
android.AssertArrayString(t, "single packages", []string{"newlibrary.mine"}, info.SinglePackages)