From 6957555e295e8ae34ba5e8cfbfb1c7bd76b0024d Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 16 May 2017 15:51:46 -0700 Subject: Retry the update if ApplyBSDiffPatch | ApplyImagePatch fails We have seen one case when bspatch failed likely due to patch corruption. Since the package has passed verification before, we want to reboot and retry the patch command again since there's no alternative for users. We won't delete the stash before reboot, and the src has passed SHA1 check. If there's an error on the patch, it will fail the package verification during retry. Bug: 37855643 Test: angler reboots and retries the update when bspatch fails. Change-Id: I2ebac9621bd1f0649bb301b9a28a0dd079ed4e1d --- updater/updater.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'updater/updater.cpp') diff --git a/updater/updater.cpp b/updater/updater.cpp index 1be8b6040..f5ff6df91 100644 --- a/updater/updater.cpp +++ b/updater/updater.cpp @@ -202,6 +202,10 @@ int main(int argc, char** argv) { // Cause code should provide additional information about the abort. if (state.cause_code != kNoCause) { fprintf(cmd_pipe, "log cause: %d\n", state.cause_code); + if (state.cause_code == kPatchApplicationFailure) { + LOG(INFO) << "Patch application failed, retry update."; + fprintf(cmd_pipe, "retry_update\n"); + } } if (updater_info.package_zip) { -- cgit v1.2.3