Reset payload index in payload state. am: 97eba34594 am: 97eb291f3f
am: 3c1a3e60af
Change-Id: I90d6bed8fd9260196c53d601ced220f52df9c9d4
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);