diff options
author | 2024-07-31 15:04:05 +0900 | |
---|---|---|
committer | 2024-07-31 15:04:05 +0900 | |
commit | 26ec8484e45134f985cd2a97e4cc02389ccc8c26 (patch) | |
tree | 287e2c4ffcaa3530dbfd1faea6fd44328eaab87b /apex/prebuilt.go | |
parent | 469b5a12361cab348d67ca97524574d60ef9435a (diff) |
apex: respect PRODUCT_COMPRESSED_APEX for prebuilt APEXes
If a prebuilt APEX is compressed, it's installed without decompression
even when PRODUCT_COMPRESSED_APEX is false.
This change decompresses the prebuilt/compressed APEX.
Bug: 356533488
Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=false m
Change-Id: Ifdde074e383837df92d172bc483bfca9a97cb6f8
Diffstat (limited to 'apex/prebuilt.go')
-rw-r--r-- | apex/prebuilt.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apex/prebuilt.go b/apex/prebuilt.go index b9cc09ba7..5e46bab60 100644 --- a/apex/prebuilt.go +++ b/apex/prebuilt.go @@ -42,6 +42,11 @@ var ( CommandDeps: []string{"${extract_apks}"}, }, "abis", "allow-prereleased", "sdk-version", "skip-sdk-check") + decompressApex = pctx.StaticRule("decompressApex", blueprint.RuleParams{ + Command: `${deapexer} decompress --copy-if-uncompressed --input ${in} --output ${out}`, + CommandDeps: []string{"${deapexer}"}, + Description: "decompress", + }) ) type prebuilt interface { @@ -1072,8 +1077,14 @@ func (a *ApexSet) GenerateAndroidBuildActions(ctx android.ModuleContext) { inputApex := android.OptionalPathForModuleSrc(ctx, a.prebuiltCommonProperties.Selected_apex).Path() a.outputApex = android.PathForModuleOut(ctx, a.installFilename) + + // Build the output APEX. If compression is not enabled, make sure the output is not compressed even if the input is compressed + buildRule := android.Cp + if !ctx.Config().ApexCompressionEnabled() { + buildRule = decompressApex + } ctx.Build(pctx, android.BuildParams{ - Rule: android.Cp, + Rule: buildRule, Input: inputApex, Output: a.outputApex, }) |