Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: update_check_scheduler.cc

Issue 3398018: AU: Skip all automatic update checks if OOBE is not complete. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: fix comment Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « update_check_scheduler.h ('k') | update_check_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_check_scheduler.cc
diff --git a/update_check_scheduler.cc b/update_check_scheduler.cc
index 3d00ff38ab13a28319687c90a146e8ae2a59dae5..7319ec43db57783c014c52cc18b4fed40b6f70a9 100644
--- a/update_check_scheduler.cc
+++ b/update_check_scheduler.cc
@@ -50,6 +50,10 @@ bool UpdateCheckScheduler::IsBootDeviceRemovable() {
return utils::IsRemovableDevice(utils::RootDevice(utils::BootDevice()));
}
+bool UpdateCheckScheduler::IsOOBEComplete() {
+ return utils::IsOOBEComplete();
+}
+
bool UpdateCheckScheduler::IsOfficialBuild() {
return utils::IsOfficialBuild();
}
@@ -77,7 +81,14 @@ gboolean UpdateCheckScheduler::StaticCheck(void* scheduler) {
UpdateCheckScheduler* me = reinterpret_cast<UpdateCheckScheduler*>(scheduler);
CHECK(me->scheduled_);
me->scheduled_ = false;
- me->update_attempter_->Update("", "");
+ if (me->IsOOBEComplete()) {
+ me->update_attempter_->Update("", "");
+ } else {
+ // Skips all automatic update checks if the OOBE process is not complete and
+ // schedules a new check as if it is the first one.
+ LOG(WARNING) << "Skipping update check because OOBE is not complete.";
+ me->ScheduleCheck(kTimeoutOnce, kTimeoutRegularFuzz);
+ }
// This check ensures that future update checks will be or are already
// scheduled. The check should never fail. A check failure means that there's
// a bug that will most likely prevent further automatic update checks. It
« no previous file with comments | « update_check_scheduler.h ('k') | update_check_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698