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.h b/weave_service.h
index 914777e..b1068e7 100644
--- a/weave_service.h
+++ b/weave_service.h
@@ -18,6 +18,7 @@
 #define UPDATE_ENGINE_WEAVE_SERVICE_H_
 
 #include <memory>
+#include <string>
 
 #include <base/memory/weak_ptr.h>
 #include <libweaved/command.h>
@@ -34,10 +35,18 @@
 
   bool Init(DelegateInterface* delegate);
 
-  // WeaveServiceInterface override.
-  void UpdateWeaveState() override;
+  // ServiceObserverInterface overrides.
+  void SendStatusUpdate(int64_t last_checked_time,
+                        double progress,
+                        update_engine::UpdateStatus status,
+                        const std::string& new_version,
+                        int64_t new_size) override;
+  void SendChannelChangeUpdate(const std::string& tracking_channel) override;
 
  private:
+  // Force a weave update.
+  void UpdateWeaveState();
+
   void OnWeaveServiceConnected(const std::weak_ptr<weaved::Service>& service);
 
   // Weave command handlers. These are called from the message loop whenever a