have a per-module switch to turn the symlinking optimizaiton off

The optimization is confusing syshealth because the modules will use
more memory when they are switched to the prebuilt (unbundled) or
updated via Play.

Let's have a per-module switch to control the behavior and turn it on
only for non-updatable modules like ART.

Bug: 149805758
Test: m
Change-Id: Ieb842c47f31f3b06e403b1e1f9e463c3e5524107
This commit is contained in:
Jiyong Park
2020-02-19 16:29:35 +09:00
parent 7c9662a8e9
commit 9d677206d1
2 changed files with 37 additions and 0 deletions

View File

@@ -1275,6 +1275,11 @@ type apexBundleProperties struct {
Legacy_android10_support *bool
IsCoverageVariant bool `blueprint:"mutated"`
// Whether this APEX is considered updatable or not. When set to true, this will enforce additional
// rules for making sure that the APEX is truely updatable. This will also disable the size optimizations
// like symlinking to the system libs. Default is false.
Updatable *bool
}
type apexTargetBundleProperties struct {
@@ -2312,6 +2317,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.installable() &&
!proptools.Bool(a.properties.Use_vendor)
// We don't need the optimization for updatable APEXes, as it might give false signal
// to the system health when the APEXes are still bundled (b/149805758)
if proptools.Bool(a.properties.Updatable) && a.properties.ApexType == imageApex {
a.linkToSystemLib = false
}
// prepare apex_manifest.json
a.buildManifest(ctx, provideNativeLibs, requireNativeLibs)