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

Change-Id: I28a2a568089d1b6a07c6a9cb0f08d99cae9bb335
This commit is contained in:
Mohammad Samiul Islam
2020-05-11 12:02:01 +00:00
committed by Automerger Merge Worker

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);
}
}