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/omaha_request_action.h b/omaha_request_action.h
index 1aeaf8a..2915a6a 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -21,6 +21,7 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include <map>
#include <memory>
#include <string>
#include <vector>
@@ -219,6 +220,10 @@
bool PersistCohortData(const std::string& prefs_key,
const std::string& new_value);
+ // Parse and persist the end-of-life status flag sent back in the updatecheck
+ // tag attributes. The flag will be validated and stored in the Prefs.
+ bool PersistEolStatus(const std::map<std::string, std::string>& attrs);
+
// If this is an update check request, initializes
// |ping_active_days_| and |ping_roll_call_days_| to values that may
// be sent as pings to Omaha.