From 313aa5475f50024da74e709a55f840eb7b263153 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 13 Dec 2023 13:47:44 -0800 Subject: Convert OtherModuleProvider to generic providers API Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider to use the type-safe android.OtherModuleProvider API. Bug: 316410648 Test: builds Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5 --- java/platform_bootclasspath.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'java/platform_bootclasspath.go') diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index 036470c61..88d1ae8c0 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -180,7 +180,7 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo var transitiveSrcFiles android.Paths for _, module := range allModules { - depInfo := ctx.OtherModuleProvider(module, JavaInfoProvider).(JavaInfo) + depInfo, _ := android.OtherModuleProvider(ctx, module, JavaInfoProvider) if depInfo.TransitiveSrcFiles != nil { transitiveSrcFiles = append(transitiveSrcFiles, depInfo.TransitiveSrcFiles.ToList()...) } @@ -219,7 +219,7 @@ func (b *platformBootclasspathModule) configuredJars(ctx android.ModuleContext) // Include jars from APEXes that don't populate their classpath proto config. remainingJars := dexpreopt.GetGlobalConfig(ctx).ApexBootJars for _, fragment := range b.fragments { - info := ctx.OtherModuleProvider(fragment, ClasspathFragmentProtoContentInfoProvider).(ClasspathFragmentProtoContentInfo) + info, _ := android.OtherModuleProvider(ctx, fragment, ClasspathFragmentProtoContentInfoProvider) if info.ClasspathFragmentProtoGenerated { remainingJars = remainingJars.RemoveList(info.ClasspathFragmentProtoContents) } @@ -241,7 +241,7 @@ func (b *platformBootclasspathModule) platformJars(ctx android.PathContext) andr func (b *platformBootclasspathModule) checkPlatformModules(ctx android.ModuleContext, modules []android.Module) { // TODO(satayev): change this check to only allow core-icu4j, all apex jars should not be here. for _, m := range modules { - apexInfo := ctx.OtherModuleProvider(m, android.ApexInfoProvider).(android.ApexInfo) + apexInfo, _ := android.OtherModuleProvider(ctx, m, android.ApexInfoProvider) fromUpdatableApex := apexInfo.Updatable if fromUpdatableApex { // error: this jar is part of an updatable apex @@ -255,7 +255,7 @@ func (b *platformBootclasspathModule) checkPlatformModules(ctx android.ModuleCon // checkApexModules ensures that the apex modules supplied are not from the platform. func (b *platformBootclasspathModule) checkApexModules(ctx android.ModuleContext, modules []android.Module) { for _, m := range modules { - apexInfo := ctx.OtherModuleProvider(m, android.ApexInfoProvider).(android.ApexInfo) + apexInfo, _ := android.OtherModuleProvider(ctx, m, android.ApexInfoProvider) fromUpdatableApex := apexInfo.Updatable if fromUpdatableApex { // ok: this jar is part of an updatable apex -- cgit v1.2.3-59-g8ed1b