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/update_attempter.cc b/update_attempter.cc
index 44eea77..4bbf5a1 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -427,6 +427,14 @@
omaha_request_params_->set_dlc_module_ids(dlc_module_ids_);
omaha_request_params_->set_is_install(is_install_);
+ // Set Quick Fix Build token if policy is set.
+ string token;
+ if (system_state_ && system_state_->device_policy()) {
+ if (!system_state_->device_policy()->GetDeviceQuickFixBuildToken(&token))
+ token.clear();
+ }
+ omaha_request_params_->set_autoupdate_token(token);
+
LOG(INFO) << "target_version_prefix = "
<< omaha_request_params_->target_version_prefix()
<< ", rollback_allowed = "