AU: Skip all automatic update checks if OOBE is not complete.
Right before an automatic update check is initiated, check if OOBE is
complete. If it is, go ahead with the check. Otherwise, skip the check
and schedule a new one as if it is the first one.
BUG=5377
TEST=unit tests, gmerged on device and tried with/without .oobe_completed.
Change-Id: I713e156a176b58a4dd04a01bca340b88277b0361
Review URL: http://codereview.chromium.org/3398018
diff --git a/update_check_scheduler.h b/update_check_scheduler.h
index e3158ed..2ba5253 100644
--- a/update_check_scheduler.h
+++ b/update_check_scheduler.h
@@ -60,6 +60,7 @@
FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzTest);
FRIEND_TEST(UpdateCheckSchedulerTest, GTimeoutAddSecondsTest);
FRIEND_TEST(UpdateCheckSchedulerTest, IsBootDeviceRemovableTest);
+ FRIEND_TEST(UpdateCheckSchedulerTest, IsOOBECompleteTest);
FRIEND_TEST(UpdateCheckSchedulerTest, IsOfficialBuildTest);
FRIEND_TEST(UpdateCheckSchedulerTest, RunBootDeviceRemovableTest);
FRIEND_TEST(UpdateCheckSchedulerTest, RunNonOfficialBuildTest);
@@ -72,13 +73,15 @@
FRIEND_TEST(UpdateCheckSchedulerTest, SetUpdateStatusIdleDisabledTest);
FRIEND_TEST(UpdateCheckSchedulerTest, SetUpdateStatusIdleEnabledTest);
FRIEND_TEST(UpdateCheckSchedulerTest, SetUpdateStatusNonIdleTest);
- FRIEND_TEST(UpdateCheckSchedulerTest, StaticCheckTest);
+ FRIEND_TEST(UpdateCheckSchedulerTest, StaticCheckOOBECompleteTest);
+ FRIEND_TEST(UpdateCheckSchedulerTest, StaticCheckOOBENotCompleteTest);
// Wraps GLib's g_timeout_add_seconds so that it can be mocked in tests.
virtual guint GTimeoutAddSeconds(guint interval, GSourceFunc function);
// Wrappers for utils functions so that they can be mocked in tests.
virtual bool IsBootDeviceRemovable();
+ virtual bool IsOOBEComplete();
virtual bool IsOfficialBuild();
// Returns true if an update check can be scheduled. An update check should