From 5a37718c956b1bfbda5e236c0fe50f08661a81de Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 14 Dec 2023 14:46:23 -0800 Subject: 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 --- java/testing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/testing.go') diff --git a/java/testing.go b/java/testing.go index e883bcb4c..d55cffc40 100644 --- a/java/testing.go +++ b/java/testing.go @@ -617,7 +617,7 @@ func CheckPlatformBootclasspathModules(t *testing.T, result *android.TestResult, func CheckClasspathFragmentProtoContentInfoProvider(t *testing.T, result *android.TestResult, generated bool, contents, outputFilename, installDir string) { t.Helper() p := result.Module("platform-bootclasspath", "android_common").(*platformBootclasspathModule) - info := result.ModuleProvider(p, ClasspathFragmentProtoContentInfoProvider).(ClasspathFragmentProtoContentInfo) + info, _ := android.SingletonModuleProvider(result, p, ClasspathFragmentProtoContentInfoProvider) android.AssertBoolEquals(t, "classpath proto generated", generated, info.ClasspathFragmentProtoGenerated) android.AssertStringEquals(t, "classpath proto contents", contents, info.ClasspathFragmentProtoContents.String()) @@ -637,7 +637,7 @@ func ApexNamePairsFromModules(ctx *android.TestContext, modules []android.Module func apexNamePairFromModule(ctx *android.TestContext, module android.Module) string { name := module.Name() var apex string - apexInfo := ctx.ModuleProvider(module, android.ApexInfoProvider).(android.ApexInfo) + apexInfo, _ := android.SingletonModuleProvider(ctx, module, android.ApexInfoProvider) if apexInfo.IsForPlatform() { apex = "platform" } else { -- cgit v1.2.3-59-g8ed1b