diff options
Diffstat (limited to 'java/sdk_library.go')
-rw-r--r-- | java/sdk_library.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go index 149eab683..ffadd3936 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -2036,7 +2036,7 @@ func PrebuiltJars(ctx android.BaseModuleContext, baseName string, s android.SdkS // If either this or the other module are on the platform then this will return // false. func withinSameApexesAs(ctx android.BaseModuleContext, other android.Module) bool { - apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo) + apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider) otherApexInfo := ctx.OtherModuleProvider(other, android.ApexInfoProvider).(android.ApexInfo) return len(otherApexInfo.InApexVariants) > 0 && reflect.DeepEqual(apexInfo.InApexVariants, otherApexInfo.InApexVariants) } @@ -2693,7 +2693,7 @@ func (module *SdkLibraryImport) GenerateAndroidBuildActions(ctx android.ModuleCo if ctx.Device() { // If this is a variant created for a prebuilt_apex then use the dex implementation jar // obtained from the associated deapexer module. - ai := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo) + ai, _ := android.ModuleProvider(ctx, android.ApexInfoProvider) if ai.ForPrebuiltApex { // Get the path of the dex implementation jar from the `deapexer` module. di := android.FindDeapexerProviderForModule(ctx) @@ -2960,7 +2960,7 @@ func (module *sdkLibraryXml) ShouldSupportSdkVersion(ctx android.BaseModuleConte // File path to the runtime implementation library func (module *sdkLibraryXml) implPath(ctx android.ModuleContext) string { implName := proptools.String(module.properties.Lib_name) - if apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo); !apexInfo.IsForPlatform() { + if apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider); !apexInfo.IsForPlatform() { // TODO(b/146468504): ApexVariationName() is only a soong module name, not apex name. // In most cases, this works fine. But when apex_name is set or override_apex is used // this can be wrong. @@ -3067,7 +3067,8 @@ func (module *sdkLibraryXml) permissionsContents(ctx android.ModuleContext) stri } func (module *sdkLibraryXml) GenerateAndroidBuildActions(ctx android.ModuleContext) { - module.hideApexVariantFromMake = !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform() + apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider) + module.hideApexVariantFromMake = !apexInfo.IsForPlatform() libName := proptools.String(module.properties.Lib_name) module.selfValidate(ctx) |