update_engine: Reset update pending callback after update actions
Reset the update pending callback after update actions have been
carried out, this is so that the current forced update status are
available to the policies that are called in UpdateActions.
BUG=chromium:852860
TEST=Tested updating locally
Change-Id: I44a70b408c83c2adea4cd8c386f777c4799a19f5
Reviewed-on: https://chromium-review.googlesource.com/1164527
Commit-Ready: Adolfo Higueros <adokar@google.com>
Tested-by: Adolfo Higueros <adokar@google.com>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 6a34aed..71a4ae1 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -253,10 +253,6 @@
// timeout event.
CheckAndReportDailyMetrics();
- // Notify of the new update attempt, clearing prior interactive requests.
- if (forced_update_pending_callback_.get())
- forced_update_pending_callback_->Run(false, false);
-
fake_update_success_ = false;
if (status_ == UpdateStatus::UPDATED_NEED_REBOOT) {
// Although we have applied an update, we still want to ping Omaha
@@ -964,6 +960,10 @@
// reset the state that's only valid for a single update pass
current_update_attempt_flags_ = UpdateAttemptFlags::kNone;
+ if (forced_update_pending_callback_.get())
+ // Clear prior interactive requests once the processor is done.
+ forced_update_pending_callback_->Run(false, false);
+
if (status_ == UpdateStatus::REPORTING_ERROR_EVENT) {
LOG(INFO) << "Error event sent.";
@@ -1052,6 +1052,9 @@
// Reset cpu shares back to normal.
cpu_limiter_.StopLimiter();
download_progress_ = 0.0;
+ if (forced_update_pending_callback_.get())
+ // Clear prior interactive requests once the processor is done.
+ forced_update_pending_callback_->Run(false, false);
SetStatusAndNotify(UpdateStatus::IDLE);
ScheduleUpdates();
error_event_.reset(nullptr);