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/binder_service_android.cc b/binder_service_android.cc
index c512697..144836a 100644
--- a/binder_service_android.cc
+++ b/binder_service_android.cc
@@ -24,6 +24,20 @@
namespace chromeos_update_engine {
+BinderUpdateEngineAndroidService::BinderUpdateEngineAndroidService(
+ DaemonStateAndroid* /* daemon_state */) {
+ // TODO(deymo): Hook this interface calls to the daemon_state.
+}
+
+void BinderUpdateEngineAndroidService::SendStatusUpdate(
+ int64_t last_checked_time,
+ double progress,
+ update_engine::UpdateStatus status,
+ const std::string& new_version,
+ int64_t new_size) {
+ // TODO(deymo): Notify registered callers.
+}
+
Status BinderUpdateEngineAndroidService::bind(
const sp<IUpdateEngineCallback>& callback,
bool* return_value) {