update_engine: Add newer DBus method and signal for GetStatus
The current GetStatus function is pretty non-extendable and there has
been use cases where we wanted to add arguments to it but it was quite
hard to do specially changes in Chrome.
This CL adds a new DBus Method GetStatusAdvanced and Signal
UpdateStatusAdvanced which use a protobuf for communicating dbus
messages. This allows us to extend the protobuf without much effort in
the future.
BUG=chromium:977320
TEST=unittests, precq
Cq-Depend: chromium:1672684, chrome-internal:1424559
Change-Id: Ia93ed189e7561ca18c63b5ded81826bc9b1cff12
Reviewed-on: https://chromium-review.googlesource.com/1669974
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/dbus_service.h b/dbus_service.h
index 134461b..71a6d2b 100644
--- a/dbus_service.h
+++ b/dbus_service.h
@@ -24,6 +24,7 @@
#include <base/memory/ref_counted.h>
#include <brillo/errors/error.h>
+#include <update_engine/proto_bindings/update_engine.pb.h>
#include "update_engine/common_service.h"
#include "update_engine/service_observer_interface.h"
@@ -72,6 +73,11 @@
std::string* out_new_version,
int64_t* out_new_size) override;
+ // Similar to Above, but returns a protobuffer instead. In the future it will
+ // have more features and is easily extendable.
+ bool GetStatusAdvanced(brillo::ErrorPtr* error,
+ update_engine::StatusResult* out_status) override;
+
// Reboots the device if an update is applied and a reboot is required.
bool RebootIfNeeded(brillo::ErrorPtr* error) override;