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/client_library/client_dbus.h b/client_library/client_dbus.h
index a186d45..1b127e3 100644
--- a/client_library/client_dbus.h
+++ b/client_library/client_dbus.h
@@ -23,6 +23,7 @@
#include <vector>
#include <base/macros.h>
+#include <update_engine/proto_bindings/update_engine.pb.h>
#include "update_engine/client_library/include/update_engine/client.h"
#include "update_engine/dbus-proxies.h"
@@ -50,6 +51,8 @@
std::string* out_new_version,
int64_t* out_new_size) const override;
+ bool GetStatus(UpdateEngineStatus* out_status) const override;
+
bool SetCohortHint(const std::string& cohort_hint) override;
bool GetCohortHint(std::string* cohort_hint) const override;
@@ -93,11 +96,7 @@
// registered handlers receive the event.
void StatusUpdateHandlersRegistered(StatusUpdateHandler* handler) const;
- void RunStatusUpdateHandlers(int64_t last_checked_time,
- double progress,
- const std::string& current_operation,
- const std::string& new_version,
- int64_t new_size);
+ void RunStatusUpdateHandlers(const StatusResult& status);
std::unique_ptr<org::chromium::UpdateEngineInterfaceProxy> proxy_;
std::vector<update_engine::StatusUpdateHandler*> handlers_;