From 99b73be3a8f3a97ff11f3e50a4169292a2f36fb1 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 28 Nov 2017 17:23:06 -0800 Subject: Detect interrupted update due to power off An interrupted update may stash extra blocks in /cache, leading to a failure when checking the cache size. We can save the incremented retry_count in the BCB before installing the update; and distinguish a fresh update from an interrupted one this way. Bug: 68679601 Test: An interrupted update reapplies successfully. Change-Id: Ic1403e1fd25a937c91ef34c14b92a0f6c8f1c0f4 --- updater/install.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'updater/install.cpp') diff --git a/updater/install.cpp b/updater/install.cpp index a111f4b79..870b85791 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -569,7 +569,11 @@ Value* ApplyPatchSpaceFn(const char* name, State* state, const std::vectoris_retry || CacheSizeCheck(bytes) == 0) { + return StringValue("t"); + } + return StringValue(""); } // apply_patch(src_file, tgt_file, tgt_sha1, tgt_size, patch1_sha1, patch1_blob, [...]) -- cgit v1.2.3