update_engine: Add ping for DLCs in update_engine
Send ping to omaha with the metadata values 'active','date_last_active'
and 'date_last_rollcall'. Update engine resets the 'active' flag after
succesfully sending a ping to Omaha. The 'date_last_active' value is
sent and updated only when the DLC was active since the previous ping.
'date_last_rollcall' is sent on every ping.
BUG=chromium:912666
TEST=unittests
TEST=Test on DUT using Nebraska and forcing ping values by changing the
metadata files in /var/lib/dlc/dummy-dlc/.
Installed dlc using:dlcservice_util --dlc_ids="dummy-dlc" --install
Trigger the pings by calling: update_engine_client --check_for_update
Change-Id: I47eff8c7923f5b3a7e892c281933c9a12b619ee7
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2001095
Tested-by: Andrew Lassalle <andrewlassalle@chromium.org>
Commit-Queue: Andrew Lassalle <andrewlassalle@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_request_action.h b/omaha_request_action.h
index 3f66de9..623a704 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -200,6 +200,10 @@
// send to Omaha and thus we should include them in the response.
bool ShouldPing() const;
+ // Process Omaha's response to a ping request and store the results in the DLC
+ // metadata directory.
+ void StorePingReply(const OmahaParserData& parser_data) const;
+
// Returns true if the download of a new update should be deferred.
// False if the update can be downloaded.
bool ShouldDeferDownload(OmahaResponse* output_object);