Prebuilt is enabled even if the source one is not.

This fix a bug in a recent android_app_import-related change
(I8215aa1a6dad74b503eaa1169a64f8c30dda287c) where it uses an incorrect
module reference, and so disables a prebuilt module if its source-based
counterpart is disabled.

Test: app_test.go
Bug: 152343232
Change-Id: Ic7f5ca40be58f06e44b5ec4945caf209ef2dae96
This commit is contained in:
Jaewoong Jung
2020-12-08 19:11:54 -08:00
parent 0bc9a9ad6b
commit 729c0bdb54
2 changed files with 29 additions and 1 deletions

View File

@@ -178,7 +178,7 @@ func InitSingleSourcePrebuiltModule(module PrebuiltInterface, srcProps interface
srcPropertyName := proptools.PropertyNameForField(srcField)
srcsSupplier := func(ctx BaseModuleContext) []string {
if !ctx.Module().Enabled() {
if !module.Enabled() {
return nil
}
value := srcPropsValue.FieldByIndex(srcFieldIndex)