summaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2023-12-13 13:47:44 -0800
committer Colin Cross <ccross@android.com> 2023-12-14 16:12:22 -0800
commit313aa5475f50024da74e709a55f840eb7b263153 (patch)
treefe4d43b20d557f151641b323eeae292474478427 /java/platform_bootclasspath.go
parentff694a8c88c632559c72653edf99f21c3d761dee (diff)
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
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r--java/platform_bootclasspath.go8
1 files changed, 4 insertions, 4 deletions
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