Merge "Disable() must not be enabled unexpectedly" am: 6aed6a385e am: f6b2c3297c

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1382317

Change-Id: Ia6d49cfd043cefe5016900c5c8f1c562267e605c
This commit is contained in:
Treehugger Robot
2020-08-01 09:12:22 +00:00
committed by Automerger Merge Worker

View File

@@ -549,6 +549,9 @@ type commonProperties struct {
SkipInstall bool `blueprint:"mutated"`
// Disabled by mutators. If set to true, it overrides Enabled property.
ForcedDisabled bool `blueprint:"mutated"`
NamespaceExportedToMake bool `blueprint:"mutated"`
MissingDeps []string `blueprint:"mutated"`
@@ -1023,6 +1026,9 @@ func (m *ModuleBase) PartitionTag(config DeviceConfig) string {
}
func (m *ModuleBase) Enabled() bool {
if m.commonProperties.ForcedDisabled {
return false
}
if m.commonProperties.Enabled == nil {
return !m.Os().DefaultDisabled
}
@@ -1030,7 +1036,7 @@ func (m *ModuleBase) Enabled() bool {
}
func (m *ModuleBase) Disable() {
m.commonProperties.Enabled = proptools.BoolPtr(false)
m.commonProperties.ForcedDisabled = true
}
func (m *ModuleBase) SkipInstall() {