summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-08 02:36:32 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-05-08 02:36:32 +0200
commit13784d1511ef4582c8cbe6ff2a00f936ca57d962 (patch)
tree4c1ce950534a018a1c1d2241c3d147f06b105939
parentrecovery: Refactor logging code into logging.cpp (diff)
parentMerge "updater: Fix an issue when resuming an update." (diff)
downloadandroid_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.tar
android_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.tar.gz
android_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.tar.bz2
android_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.tar.lz
android_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.tar.xz
android_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.tar.zst
android_bootable_recovery-13784d1511ef4582c8cbe6ff2a00f936ca57d962.zip
Diffstat (limited to '')
-rw-r--r--updater/blockimg.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index d767d4467..7b98f7f9a 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1730,8 +1730,12 @@ static Value* PerformBlockImageUpdate(const char* name, State* state,
continue;
}
- // Skip all commands before the saved last command index when resuming an update.
- if (params.canwrite && params.cmdindex != -1 && params.cmdindex <= saved_last_command_index) {
+ std::string cmdname = std::string(params.cmdname);
+
+ // Skip all commands before the saved last command index when resuming an update, except for
+ // "new" command. Because new commands read in the data sequentially.
+ if (params.canwrite && params.cmdindex != -1 && params.cmdindex <= saved_last_command_index &&
+ cmdname != "new") {
LOG(INFO) << "Skipping already executed command: " << params.cmdindex
<< ", last executed command for previous update: " << saved_last_command_index;
continue;
@@ -1748,7 +1752,6 @@ static Value* PerformBlockImageUpdate(const char* name, State* state,
if (!params.canwrite && saved_last_command_index != -1 && params.cmdindex != -1 &&
params.cmdindex <= saved_last_command_index) {
// TODO(xunchang) check that the cmdline of the saved index is correct.
- std::string cmdname = std::string(params.cmdname);
if ((cmdname == "move" || cmdname == "bsdiff" || cmdname == "imgdiff") &&
!params.target_verified) {
LOG(WARNING) << "Previously executed command " << saved_last_command_index << ": "