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
This commit is contained in:
Ryan Mitchell
2020-04-28 10:53:40 -07:00
parent ac774e3304
commit 72e144cd18

View File

@@ -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,