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

Commit 5ee5a5b9 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Better error message in case of multiple splits.

Bug: 281197001
Test: atest CtsPackageInstallTestCases
Change-Id: I1f57e491ffe99698b89b7108a9feda93526053a7
parent 7cc9a4bb
Loading
Loading
Loading
Loading
+31 −27
Original line number Diff line number Diff line
@@ -185,7 +185,10 @@ public class ApkLiteParseUtils {
        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parseApkLite");
        try {
            for (File file : files) {
                if (isApkFile(file)) {
                if (!isApkFile(file)) {
                    continue;
                }

                final ParseResult<ApkLite> result = parseApkLite(input, file, flags);
                if (result.isError()) {
                    return input.error(result);
@@ -210,12 +213,13 @@ public class ApkLiteParseUtils {
                    }
                }

                    // Assert that each split is defined only oncuses-static-libe
                    if (apks.put(lite.getSplitName(), lite) != null) {
                // Assert that each split is defined only once
                ApkLite prev = apks.put(lite.getSplitName(), lite);
                if (prev != null) {
                    return input.error(PackageManager.INSTALL_PARSE_FAILED_BAD_MANIFEST,
                            "Split name " + lite.getSplitName()
                                        + " defined more than once; most recent was " + file);
                    }
                                    + " defined more than once; most recent was " + file
                                    + ", previous was " + prev.getPath());
                }
            }
            baseApk = apks.remove(null);