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
diff --git a/android/prebuilt.go b/android/prebuilt.go
index a32a37d..6a417a8 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -461,8 +461,8 @@
// Propagate the provider received from `all_apex_contributions`
// to the source module
ctx.VisitDirectDepsWithTag(acDepTag, func(am Module) {
- psi := ctx.OtherModuleProvider(am, PrebuiltSelectionInfoProvider).(PrebuiltSelectionInfoMap)
- ctx.SetProvider(PrebuiltSelectionInfoProvider, psi)
+ psi, _ := OtherModuleProvider(ctx, am, PrebuiltSelectionInfoProvider)
+ SetProvider(ctx, PrebuiltSelectionInfoProvider, psi)
})
} else if s, ok := ctx.Module().(Module); ok {
@@ -548,9 +548,7 @@
// Use `all_apex_contributions` for source vs prebuilt selection.
psi := PrebuiltSelectionInfoMap{}
ctx.VisitDirectDepsWithTag(PrebuiltDepTag, func(am Module) {
- if ctx.OtherModuleHasProvider(am, PrebuiltSelectionInfoProvider) {
- psi = ctx.OtherModuleProvider(am, PrebuiltSelectionInfoProvider).(PrebuiltSelectionInfoMap)
- }
+ psi, _ = OtherModuleProvider(ctx, am, PrebuiltSelectionInfoProvider)
})
// If the source module is explicitly listed in the metadata module, use that