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
diff --git a/apex/apex.go b/apex/apex.go
index 54a335a..c5e0920 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1275,6 +1275,11 @@
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 @@
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)