Merge "Pass APK_IN_APEX flag when parsing apk in apexes" into tm-dev am: 938c3d933f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18029245

Change-Id: I8837548601c794a3707bef47fb06f3135b111d9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Pedro Loureiro
2022-05-09 18:48:44 +00:00
committed by Automerger Merge Worker
3 changed files with 10 additions and 1 deletions

View File

@@ -567,9 +567,14 @@ public class ApkLiteParseUtils {
targetCode = minCode;
}
boolean allowUnknownCodenames = false;
if ((flags & FrameworkParsingPackageUtils.PARSE_APK_IN_APEX) != 0) {
allowUnknownCodenames = true;
}
ParseResult<Integer> targetResult = FrameworkParsingPackageUtils.computeTargetSdkVersion(
targetVer, targetCode, SDK_CODENAMES, input,
/* allowUnknownCodenames= */ false);
allowUnknownCodenames);
if (targetResult.isError()) {
return input.error(targetResult);
}

View File

@@ -58,6 +58,7 @@ public class FrameworkParsingPackageUtils {
private static final int MAX_FILE_NAME_SIZE = 223;
public static final int PARSE_IGNORE_OVERLAY_REQUIRED_SYSTEM_PROPERTY = 1 << 7;
public static final int PARSE_APK_IN_APEX = 1 << 9;
/**
* Check if the given name is valid.

View File

@@ -392,6 +392,9 @@ public class ParsingPackageUtils {
if ((flags & PARSE_FRAMEWORK_RES_SPLITS) != 0) {
liteParseFlags = flags;
}
if ((flags & PARSE_APK_IN_APEX) != 0) {
liteParseFlags |= PARSE_APK_IN_APEX;
}
final ParseResult<PackageLite> liteResult =
ApkLiteParseUtils.parseClusterPackageLite(input, packageDir, frameworkSplits,
liteParseFlags);