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_manager/real_updater_provider.h b/update_manager/real_updater_provider.h
index 9462ab7..2bc30ae 100644
--- a/update_manager/real_updater_provider.h
+++ b/update_manager/real_updater_provider.h
@@ -78,6 +78,11 @@
return var_consecutive_failed_update_checks_.get();
}
+ virtual Variable<unsigned int>*
+ var_server_dictated_poll_interval() override {
+ return var_server_dictated_poll_interval_.get();
+ }
+
private:
// A pointer to the update engine's system state aggregator.
chromeos_update_engine::SystemState* system_state_;
@@ -95,6 +100,7 @@
scoped_ptr<Variable<bool>> var_p2p_enabled_;
scoped_ptr<Variable<bool>> var_cellular_enabled_;
scoped_ptr<Variable<unsigned int>> var_consecutive_failed_update_checks_;
+ scoped_ptr<Variable<unsigned int>> var_server_dictated_poll_interval_;
DISALLOW_COPY_AND_ASSIGN(RealUpdaterProvider);
};