update_engine: Store fingerprint value from Omaha response.
Store the unique fp value from response into prefs. Value is later sent
to Omaha to determine if there is a subsequent update available
while the system is waiting to be rebooted.
BUG=b:161259884
TEST=cros_workon_make --board=hatch --test update_engine
Change-Id: Ie37aa5da3cd8a0820e633f5ef426fb50e8a02838
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2491618
Tested-by: Vyshu Khota <vyshu@google.com>
Commit-Queue: Vyshu Khota <vyshu@google.com>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/cros/omaha_request_action.cc b/cros/omaha_request_action.cc
index faa7dde..cad0c67 100644
--- a/cros/omaha_request_action.cc
+++ b/cros/omaha_request_action.cc
@@ -98,6 +98,7 @@
constexpr char kAttrElapsedDays[] = "elapsed_days";
constexpr char kAttrElapsedSeconds[] = "elapsed_seconds";
constexpr char kAttrEvent[] = "event";
+constexpr char kAttrFp[] = "fp";
constexpr char kAttrHashSha256[] = "hash_sha256";
// Deprecated: "hash"; Although we still need to pass it from the server for
// backward compatibility.
@@ -150,6 +151,7 @@
string name;
string size;
string hash;
+ string fp;
};
vector<Package> packages;
};
@@ -214,7 +216,8 @@
if (!data->apps.empty())
data->apps.back().packages.push_back({.name = attrs[kAttrName],
.size = attrs[kAttrSize],
- .hash = attrs[kAttrHashSha256]});
+ .hash = attrs[kAttrHashSha256],
+ .fp = attrs[kAttrFp]});
} else if (data->current_path == "/response/app/updatecheck/manifest") {
// Get the version.
if (!data->apps.empty())
@@ -612,6 +615,8 @@
return false;
}
+ out_package.fp = package.fp;
+
if (i < is_delta_payloads.size())
out_package.is_delta = ParseBool(is_delta_payloads[i]);