Undo restore of data if rollback is reverted on non-FS-checkpoint device.
This ensures that on a device without FS checkpointing support, if
an APEX rollback is reverted, the data is returned to its original
state (i.e. the rollback snapshot is not restored).
On FS checkpointing devices this happens automatically, but on
non-checkpointing devices we must take a "pre-restore" snapshot,
and restore that if the rollback is reverted.
The pre-restore snapshot is deleted as soon as it is used, or as
soon as the session is marked successful.
Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeUser
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_Ce
Test: Manual - disabled checkpointing in StagingManager, installed
APEX with rollback enabled, changed files in data dir, ensured session
would not be successful in StagingManager, committed rollback, checked
files in data dir were not rolled back.
Change-Id: I797edfc92a4e1985be3df62cacaacade4162f102
3 files changed