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

This commit is contained in:
Mohammad Samiul Islam
2020-05-11 11:45:02 +00:00
committed by Android (Google) Code Review

View File

@@ -354,13 +354,19 @@ public class StagingManager {
Slog.e(TAG, "Aborting checkpoint: " + errorMsg);
try {
if (supportsCheckpoint() && needsCheckpoint()) {
mApexManager.revertActiveSessions();
// 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);
mApexManager.revertActiveSessions();
// Only revert apex sessions if device supports updating apex
if (mApexManager.isApexSupported()) {
mApexManager.revertActiveSessions();
}
mPowerManager.reboot(null);
}
}