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/aconfig/aconfig_value_set.go b/aconfig/aconfig_value_set.go
index 76e8a77..7ba76c0 100644
--- a/aconfig/aconfig_value_set.go
+++ b/aconfig/aconfig_value_set.go
@@ -73,15 +73,11 @@
// to append values to their aconfig actions.
packages := make(map[string]android.Paths)
ctx.VisitDirectDeps(func(dep android.Module) {
- if !ctx.OtherModuleHasProvider(dep, valuesProviderKey) {
- // Other modules get injected as dependencies too, for example the license modules
- return
+ if depData, ok := android.OtherModuleProvider(ctx, dep, valuesProviderKey); ok {
+ srcs := make([]android.Path, len(depData.Values))
+ copy(srcs, depData.Values)
+ packages[depData.Package] = srcs
}
- depData := ctx.OtherModuleProvider(dep, valuesProviderKey).(valuesProviderData)
-
- srcs := make([]android.Path, len(depData.Values))
- copy(srcs, depData.Values)
- packages[depData.Package] = srcs
})
android.SetProvider(ctx, valueSetProviderKey, valueSetProviderData{