Fail staged session if apexd session is in ROLLBACK_IN_PROGRESS state

This covers a (very unlikely) scenario, in which device was rebooted
during apexd rollback, and apexd wasn't able to resume rollback after
the reboot.

For a tiny bit more context see: aosp/912794

Bug: 123622800
Test: none
Change-Id: Idbb142dce2dbc85b818ba42e93ab107e4955301d
This commit is contained in:
Nikita Ioffe
2019-02-27 15:34:08 +00:00
parent 750c23d541
commit fb6688e3fe

View File

@@ -491,8 +491,10 @@ public class StagingManager {
}
private static boolean isApexSessionFailed(ApexSessionInfo apexSessionInfo) {
// isRollbackInProgress is included to cover the scenario, when a device is rebooted in
// during the rollback, and apexd fails to resume the rollback after reboot.
return apexSessionInfo.isActivationFailed || apexSessionInfo.isUnknown
|| apexSessionInfo.isRolledBack;
|| apexSessionInfo.isRolledBack || apexSessionInfo.isRollbackInProgress;
}
@GuardedBy("mStagedSessions")