update_engine: Break UpdateEngineDaemon into their own implementations
It looks like Android and ChromeOS have completely different
implementation of the daemon. So instead of polluting the source with
USE_* flags, just break it into their own implementation files. At the
very least this allows deprecating USE_BINDER and USE_OMAHA flag
completely.
BUG=chromium:978672
TEST=unittest, cros flash two times.
Change-Id: Ia5c4f9274e275a2c1ba9334111b694514914a475
Reviewed-on: https://chromium-review.googlesource.com/1674583
Tested-by: Amin Hassani <ahassani@chromium.org>
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/main.cc b/main.cc
index 26f9efb..b435467 100644
--- a/main.cc
+++ b/main.cc
@@ -33,9 +33,10 @@
#include <base/strings/stringprintf.h>
#include <brillo/flag_helper.h>
+#include "update_engine/common/subprocess.h"
#include "update_engine/common/terminator.h"
#include "update_engine/common/utils.h"
-#include "update_engine/daemon.h"
+#include "update_engine/daemon_base.h"
using std::string;
@@ -190,8 +191,8 @@
// Done _after_ log file creation.
umask(S_IRWXG | S_IRWXO);
- chromeos_update_engine::UpdateEngineDaemon update_engine_daemon;
- int exit_code = update_engine_daemon.Run();
+ auto daemon = chromeos_update_engine::DaemonBase::CreateInstance();
+ int exit_code = daemon->Run();
chromeos_update_engine::Subprocess::Get().FlushBufferedLogsAtExit();