apexd: create new hashtree during pre-reboot verification
This CL changes logic around hashtree generation a bit:
1. During pre-reboot verification of apex foo, a new hashtree is
generated and stored in /data/apex/hashtree/foo@version.new (if file
already existed, it will be deleted first)
2. On next boot, this new hashtrees is moved to
/data/apex/hashtree/foo@version as part of stagePackages
3. If stagePackages fails, hashtree files are deleted
This way pre-reboot verification doesn't impact hashtree of already
active packages.
Test: atest apexservice_test
Bug: 145670581
Change-Id: I9ff6961f8674d95d1daba421948bd230dbef0d4b
8 files changed