update_engine: Add new rollback device policies.
Add rollback_to_target_version and rollback_allowed_milestones
device policies to update_engine's device_policy_provider.
These are matching the device policies introduced in crrev.com/c/916563.
rollback_to_target_version is describing what should happen when the
target_version_prefix policy has a lower value than the current OS
value. rollback_allowed_milestones is setting the number of milestones
rollback protection should be postponed for enterprise enrolled devices.
BUG=chromium:813036
TEST='cros_run_unit_tests --board=cyan --packages update_engine'
CQ-DEPEND=CL:923971
Change-Id: I310690882f10fcbb57cc9b957fad5388c3a06bc9
Reviewed-on: https://chromium-review.googlesource.com/928723
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/device_policy_provider.h b/update_manager/device_policy_provider.h
index 3537d13..22613a1 100644
--- a/update_manager/device_policy_provider.h
+++ b/update_manager/device_policy_provider.h
@@ -24,6 +24,7 @@
#include <policy/libpolicy.h>
#include "update_engine/update_manager/provider.h"
+#include "update_engine/update_manager/rollback_prefs.h"
#include "update_engine/update_manager/shill_provider.h"
#include "update_engine/update_manager/variable.h"
@@ -46,6 +47,15 @@
virtual Variable<std::string>* var_target_version_prefix() = 0;
+ // Variable returning what should happen if the target_version_prefix is
+ // earlier than the current Chrome OS version.
+ virtual Variable<RollbackToTargetVersion>*
+ var_rollback_to_target_version() = 0;
+
+ // Variable returning the number of Chrome milestones rollback should be
+ // possible. Rollback protection will be postponed by this many versions.
+ virtual Variable<int>* var_rollback_allowed_milestones() = 0;
+
// Returns a non-negative scatter interval used for updates.
virtual Variable<base::TimeDelta>* var_scatter_factor() = 0;