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

Commit 2f5a928e authored by TYM Tsai's avatar TYM Tsai Committed by Android (Google) Code Review
Browse files

Merge "Check dexopt result before commit" into main

parents 7a3d2442 054a1be8
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);