UpdateManager: Obey server-dictated poll interval when scheduling checks.
This abides by the current logic, as found in
UpdateCheckScheduler::ComputeNextIntervalAndFuzz(). New unit tests
added to verify this behavior, as well as the addition of a new
UpdaterProvider variable to pull this value from the UpdateAttempter.
BUG=chromium:358269
TEST=Unit tests.
Change-Id: I0ac67dea5a622823a9c4713ec7165a55bc0a5c92
Reviewed-on: https://chromium-review.googlesource.com/207471
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 6ee9f4d..a31e135 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -999,11 +999,13 @@
consecutive_failed_update_checks_ = 0;
}
- // Forward the server-dictated poll interval to the update check
- // scheduler, if any.
+ // Store the server-dictated poll interval, if any.
+ server_dictated_poll_interval_ =
+ std::max(0, omaha_request_action->GetOutputObject().poll_interval);
+ // TODO(garnold) Remove this once we deploy Update Manager.
if (update_check_scheduler_) {
update_check_scheduler_->set_poll_interval(
- omaha_request_action->GetOutputObject().poll_interval);
+ server_dictated_poll_interval_);
}
}
}