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
This commit is contained in:
@@ -8993,6 +8993,30 @@ func TestCompressedApex(t *testing.T) {
|
||||
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.capex\n")
|
||||
}
|
||||
|
||||
func TestApexSet_ShouldRespectCompressedApexFlag(t *testing.T) {
|
||||
for _, compressionEnabled := range []bool{true, false} {
|
||||
t.Run(fmt.Sprintf("compressionEnabled=%v", compressionEnabled), func(t *testing.T) {
|
||||
ctx := testApex(t, `
|
||||
apex_set {
|
||||
name: "com.company.android.myapex",
|
||||
apex_name: "com.android.myapex",
|
||||
set: "company-myapex.apks",
|
||||
}
|
||||
`, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.CompressedApex = proptools.BoolPtr(compressionEnabled)
|
||||
}),
|
||||
)
|
||||
|
||||
build := ctx.ModuleForTests("com.company.android.myapex", "android_common_com.android.myapex").Output("com.company.android.myapex.apex")
|
||||
if compressionEnabled {
|
||||
ensureEquals(t, build.Rule.String(), "android/soong/android.Cp")
|
||||
} else {
|
||||
ensureEquals(t, build.Rule.String(), "android/apex.decompressApex")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestPreferredPrebuiltSharedLibDep(t *testing.T) {
|
||||
ctx := testApex(t, `
|
||||
apex {
|
||||
|
Reference in New Issue
Block a user