summaryrefslogtreecommitdiff
path: root/update_attempter.cc
diff options
context:
space:
mode:
authorGilad Arnold <garnold@chromium.org>2014-10-02 10:34:54 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-18 01:39:10 +0000
commit519cfc71f0a2f7f01adb51acd19b5cd23d2c93a2 (patch)
tree32b424d8c72226e13650ef16197614c19545b46e /update_attempter.cc
parentd78caf9baf2026a356130f4754af2c504f423945 (diff)
update_engine: Move scattering wait period store/load to PayloadState.
This is needed for decoupling the inference/use of this value from its storing/loading, as we shift the former into the Update Manager. BUG=chromium:384087 TEST=Unit tests. Change-Id: I4b278dc817b6f148d5638122f934e9d1e280bfae Reviewed-on: https://chromium-review.googlesource.com/221250 Reviewed-by: Alex Vakulenko <avakulenko@chromium.org> Tested-by: Gilad Arnold <garnold@chromium.org> Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'update_attempter.cc')
-rw-r--r--update_attempter.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/update_attempter.cc b/update_attempter.cc
index 9a91d51b..b36c11a8 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -564,8 +564,8 @@ void UpdateAttempter::GenerateNewWaitingPeriod() {
// fails, we'll still be able to scatter based on our in-memory value.
// The persistence only helps in ensuring a good overall distribution
// across multiple devices if they tend to reboot too often.
- prefs_->SetInt64(kPrefsWallClockWaitPeriod,
- omaha_request_params_->waiting_period().InSeconds());
+ system_state_->payload_state()->SetScatteringWaitPeriod(
+ omaha_request_params_->waiting_period());
}
void UpdateAttempter::BuildPostInstallActions(
@@ -979,7 +979,7 @@ void UpdateAttempter::ProcessingDone(const ActionProcessor* processor,
// after reboot so that the same device is not favored or punished in any
// way.
prefs_->Delete(kPrefsUpdateCheckCount);
- prefs_->Delete(kPrefsWallClockWaitPeriod);
+ system_state_->payload_state()->SetScatteringWaitPeriod(TimeDelta());
prefs_->Delete(kPrefsUpdateFirstSeenAt);
SetStatusAndNotify(UPDATE_STATUS_UPDATED_NEED_REBOOT);