platform_bootable_recovery/updater
Tianjie Xu 284752e2bc Log the last command to cache
When performing an update, save the index and cmdline of the current
command into the last command file if this command writes to the stash
either explicitly of implicitly. This mitigates the overhead to update
the last command file for every command. I ran a simple test on angler
and the time to update 1000 times is ~2.3 seconds.

Upon resuming an update, read the saved index first; then
  1. In verification mode, check if all commands before the saved index
     have already produced the expected target blocks. If not, delete the
     last command file so that we will later resume the update from the
     start of the transfer list.
  2. In update mode, skip all commands before the saved index. Therefore,
     we can avoid deleting stashes with duplicate id unintentionally;
     and also speed up the update.

If an update succeeds or is unresumable, delete the last command file.
Bug: 69858743
Test: Unittest passed, apply a failed update with invalid cmd on angler
and check the last_command content, apply a failed update with invalid
source hash and last_command is deleted.
Change-Id: Ib60ba1e3c6d111d9f33097759b17dbcef97a37bf
2018-02-06 16:16:49 -08:00
..
include/updater Log the last command to cache 2018-02-06 16:16:49 -08:00
Android.mk Drop -Wno-unused-parameter. 2017-10-11 16:56:12 -07:00
blockimg.cpp Log the last command to cache 2018-02-06 16:16:49 -08:00
install.cpp Avoid overwrite of the error message in AbortFn 2018-01-29 11:42:59 -08:00
updater.cpp Revert "Revert "Move error_code.h into otautil."" 2017-10-09 14:07:54 -07:00