Merge "Add TARGET_FORCE_APEX_SYMLINK_OPTIMIZATION" am: 0d96ed8d5b

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1540045

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I717911fca457c5a482110be772568c3463fdeece
This commit is contained in:
Treehugger Robot
2021-01-06 04:35:34 +00:00
committed by Automerger Merge Worker
3 changed files with 12 additions and 5 deletions

View File

@@ -1272,6 +1272,10 @@ func (c *config) FlattenApex() bool {
return Bool(c.productVariables.Flatten_apex) return Bool(c.productVariables.Flatten_apex)
} }
func (c *config) ForceApexSymlinkOptimization() bool {
return Bool(c.productVariables.ForceApexSymlinkOptimization)
}
func (c *config) CompressedApex() bool { func (c *config) CompressedApex() bool {
return Bool(c.productVariables.CompressedApex) return Bool(c.productVariables.CompressedApex)
} }

View File

@@ -321,6 +321,7 @@ type productVariables struct {
Exclude_draft_ndk_apis *bool `json:",omitempty"` Exclude_draft_ndk_apis *bool `json:",omitempty"`
Flatten_apex *bool `json:",omitempty"` Flatten_apex *bool `json:",omitempty"`
ForceApexSymlinkOptimization *bool `json:",omitempty"`
CompressedApex *bool `json:",omitempty"` CompressedApex *bool `json:",omitempty"`
Aml_abis *bool `json:",omitempty"` Aml_abis *bool `json:",omitempty"`

View File

@@ -1913,9 +1913,11 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.linkToSystemLib = false a.linkToSystemLib = false
} }
forced := ctx.Config().ForceApexSymlinkOptimization()
// We don't need the optimization for updatable APEXes, as it might give false signal // 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) // to the system health when the APEXes are still bundled (b/149805758).
if a.Updatable() && a.properties.ApexType == imageApex { if !forced && a.Updatable() && a.properties.ApexType == imageApex {
a.linkToSystemLib = false a.linkToSystemLib = false
} }