Fix an edge case where AllocateSpaceForPayload causes OTA to fail
When AllocateSpaceForPayload is called, it resets state in libsnapshot,
but doesn't reset OTA checkpoints. This causes inconsistency.
Bug: 180517664
Test: Update A allocate && Apply, update B allocate, Update A allocate
&& apply
Change-Id: I6255d5e1fe77d9e41f88eb34b4b2879e37aee8ba
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index 3df162e..cda8bc1 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -805,6 +805,7 @@
} else {
LOG(INFO) << "Preparing partitions for new update. last hash = "
<< last_hash << ", new hash = " << update_check_response_hash;
+ ResetUpdateProgress(prefs, false);
}
if (!boot_control->GetDynamicPartitionControl()->PreparePartitionsForUpdate(