New BootControlInterface implementation for Android.
This patch hides the platform-specific construction of a
BootControlInterface in a factory method shared by both Android and
Chromium OS. This also include a stub implementation for Android.
Bug: 23754584,23084776
TEST=emerge-link update_engine; `mma -i` builds these files without problem.
Change-Id: I43532e5cff1dc474453160f418ddd3c448f31938
diff --git a/real_system_state.cc b/real_system_state.cc
index 7dfa012..03cbe2e 100644
--- a/real_system_state.cc
+++ b/real_system_state.cc
@@ -19,7 +19,7 @@
#include <base/files/file_util.h>
#include <base/time/time.h>
-#include "update_engine/boot_control_chromeos.h"
+#include "update_engine/boot_control.h"
#include "update_engine/constants.h"
#include "update_engine/hardware.h"
#include "update_engine/update_manager/state_factory.h"
@@ -38,12 +38,9 @@
bool RealSystemState::Initialize() {
metrics_lib_.Init();
- // TODO(deymo): Initialize BootControl based on the build environment.
- BootControlChromeOS* boot_control_cros = new BootControlChromeOS();
- boot_control_.reset(boot_control_cros);
- if (!boot_control_cros->Init()) {
- LOG(ERROR) << "Ignoring BootControlChromeOS failure. We won't run updates.";
- }
+ boot_control_ = boot_control::CreateBootControl();
+ if (!boot_control_)
+ return false;
hardware_ = hardware::CreateHardware();
if (!hardware_) {