update_engine: Include quick_fix_build_token in updatecheck request body
Get the value of the new device policy which is included in
AutoUpdateSettings as quick_fix_build_token, and include it
in the update request body if value is set.
BUG=chromium:932465
TEST=./build_packages --board=amd64-generic && \
cros_run_unit_tests --board=amd64-generic --packages update_engine
Cq-Depend: chromium:1571634
Change-Id: Iaca35a08d973616a058864a11896ef9305d00174
Reviewed-on: https://chromium-review.googlesource.com/1581519
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Askar Aitzhan <askaraitzhan@google.com>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_request_builder_xml.cc b/omaha_request_builder_xml.cc
index 899f17f..aac0136 100644
--- a/omaha_request_builder_xml.cc
+++ b/omaha_request_builder_xml.cc
@@ -122,6 +122,13 @@
app_body += " rollback_allowed=\"true\"";
}
}
+ string autoupdate_token = params->autoupdate_token();
+ if (!autoupdate_token.empty()) {
+ app_body += base::StringPrintf(
+ " token=\"%s\"",
+ XmlEncodeWithDefault(autoupdate_token, "").c_str());
+ }
+
app_body += "></updatecheck>\n";
}