summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go
index 28d83e881..fd3fec333 100644
--- a/android/module.go
+++ b/android/module.go
@@ -204,6 +204,7 @@ type Module interface {
DepsMutator(BottomUpMutatorContext)
base() *ModuleBase
+ Disable()
Enabled() bool
Target() Target
InstallInData() bool
@@ -293,6 +294,12 @@ type nameProperties struct {
type commonProperties struct {
// emit build rules for this module
+ //
+ // Disabling a module should only be done for those modules that cannot be built
+ // in the current environment. Modules that can build in the current environment
+ // but are not usually required (e.g. superceded by a prebuilt) should not be
+ // disabled as that will prevent them from being built by the checkbuild target
+ // and so prevent early detection of changes that have broken those modules.
Enabled *bool `android:"arch_variant"`
// Controls the visibility of this module to other modules. Allowable values are one or more of
@@ -830,6 +837,10 @@ func (m *ModuleBase) Enabled() bool {
return *m.commonProperties.Enabled
}
+func (m *ModuleBase) Disable() {
+ m.commonProperties.Enabled = proptools.BoolPtr(false)
+}
+
func (m *ModuleBase) SkipInstall() {
m.commonProperties.SkipInstall = true
}
@@ -1101,6 +1112,9 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
if !ctx.PrimaryArch() {
suffix = append(suffix, ctx.Arch().ArchType.String())
}
+ if apex, ok := m.module.(ApexModule); ok && !apex.IsForPlatform() {
+ suffix = append(suffix, apex.ApexName())
+ }
ctx.Variable(pctx, "moduleDesc", desc)