apexd: if necessary resume rollback during boot sequence

This covers a scenario, in which device was rebooted during the
rollback. In this case, apexd will resume the rollback. It is safe to
resume it right after scanStagedSessionsDirAndStage, because
/data/apex/sessions will be empty making scanStagedSessionsDirAndStage a
no-op.

Since rename is an atomic operation, resuming a rollback is rather
straightforward:
* if /data/apex/backup exists -> do full rollback;
* otherwise just mark session as rolled back;

Bug: 123622800
Test: apex_e2e_tests, apexservice_test
Change-Id: Ia24e0deb42d77a73395f7f1146490622caead95d
3 files changed
tree: 254e2790ee5684b0245d2d9b93f32faf05542a23
  1. apexd/
  2. apexer/
  3. proto/
  4. tests/
  5. OWNERS
  6. PREUPLOAD.cfg
  7. TEST_MAPPING