UpdateManager: Do not schedule update checks if booted from removable device.
This abides by the current logic, as found in
UpdateCheckScheduler::Run(). New unit test added to verify this
behavior.
BUG=chromium:358269
TEST=Unit tests.
Change-Id: I5720b2b3c85c7de7f64eec4f7da000d3e13c778d
Reviewed-on: https://chromium-review.googlesource.com/207230
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/update_manager/real_system_provider.cc b/update_manager/real_system_provider.cc
index c397027..8d5f4f4 100644
--- a/update_manager/real_system_provider.cc
+++ b/update_manager/real_system_provider.cc
@@ -43,6 +43,10 @@
base::Bind(&chromeos_update_engine::HardwareInterface::IsOOBEComplete,
base::Unretained(hardware_), nullptr)));
+ var_is_boot_device_removable_.reset(
+ new ConstCopyVariable<bool>("is_boot_device_removable",
+ hardware_->IsBootDeviceRemovable()));
+
return true;
}