Parse and expose end-of-life flag.
Omaha update or noupdate response can include _key=value pairs with
arbitrary data. One of those key can be "_eol" with the one of the
values "supported", "security-only" or "eol" which notifies the device
the end-of-life status of the device with respect to updates. This
information is now exposed via GetEolStatus() to the client so it
can be properly displayed in the UI.
Bug: 27924505
TEST=Added unittest. Run `update_engine_client --eol_status` on link.
Change-Id: Icc15f25b4d0b19cc894f5afc52ac7c43c7818982
diff --git a/client_library/client_binder.h b/client_library/client_binder.h
index 72f80dd..cd857e0 100644
--- a/client_library/client_binder.h
+++ b/client_library/client_binder.h
@@ -23,14 +23,13 @@
#include <vector>
#include <base/macros.h>
-#include <utils/StrongPointer.h>
#include <utils/String16.h>
+#include <utils/StrongPointer.h>
#include <brillo/binder_watcher.h>
-#include "android/brillo/IUpdateEngine.h"
#include "android/brillo/BnUpdateEngineStatusCallback.h"
-
+#include "android/brillo/IUpdateEngine.h"
#include "update_engine/client_library/include/update_engine/client.h"
@@ -82,11 +81,14 @@
bool GetLastAttemptError(int32_t* last_attempt_error) const override;
+ bool GetEolStatus(int32_t* eol_status) const override;
+
private:
class StatusUpdateCallback :
public android::brillo::BnUpdateEngineStatusCallback {
public:
- StatusUpdateCallback(BinderUpdateEngineClient* client) : client_(client) {}
+ explicit StatusUpdateCallback(BinderUpdateEngineClient* client)
+ : client_(client) {}
android::binder::Status HandleStatusUpdate(
int64_t last_checked_time,