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

Commit 054a1be8 authored by TYM Tsai's avatar TYM Tsai
Browse files

Check dexopt result before commit

Bug: 408461404
Flag: EXEMPT bugfix
Test: atest CtsPackageInstallTestCases
Change-Id: I05bb477119b789ee8b78c264b47d8e8f3de6b075
parent 168d2b61
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1071,12 +1071,16 @@ final class InstallPackageHelper {
    void doPostDexopt(List<ReconciledPackage> reconciledPackages,
            List<InstallRequest> requests, Map<String, Boolean> createdAppId,
            MoveInfo moveInfo, long acquireTime) {
        boolean isDexoptSuccess = true;
        for (InstallRequest request : requests) {
            request.onWaitDexoptFinished();
            if (request.getReturnCode() != PackageManager.INSTALL_SUCCEEDED) {
                isDexoptSuccess = false;
            }
        }
        boolean success = false;
        try {
            if (commitInstallPackages(reconciledPackages)) {
            if (isDexoptSuccess && commitInstallPackages(reconciledPackages)) {
                success = true;
            }
        } finally {
@@ -1218,6 +1222,7 @@ final class InstallPackageHelper {
                }
            } catch (PackageManagerException e) {
                request.setError(e.error, e.getMessage());
                completableFutures.clear();
                break;
            }
            request.setKeepArtProfile(true);