Avoid reverting apex on devices that do not support updating apex
Bug: 151402767 Test: built with OVERRIDE_TARGET_FLATTEN_APEX=true and then ran atest StagedInstallTest#testInstallMultipleStagedSession_PartialFail_ApkOnly Change-Id: Ice0cf48cbea87b3aec1906cb42e1739487fcc19f
This commit is contained in:
@@ -350,13 +350,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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user