Refactor daemon state and service async notification.
There are three supported IPC mechanism in this code: DBus, binder and
weave (over binder); which are mostly supported by all three platforms
Chrome OS, Brillo and Android. The exceptions are that Brillo and
Chrome OS still *require* DBus and support the others, while the new
Android daemon requires and supports only Binder.
This CL introduces two new interfaces: the ServiceObserverInterface and
the DaemonStateInterface.
The first one abstracts a service (or IPC service) into an interfcae
from the point of view of the daemon initialization and async
notifications of status changes. The second interface encapsulates the
state and main functionality of the update_engine daemon while leaving
the shared initialization in the main.cc and daemon.cc classes.
Bug: 25631949
TEST=`mmma system/update_engine` on edison-eng and aosp_arm-eng
TEST=FEATURES=test emerge-link update_engine
Change-Id: Ic15621031a153e14bdc4df8fcedbca1032e82c21
diff --git a/weave_service_interface.h b/weave_service_interface.h
index baaa9db..a7e603e 100644
--- a/weave_service_interface.h
+++ b/weave_service_interface.h
@@ -22,6 +22,7 @@
#include <brillo/errors/error.h>
#include "update_engine/client_library/include/update_engine/update_status.h"
+#include "update_engine/service_observer_interface.h"
namespace chromeos_update_engine {
@@ -30,7 +31,7 @@
// registration with weaved and the connection, the actual work to handle the
// commands is implemented by the DelegateInterface, which will be called from
// this class.
-class WeaveServiceInterface {
+class WeaveServiceInterface : public ServiceObserverInterface {
public:
// The delegate class that actually handles the command execution from
class DelegateInterface {
@@ -52,9 +53,6 @@
virtual ~WeaveServiceInterface() = default;
- // Force a weave state update.
- virtual void UpdateWeaveState() = 0;
-
protected:
WeaveServiceInterface() = default;
};