summaryrefslogtreecommitdiff
path: root/android/provider.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2025-03-13 18:36:35 +0000
committer Yu Liu <yudiliu@google.com> 2025-03-13 18:36:35 +0000
commitf22120fb1da7f75a571966124bb0da6a57fd4f07 (patch)
tree9ffabf8102382f54c89595a59e3211eccd766217 /android/provider.go
parent7c18e7f15b997e0e3199111446e0511ffd96b811 (diff)
Change CommonModuleInfoProvider to a pointer.
Bug: 358427516 Test: Manually verified genereated ninja and mk files, unit tests. Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
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 {