Always update target version prefix
When UpdateAttempter::Update is called, the cached target version
prefix in its |omaha_request_params_| should always be updated with
the one passed in.
Also fix the target version LOG lines in kiosk app pin policy code.
BUG=chromium:695133
TEST=UpdateAttempterTest.TargetVersionPrefixSetAndReset
Reviewed-on: https://chromium-review.googlesource.com/446657
Commit-Ready: Xiyuan Xia <xiyuan@chromium.org>
Tested-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
(cherry picked from commit 4d34c18e5ce29d138c7946cc817dee8b3fce7cf0)
Change-Id: I712b169505f4566aac3a0b2c9746dfcb9466ef8d
diff --git a/update_attempter.cc b/update_attempter.cc
index 1bdd0eb..d9a8d04 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -371,9 +371,8 @@
// 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);
+ // Update the target version prefix.
+ omaha_request_params_->set_target_version_prefix(target_version_prefix);
CalculateScatteringParams(interactive);