summaryrefslogtreecommitdiff
path: root/android/provider.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/provider.go')
-rw-r--r--android/provider.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/provider.go b/android/provider.go
index d005daf55..aae93ef88 100644
--- a/android/provider.go
+++ b/android/provider.go
@@ -41,6 +41,14 @@ func OtherModuleProviderOrDefault[K any](ctx OtherModuleProviderContext, module
return value
}
+func OtherModulePointerProviderOrDefault[K *T, T any](ctx OtherModuleProviderContext, module blueprint.Module, provider blueprint.ProviderKey[K]) K {
+ if value, ok := OtherModuleProvider(ctx, module, provider); ok {
+ return value
+ }
+ var val T
+ return &val
+}
+
// ModuleProviderContext is a helper interface that is a subset of ModuleContext or BottomUpMutatorContext
// for use in ModuleProvider.
type ModuleProviderContext interface {