diff options
Diffstat (limited to 'update_manager/default_policy.cc')
-rw-r--r-- | update_manager/default_policy.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/update_manager/default_policy.cc b/update_manager/default_policy.cc index 81ab795d..0713e06a 100644 --- a/update_manager/default_policy.cc +++ b/update_manager/default_policy.cc @@ -14,10 +14,12 @@ // limitations under the License. // +#include "update_engine/common/system_state.h" #include "update_engine/update_manager/default_policy.h" using chromeos_update_engine::ErrorCode; using chromeos_update_engine::InstallPlan; +using chromeos_update_engine::SystemState; namespace { @@ -31,19 +33,19 @@ const int kCheckIntervalInSeconds = 15 * 60; namespace chromeos_update_manager { -DefaultPolicy::DefaultPolicy(chromeos_update_engine::ClockInterface* clock) - : clock_(clock), aux_state_(new DefaultPolicyState()) {} - EvalStatus DefaultPolicy::UpdateCheckAllowed(EvaluationContext* ec, State* state, std::string* error, UpdateCheckParams* result) const { result->updates_enabled = true; result->target_channel.clear(); + result->lts_tag.clear(); result->target_version_prefix.clear(); result->rollback_allowed = false; result->rollback_allowed_milestones = -1; // No version rolls should happen. + result->rollback_on_channel_downgrade = false; result->interactive = false; + result->quick_fix_build_token.clear(); // Ensure that the minimum interval is set. If there's no clock, this defaults // to always allowing the update. @@ -51,8 +53,8 @@ EvalStatus DefaultPolicy::UpdateCheckAllowed(EvaluationContext* ec, ec->IsMonotonicTimeGreaterThan( aux_state_->last_check_allowed_time() + base::TimeDelta::FromSeconds(kCheckIntervalInSeconds))) { - if (clock_) - aux_state_->set_last_check_allowed_time(clock_->GetMonotonicTime()); + aux_state_->set_last_check_allowed_time( + SystemState::Get()->clock()->GetMonotonicTime()); return EvalStatus::kSucceeded; } @@ -87,14 +89,6 @@ EvalStatus DefaultPolicy::UpdateCanStart(EvaluationContext* ec, return EvalStatus::kSucceeded; } -EvalStatus DefaultPolicy::UpdateDownloadAllowed(EvaluationContext* ec, - State* state, - std::string* error, - bool* result) const { - *result = true; - return EvalStatus::kSucceeded; -} - EvalStatus DefaultPolicy::P2PEnabled(EvaluationContext* ec, State* state, std::string* error, |