update_engine: Add rollback_allowed policy in Omaha requests
Send rollback_allowed="true" parameter to Omaha if rollback is
allowed through enterprise policy.
This parameter indicates to Omaha that the returned image might
be a rollback image, if the targetversionprefix parameter is set
and it is an earlier version than the one which is currently on
the device.
Also, this CL changes update_engine behavior to only send
targetversionprefix to Omaha if it's not empty.
BUG=chromium:814830
TEST='cros_run_unit_tests --board=cyan --packages update_engine'
Change-Id: Iaa5503e217631311fb9ba3a5237ccbfedf04afe9
Reviewed-on: https://chromium-review.googlesource.com/932123
Commit-Ready: Marton Hunyady <hunyadym@chromium.org>
Tested-by: Marton Hunyady <hunyadym@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/update_manager/policy.h b/update_manager/policy.h
index c651846..7089c30 100644
--- a/update_manager/policy.h
+++ b/update_manager/policy.h
@@ -48,9 +48,8 @@
//
// A target version prefix, if imposed by policy; otherwise, an empty string.
std::string target_version_prefix;
- // Specifies what should happen if target_version_prefix specifies an earlier
- // version than the current version of the OS.
- RollbackToTargetVersion rollback_to_target_version;
+ // Specifies whether rollback images are allowed by device policy.
+ bool rollback_allowed;
// Specifies the number of Chrome milestones rollback should be allowed,
// starting from the stable version at any time. Value is -1 if unspecified
// (e.g. no device policy is available yet), in this case no version