Don't evaluate the enabled property in a defaultable hook
So that we can decide the configuration after defaults are evaluated. Instead, pass the enabled property on to submodules. Bug: 361816274 Test: m nothing --no-skip-soong-tests Change-Id: I853d557ed022f7434287cea0a2a19e684b59e145
This commit is contained in:
@@ -1346,6 +1346,14 @@ func (m *ModuleBase) Enabled(ctx ConfigurableEvaluatorContext) bool {
|
||||
return m.commonProperties.Enabled.GetOrDefault(m.ConfigurableEvaluator(ctx), !m.Os().DefaultDisabled)
|
||||
}
|
||||
|
||||
// Returns a copy of the enabled property, useful for passing it on to sub-modules
|
||||
func (m *ModuleBase) EnabledProperty() proptools.Configurable[bool] {
|
||||
if m.commonProperties.ForcedDisabled {
|
||||
return proptools.NewSimpleConfigurable(false)
|
||||
}
|
||||
return m.commonProperties.Enabled.Clone()
|
||||
}
|
||||
|
||||
func (m *ModuleBase) Disable() {
|
||||
m.commonProperties.ForcedDisabled = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user