summaryrefslogtreecommitdiff
path: root/android/singleton.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2023-12-14 14:46:23 -0800
committer Colin Cross <ccross@android.com> 2023-12-14 16:12:22 -0800
commit5a37718c956b1bfbda5e236c0fe50f08661a81de (patch)
treef8a6bddfb1fc02a663884ec9d500a831607572be /android/singleton.go
parent313aa5475f50024da74e709a55f840eb7b263153 (diff)
Convert ModuleProvder to generic providers API
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the type-safe android.SingletonModuleProvider API. Bug: 316410648 Test: builds Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
Diffstat (limited to 'android/singleton.go')
-rw-r--r--android/singleton.go21
1 files changed, 0 insertions, 21 deletions
diff --git a/android/singleton.go b/android/singleton.go
index 8936cac65..47cfb2818 100644
--- a/android/singleton.go
+++ b/android/singleton.go
@@ -35,16 +35,6 @@ type SingletonContext interface {
// Allows generating build actions for `referer` based on the metadata for `name` deferred until the singleton context.
ModuleVariantsFromName(referer Module, name string) []Module
- // ModuleProvider returns the value, if any, for the provider for a module. If the value for the
- // provider was not set it returns the zero value of the type of the provider, which means the
- // return value can always be type-asserted to the type of the provider. The return value should
- // always be considered read-only. It panics if called before the appropriate mutator or
- // GenerateBuildActions pass for the provider on the module.
- ModuleProvider(module blueprint.Module, provider blueprint.AnyProviderKey) any
-
- // ModuleHasProvider returns true if the provider for the given module has been set.
- ModuleHasProvider(module blueprint.Module, provider blueprint.AnyProviderKey) bool
-
moduleProvider(module blueprint.Module, provider blueprint.AnyProviderKey) (any, bool)
ModuleErrorf(module blueprint.Module, format string, args ...interface{})
@@ -291,17 +281,6 @@ func (s *singletonContextAdaptor) ModuleVariantsFromName(referer Module, name st
return result
}
-func (s *singletonContextAdaptor) ModuleProvider(module blueprint.Module, provider blueprint.AnyProviderKey) any {
- value, _ := s.SingletonContext.ModuleProvider(module, provider)
- return value
-}
-
-// ModuleHasProvider returns true if the provider for the given module has been set.
-func (s *singletonContextAdaptor) ModuleHasProvider(module blueprint.Module, provider blueprint.AnyProviderKey) bool {
- _, ok := s.SingletonContext.ModuleProvider(module, provider)
- return ok
-}
-
func (s *singletonContextAdaptor) moduleProvider(module blueprint.Module, provider blueprint.AnyProviderKey) (any, bool) {
return s.SingletonContext.ModuleProvider(module, provider)
}