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

Commit 2dc94167 authored by Pedro Loureiro's avatar Pedro Loureiro
Browse files

Pass APK_IN_APEX flag when parsing apk in apexes

Not caught in unit tests because this is more an integration failure
(detected when writing e2e tests).

Bug: 208239394

Test: the actual e2e test will be published when this is submitted
Test: m ApkInApexTest
Change-Id: I8b62e473e2b3613cf290ff05963a47ba86140d99
parent cd1db9f3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);
                }
+1 −0
Original line number Diff line number Diff line
@@ -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.
+3 −0
Original line number Diff line number Diff line
@@ -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);