Make needsCheckpoint cover whole session

This makes needCheckpoint return true when the device will or is using
checkpointing.

Test: vdc checkpoint startCheckpoint 1
      reboot
      vdc checkpoint needsCheckpoint
      should return 1 before and after data mounts, and 0 once the
      checkpoint has been committed

Change-Id: Ib57f4461d837f41a8110ed318168165a684d913a
This commit is contained in:
Daniel Rosenberg 2019-03-19 14:02:59 -07:00
parent a41b7849d0
commit 84203c1e24

View file

@ -212,6 +212,8 @@ bool cp_needsCheckpoint() {
std::string content; std::string content;
sp<IBootControl> module = IBootControl::getService(); sp<IBootControl> module = IBootControl::getService();
if (isCheckpointing) return isCheckpointing;
if (module && module->isSlotMarkedSuccessful(module->getCurrentSlot()) == BoolResult::FALSE) { if (module && module->isSlotMarkedSuccessful(module->getCurrentSlot()) == BoolResult::FALSE) {
isCheckpointing = true; isCheckpointing = true;
return true; return true;