diff options
author | 2023-12-13 13:47:44 -0800 | |
---|---|---|
committer | 2023-12-14 16:12:22 -0800 | |
commit | 313aa5475f50024da74e709a55f840eb7b263153 (patch) | |
tree | fe4d43b20d557f151641b323eeae292474478427 /java/hiddenapi_modular.go | |
parent | ff694a8c88c632559c72653edf99f21c3d761dee (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/hiddenapi_modular.go')
-rw-r--r-- | java/hiddenapi_modular.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go index 3fc0883ce..8011f343b 100644 --- a/java/hiddenapi_modular.go +++ b/java/hiddenapi_modular.go @@ -579,8 +579,7 @@ func (i *HiddenAPIInfo) mergeFromFragmentDeps(ctx android.ModuleContext, fragmen // Merge all the information from the fragments. The fragments form a DAG so it is possible that // this will introduce duplicates so they will be resolved after processing all the fragments. for _, fragment := range fragments { - if ctx.OtherModuleHasProvider(fragment, HiddenAPIInfoProvider) { - info := ctx.OtherModuleProvider(fragment, HiddenAPIInfoProvider).(HiddenAPIInfo) + if info, ok := android.OtherModuleProvider(ctx, fragment, HiddenAPIInfoProvider); ok { i.TransitiveStubDexJarsByScope.addStubDexJarsByModule(info.TransitiveStubDexJarsByScope) } } @@ -777,8 +776,7 @@ func (i *HiddenAPIPropertyInfo) extractPackageRulesFromProperties(p *HiddenAPIPa func (i *HiddenAPIPropertyInfo) gatherPropertyInfo(ctx android.ModuleContext, contents []android.Module) { for _, module := range contents { - if ctx.OtherModuleHasProvider(module, hiddenAPIPropertyInfoProvider) { - info := ctx.OtherModuleProvider(module, hiddenAPIPropertyInfoProvider).(HiddenAPIPropertyInfo) + if info, ok := android.OtherModuleProvider(ctx, module, hiddenAPIPropertyInfoProvider); ok { i.FlagFilesByCategory.append(info.FlagFilesByCategory) i.PackagePrefixes = append(i.PackagePrefixes, info.PackagePrefixes...) i.SinglePackages = append(i.SinglePackages, info.SinglePackages...) @@ -1404,7 +1402,7 @@ func deferReportingMissingBootDexJar(ctx android.ModuleContext, module android.M } if am, ok := module.(android.ApexModule); ok && am.InAnyApex() { - apexInfo := ctx.OtherModuleProvider(module, android.ApexInfoProvider).(android.ApexInfo) + apexInfo, _ := android.OtherModuleProvider(ctx, module, android.ApexInfoProvider) if apexInfo.IsForPlatform() { return true } |