Do not consider disabled prebuilt variants.
This relands https://r.android.com/1356826 without changes. It got
reverted as part of b/161315642 but is not related to that issue.
Test: m nothing
Test: `m` with prebuilt SDKs in the manifest
Bug: 151303681
Bug: 161315642
Change-Id: I7af892ae28a8208113e0801b1b8a8204edb61ec8
diff --git a/android/prebuilt.go b/android/prebuilt.go
index 9f4df28..269ad5d 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -225,7 +225,7 @@
// PrebuiltSourceDepsMutator adds dependencies to the prebuilt module from the
// corresponding source module, if one exists for the same variant.
func PrebuiltSourceDepsMutator(ctx BottomUpMutatorContext) {
- if m, ok := ctx.Module().(PrebuiltInterface); ok && m.Prebuilt() != nil {
+ if m, ok := ctx.Module().(PrebuiltInterface); ok && m.Enabled() && m.Prebuilt() != nil {
p := m.Prebuilt()
if !p.properties.PrebuiltRenamedToSource {
name := m.base().BaseModuleName()