Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49ae3d98 authored by Alex Light's avatar Alex Light
Browse files

Don't use stubs for host apexs

Host apexs don't have a system-image associated with them so we need
to include all libraries, including those with stubs.

Test: ./art/test/testrunner/run_build_test_target.py -j50 art-linux-bionic-x64-zipapex
Bug: 125417922
Change-Id: Ie76e6a34e8be1057b29e2e005597c3e4b5fb1f9c
parent 44df5814
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -733,11 +733,14 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
			// indirect dependencies
			if am, ok := child.(android.ApexModule); ok && am.CanHaveApexVariants() && am.IsInstallableToApex() {
				if cc, ok := child.(*cc.Module); ok {
					if cc.IsStubs() || cc.HasStubsVariants() {
					if !a.Host() && (cc.IsStubs() || cc.HasStubsVariants()) {
						// If the dependency is a stubs lib, don't include it in this APEX,
						// but make sure that the lib is installed on the device.
						// In case no APEX is having the lib, the lib is installed to the system
						// partition.
						//
						// Always include if we are a host-apex however since those won't have any
						// system libraries.
						if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.Name(), a.externalDeps) {
							a.externalDeps = append(a.externalDeps, cc.Name())
						}