summaryrefslogtreecommitdiff
path: root/java/sdk_library.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/sdk_library.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/sdk_library.go')
-rw-r--r--java/sdk_library.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go
index ffadd3936..0584281a5 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -673,8 +673,7 @@ type scopePaths struct {
}
func (paths *scopePaths) extractStubsLibraryInfoFromDependency(ctx android.ModuleContext, dep android.Module) error {
- if ctx.OtherModuleHasProvider(dep, JavaInfoProvider) {
- lib := ctx.OtherModuleProvider(dep, JavaInfoProvider).(JavaInfo)
+ if lib, ok := android.OtherModuleProvider(ctx, dep, JavaInfoProvider); ok {
paths.stubsHeaderPath = lib.HeaderJars
paths.stubsImplPath = lib.ImplementationJars
@@ -2037,7 +2036,7 @@ func PrebuiltJars(ctx android.BaseModuleContext, baseName string, s android.SdkS
// false.
func withinSameApexesAs(ctx android.BaseModuleContext, other android.Module) bool {
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
- otherApexInfo := ctx.OtherModuleProvider(other, android.ApexInfoProvider).(android.ApexInfo)
+ otherApexInfo, _ := android.OtherModuleProvider(ctx, other, android.ApexInfoProvider)
return len(otherApexInfo.InApexVariants) > 0 && reflect.DeepEqual(apexInfo.InApexVariants, otherApexInfo.InApexVariants)
}