summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-08-01 08:40:06 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-08-01 08:40:06 +0000
commit6aed6a385e34d34eda6a1668b5bdd00e4cbc11f5 (patch)
tree6375150329fa3508bf5fb5f9fd15d2aeb89a1645
parentfcb53d9d2a127c879b0f602b3cf758fcd2231a23 (diff)
parent32f053b97ead0ed9660a9a38073b5788cc1906aa (diff)
Merge "Disable() must not be enabled unexpectedly"
-rw-r--r--android/module.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/android/module.go b/android/module.go
index 2062a4d4d..a12cd9b10 100644
--- a/android/module.go
+++ b/android/module.go
@@ -548,6 +548,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"`
@@ -1022,6 +1025,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
}
@@ -1029,7 +1035,7 @@ func (m *ModuleBase) Enabled() bool {
}
func (m *ModuleBase) Disable() {
- m.commonProperties.Enabled = proptools.BoolPtr(false)
+ m.commonProperties.ForcedDisabled = true
}
func (m *ModuleBase) SkipInstall() {