Don't remove non-installable apex deps from the system install
We were marking any libraries included in any apex (including
non-installable apex's like com.android.runtime.host) as
uninstallable. This could cause phones to become unbootable if these
apex's are modified.
Bug: 123892969
Test: m droid && boot device.
Change-Id: Ief9004bbe7b106ee8f52715ce5bd7bb5accec290
diff --git a/apex/apex.go b/apex/apex.go
index d25c256..06e6c78 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -147,13 +147,18 @@
// Mark the direct and transitive dependencies of apex bundles so that they
// can be built for the apex bundles.
func apexDepsMutator(mctx android.TopDownMutatorContext) {
- if _, ok := mctx.Module().(*apexBundle); ok {
+ if a, ok := mctx.Module().(*apexBundle); ok {
apexBundleName := mctx.ModuleName()
mctx.WalkDeps(func(child, parent android.Module) bool {
depName := mctx.OtherModuleName(child)
// If the parent is apexBundle, this child is directly depended.
_, directDep := parent.(*apexBundle)
- android.UpdateApexDependency(apexBundleName, depName, directDep)
+ if a.installable() {
+ // TODO(b/123892969): Workaround for not having any way to annotate test-apexs
+ // non-installable apex's cannot be installed and so should not prevent libraries from being
+ // installed to the system.
+ android.UpdateApexDependency(apexBundleName, depName, directDep)
+ }
if am, ok := child.(android.ApexModule); ok && am.CanHaveApexVariants() {
am.BuildForApex(apexBundleName)