Merge "Make 'Compressible' an overridable property"

This commit is contained in:
Oriol Prieto Gasco
2021-11-17 00:19:13 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 9 deletions

View File

@@ -135,12 +135,6 @@ type apexBundleProperties struct {
// Default: true.
Installable *bool
// Whether this APEX can be compressed or not. Setting this property to false means this
// APEX will never be compressed. When set to true, APEX will be compressed if other
// conditions, e.g, target device needs to support APEX compression, are also fulfilled.
// Default: true.
Compressible *bool
// If set true, VNDK libs are considered as stable libs and are not included in this APEX.
// Should be only used in non-system apexes (e.g. vendor: true). Default is false.
Use_vndk_as_stable *bool
@@ -321,6 +315,12 @@ type overridableProperties struct {
// certificate and the private key are provided from the android_app_certificate module
// named "module".
Certificate *string
// Whether this APEX can be compressed or not. Setting this property to false means this
// APEX will never be compressed. When set to true, APEX will be compressed if other
// conditions, e.g., target device needs to support APEX compression, are also fulfilled.
// Default: false.
Compressible *bool
}
type apexBundle struct {
@@ -1279,7 +1279,7 @@ func (a *apexBundle) EnableCoverageIfNeeded() {}
var _ android.ApexBundleDepsInfoIntf = (*apexBundle)(nil)
// Implements android.ApexBudleDepsInfoIntf
// Implements android.ApexBundleDepsInfoIntf
func (a *apexBundle) Updatable() bool {
return proptools.BoolDefault(a.properties.Updatable, true)
}

View File

@@ -528,8 +528,8 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
outHostBinDir := ctx.Config().HostToolPath(ctx, "").String()
prebuiltSdkToolsBinDir := filepath.Join("prebuilts", "sdk", "tools", runtime.GOOS, "bin")
// Figure out if need to compress apex.
compressionEnabled := ctx.Config().CompressedApex() && proptools.BoolDefault(a.properties.Compressible, false) && !a.testApex && !ctx.Config().UnbundledBuildApps()
// Figure out if we need to compress the apex.
compressionEnabled := ctx.Config().CompressedApex() && proptools.BoolDefault(a.overridableProperties.Compressible, false) && !a.testApex && !ctx.Config().UnbundledBuildApps()
if apexType == imageApex {
////////////////////////////////////////////////////////////////////////////////////
// Step 2: create canned_fs_config which encodes filemode,uid,gid of each files