update_engine: UM: UpdateCheckAllowed now considers interactive update requests.
This is necessary so we can delegate handling of all update checks to
the UpdateManager, allowing us to share logic between the two cases and
eliminate multiple entry point to UpdateAttempter::Update() and handling
of interference between these two processes. Instead, these are all
handled naturally by the UpdateManager.
BUG=chromium:394389
TEST=Unit tests.
Change-Id: I32a1ab917e5aeb5c2da1953d8b0ffa8c9d8d62f9
Reviewed-on: https://chromium-review.googlesource.com/209100
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index a31e135..e2e1201 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -225,6 +225,10 @@
// appropriate to use as a hook for reporting daily metrics.
CheckAndReportDailyMetrics();
+ // Notify of the new update attempt, clearing prior interactive requests.
+ if (interactive_update_pending_callback_.get())
+ interactive_update_pending_callback_->Run(false);
+
chrome_proxy_resolver_.Init();
fake_update_success_ = false;
if (status_ == UPDATE_STATUS_UPDATED_NEED_REBOOT) {
@@ -797,7 +801,9 @@
void UpdateAttempter::CheckForUpdate(const string& app_version,
const string& omaha_url,
bool interactive) {
- LOG(INFO) << "New update check requested";
+ LOG(INFO) << "Interactive update check requested.";
+ if (interactive_update_pending_callback_.get())
+ interactive_update_pending_callback_->Run(true);
if (status_ != UPDATE_STATUS_IDLE) {
LOG(INFO) << "Skipping update check because current status is "