Loading apex/apex.go +7 −1 Original line number Diff line number Diff line Loading @@ -1755,7 +1755,13 @@ func (a *apexBundle) setPayloadFsType(ctx android.ModuleContext) { } func (a *apexBundle) isCompressable() bool { return proptools.BoolDefault(a.overridableProperties.Compressible, false) && !a.testApex if a.testApex { return false } if a.payloadFsType == erofs { return false } return proptools.Bool(a.overridableProperties.Compressible) } func (a *apexBundle) commonBuildActions(ctx android.ModuleContext) bool { Loading apex/apex_test.go +27 −0 Original line number Diff line number Diff line Loading @@ -9094,6 +9094,33 @@ func TestCompressedApex(t *testing.T) { ensureContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.capex\n") } func TestCompressedApexIsDisabledWhenUsingErofs(t *testing.T) { t.Parallel() ctx := testApex(t, ` apex { name: "myapex", key: "myapex.key", compressible: true, updatable: false, payload_fs_type: "erofs", } apex_key { name: "myapex.key", public_key: "testkey.avbpubkey", private_key: "testkey.pem", } `, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { variables.CompressedApex = proptools.BoolPtr(true) }), ) compressRule := ctx.ModuleForTests("myapex", "android_common_myapex").MaybeRule("compressRule") if compressRule.Rule != nil { t.Error("erofs apex should not be compressed") } } func TestApexSet_ShouldRespectCompressedApexFlag(t *testing.T) { t.Parallel() for _, compressionEnabled := range []bool{true, false} { Loading Loading
apex/apex.go +7 −1 Original line number Diff line number Diff line Loading @@ -1755,7 +1755,13 @@ func (a *apexBundle) setPayloadFsType(ctx android.ModuleContext) { } func (a *apexBundle) isCompressable() bool { return proptools.BoolDefault(a.overridableProperties.Compressible, false) && !a.testApex if a.testApex { return false } if a.payloadFsType == erofs { return false } return proptools.Bool(a.overridableProperties.Compressible) } func (a *apexBundle) commonBuildActions(ctx android.ModuleContext) bool { Loading
apex/apex_test.go +27 −0 Original line number Diff line number Diff line Loading @@ -9094,6 +9094,33 @@ func TestCompressedApex(t *testing.T) { ensureContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.capex\n") } func TestCompressedApexIsDisabledWhenUsingErofs(t *testing.T) { t.Parallel() ctx := testApex(t, ` apex { name: "myapex", key: "myapex.key", compressible: true, updatable: false, payload_fs_type: "erofs", } apex_key { name: "myapex.key", public_key: "testkey.avbpubkey", private_key: "testkey.pem", } `, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { variables.CompressedApex = proptools.BoolPtr(true) }), ) compressRule := ctx.ModuleForTests("myapex", "android_common_myapex").MaybeRule("compressRule") if compressRule.Rule != nil { t.Error("erofs apex should not be compressed") } } func TestApexSet_ShouldRespectCompressedApexFlag(t *testing.T) { t.Parallel() for _, compressionEnabled := range []bool{true, false} { Loading