Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72e144cd authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Allow pre-R apps to test compressed ARSC error

This change removes the initial target SDK check which prevents apps
that target pre-Q from testing that they fail to be install if the
compatibility change is enabled for pre-Q packages.

Bug: 132742131
Test: adb shell am compat enable 132742131 for app with compressed ARSC
      that targets pre-R
Change-Id: I7e568a9e99045c09565bb372e454f573b954fea5
parent ac774e33
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -346,12 +346,11 @@ public class ParsingPackageUtils {
            }

            final ParsingPackage pkg = result.getResult();
            if (pkg.getTargetSdkVersion() >= Build.VERSION_CODES.R
                    && assets.containsAllocatedTable()) {
            if (assets.containsAllocatedTable()) {
                final ParseResult<?> deferResult = input.deferError(
                        "Targeting R+ (version" + Build.VERSION_CODES.R + " and above) requires the"
                                + " resources.arsc of installed APKs to be stored uncompressed and"
                                + " aligned on a 4-byte boundary",
                        "Targeting R+ (version " + Build.VERSION_CODES.R + " and above) requires"
                                + " the resources.arsc of installed APKs to be stored uncompressed"
                                + " and aligned on a 4-byte boundary",
                        DeferredError.RESOURCES_ARSC_COMPRESSED);
                if (deferResult.isError()) {
                    return input.error(INSTALL_PARSE_FAILED_RESOURCES_ARSC_COMPRESSED,