diff options
author | 2023-12-20 00:59:28 +0000 | |
---|---|---|
committer | 2023-12-20 00:59:28 +0000 | |
commit | 84b68c90ae68434f58e866e26efd3b25ce4d4338 (patch) | |
tree | f8a6bddfb1fc02a663884ec9d500a831607572be /android/testing.go | |
parent | ad50aca6aba29c866baf6eae65e3280eee0acc98 (diff) |
Revert "Remove non-generic provider APIs"
This reverts commit ad50aca6aba29c866baf6eae65e3280eee0acc98.
Reason for revert: Broke builds when combined with aosp/2876755
Change-Id: I3bfbcb05d8c695b9315b7e8e3f63c6bd5c9dbe36
Diffstat (limited to 'android/testing.go')
-rw-r--r-- | android/testing.go | 10 |
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) } |