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

Commit d8b6b0fb authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam Committed by Android (Google) Code Review
Browse files

Merge "Avoid reverting apex on devices that do not support updating apex" into rvc-dev

parents 5681f3e7 5bf077de
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -354,13 +354,19 @@ public class StagingManager {
        Slog.e(TAG, "Aborting checkpoint: " + errorMsg);
        try {
            if (supportsCheckpoint() && needsCheckpoint()) {
                // Only revert apex sessions if device supports updating apex
                if (mApexManager.isApexSupported()) {
                    mApexManager.revertActiveSessions();
                }
                PackageHelper.getStorageManager().abortChanges(
                        "StagingManager initiated", false /*retry*/);
            }
        } catch (Exception e) {
            Slog.wtf(TAG, "Failed to abort checkpoint", e);
            // Only revert apex sessions if device supports updating apex
            if (mApexManager.isApexSupported()) {
                mApexManager.revertActiveSessions();
            }
            mPowerManager.reboot(null);
        }
    }