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