Reset payload index in payload state. am: 97eba34594
am: 97eb291f3f
Change-Id: Ie46d4b5c396c06e2061300f96c26cee1e9f7f2fe
diff --git a/payload_state.cc b/payload_state.cc
index 987cf1c..a1a9d72 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -122,6 +122,10 @@
return;
}
+ // Always start from payload index 0, even for resume, to download partition
+ // info from previous payloads.
+ payload_index_ = 0;
+
// This is the earliest point at which we can validate whether the URL index
// we loaded from the persisted state is a valid value. If the response
// hasn't changed but the URL index is invalid, it's indicative of some
@@ -240,6 +244,7 @@
// Reset the number of responses seen since it counts from the last
// successful update, e.g. now.
SetNumResponsesSeen(0);
+ SetPayloadIndex(0);
CreateSystemUpdatedMarkerFile();
}
@@ -762,6 +767,7 @@
void PayloadState::ResetPersistedState() {
SetPayloadAttemptNumber(0);
SetFullPayloadAttemptNumber(0);
+ SetPayloadIndex(0);
SetUrlIndex(0);
SetUrlFailureCount(0);
SetUrlSwitchCount(0);