update_engine: Re-introduce RefreshDevicePolicy() before computing update params.
The update_manager refreshes the policy for its own usage, but the
code that still remains outside the update_manager and depends on
device policy settings has to reload the policy manually.
This patch re-introduces the call to RefreshDevicePolicy() from
CalculateUpdateParams() that was removed in CL:209101 since some
code still requires it.
BUG=chromium:425827
TEST=delopyed this patch on R39 and tested that the scattering value from the policy is used.
TEST=Changed UpdateAttempterTest.UpdateTest to check this. Verified it fails without the change on update_attempter.cc
Change-Id: I051382987b507752e52a0af87d869a8845f3db6f
Reviewed-on: https://chromium-review.googlesource.com/224808
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index b36c11a..370cfd9 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -366,6 +366,9 @@
bool interactive) {
http_response_code_ = 0;
+ // Refresh the policy before computing all the update parameters.
+ RefreshDevicePolicy();
+
// Set the target version prefix, if provided.
if (!target_version_prefix.empty())
omaha_request_params_->set_target_version_prefix(target_version_prefix);