From 4e2bf9fb2d3ede98da38a6574a17a6ec2d6bb84e Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 11 Sep 2024 13:26:20 -0700 Subject: Add HasMutatorFinished To enforce that selects are only evaluated after a certain point in a followup cl. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: Ib215fedb904aa2e5f4d65cfd26a23f527eb4983e --- android/singleton.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'android/singleton.go') diff --git a/android/singleton.go b/android/singleton.go index 8542bd9e6..913bf6a56 100644 --- a/android/singleton.go +++ b/android/singleton.go @@ -90,6 +90,10 @@ type SingletonContext interface { // OtherModulePropertyErrorf reports an error on the line number of the given property of the given module OtherModulePropertyErrorf(module Module, property string, format string, args ...interface{}) + + // HasMutatorFinished returns true if the given mutator has finished running. + // It will panic if given an invalid mutator name. + HasMutatorFinished(mutatorName string) bool } type singletonAdaptor struct { @@ -286,3 +290,7 @@ func (s *singletonContextAdaptor) otherModuleProvider(module blueprint.Module, p func (s *singletonContextAdaptor) OtherModulePropertyErrorf(module Module, property string, format string, args ...interface{}) { s.blueprintSingletonContext().OtherModulePropertyErrorf(module, property, format, args...) } + +func (s *singletonContextAdaptor) HasMutatorFinished(mutatorName string) bool { + return s.blueprintSingletonContext().HasMutatorFinished(mutatorName) +} -- cgit v1.2.3-59-g8ed1b