Disable automatic update checks if booting from a removable device.
BUG=5335
TEST=unit tests, gmerged to hard-drive as well as USB
Review URL: http://codereview.chromium.org/2868105
diff --git a/main.cc b/main.cc
index 9e7a1ef..8165c14 100644
--- a/main.cc
+++ b/main.cc
@@ -49,7 +49,12 @@
void SchedulePeriodicUpdateChecks(UpdateAttempter* update_attempter) {
if (!utils::IsOfficialBuild()) {
- LOG(WARNING) << "No periodic update checks on non-official builds.";
+ LOG(WARNING) << "Non-official build: periodic update checks disabled.";
+ return;
+ }
+
+ if (utils::IsRemovableDevice(utils::RootDevice(utils::BootDevice()))) {
+ LOG(WARNING) << "Removable device boot: periodic update checks disabled.";
return;
}