Implement update_engine weave commands
The new WeaveServiceInterface abstracs the registration and interaction
with weave whenever present. The compilation and usage of weave is
based on the BRILLO_USE_WEAVE flag.
When enabled, update_engine registers the "_updater" component with
methods to force-check for an update and change channels.
Bug: 24386758
Bug: 24386768
Test: Deployed on edison, weave commands and state available online.
Change-Id: Ic49111772e123b8a2b1971da92fe65785f186ccd
diff --git a/real_system_state.cc b/real_system_state.cc
index 3a90292..ffb2193 100644
--- a/real_system_state.cc
+++ b/real_system_state.cc
@@ -16,6 +16,8 @@
#include "update_engine/real_system_state.h"
+#include <string>
+
#include <base/files/file_util.h>
#include <base/time/time.h>
#include <brillo/make_unique_ptr.h>
@@ -26,11 +28,13 @@
#include "update_engine/common/hardware.h"
#include "update_engine/common/utils.h"
#include "update_engine/update_manager/state_factory.h"
+#include "update_engine/weave_service_factory.h"
namespace chromeos_update_engine {
RealSystemState::RealSystemState(const scoped_refptr<dbus::Bus>& bus)
- : debugd_proxy_(bus),
+ : bus_(bus),
+ debugd_proxy_(bus),
power_manager_proxy_(bus),
session_manager_proxy_(bus),
shill_proxy_(bus),
@@ -121,6 +125,8 @@
&debugd_proxy_));
update_attempter_->Init();
+ weave_service_ = ConstructWeaveService(bus_, update_attempter_.get());
+
// Initialize the Update Manager using the default state factory.
chromeos_update_manager::State* um_state =
chromeos_update_manager::DefaultStateFactory(