summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2023-12-20 01:00:27 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-12-20 01:00:27 +0000
commita4cca85eeabdb2f7e35f447936c449a345428d5a (patch)
tree18967296dbec01a63f79d0048964808352197de8 /android/testing.go
parente87e278086e8add5b3cc8be36e861de4fef54280 (diff)
parent84b68c90ae68434f58e866e26efd3b25ce4d4338 (diff)
Merge "Revert "Remove non-generic provider APIs"" into main
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/android/testing.go b/android/testing.go
index 3d0300a01..39a268b23 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -203,6 +203,16 @@ func (ctx *TestContext) HardCodedPreArchMutators(f RegisterMutatorFunc) {
ctx.PreArchMutators(f)
}
+func (ctx *TestContext) ModuleProvider(m blueprint.Module, p blueprint.AnyProviderKey) any {
+ value, _ := ctx.Context.ModuleProvider(m, p)
+ return value
+}
+
+func (ctx *TestContext) ModuleHasProvider(m blueprint.Module, p blueprint.AnyProviderKey) bool {
+ _, ok := ctx.Context.ModuleProvider(m, p)
+ return ok
+}
+
func (ctx *TestContext) moduleProvider(m blueprint.Module, p blueprint.AnyProviderKey) (any, bool) {
return ctx.Context.ModuleProvider(m, p)
}