summaryrefslogtreecommitdiff
path: root/update_manager/rollback_prefs.h
blob: 6cbc447d55ea63d85c15c4ebed106f53d5297501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#ifndef UPDATE_ENGINE_UPDATE_MANAGER_ROLLBACK_PREFS_H_
#define UPDATE_ENGINE_UPDATE_MANAGER_ROLLBACK_PREFS_H_

namespace chromeos_update_manager {

// Value used to represent that kernel key versions can always roll-forward.
// This is the maximum value of a kernel key version.
constexpr int kRollforwardInfinity = 0xfffffffe;

// Whether the device should roll back to the target version, and if yes, which
// type of rollback should it do. Matches chrome_device_policy.proto's
// AutoUpdateSettingsProto::RollbackToTargetVersion.
enum class RollbackToTargetVersion {
  kUnspecified = 0,
  kDisabled = 1,
  kRollbackAndPowerwash = 2,
  kRollbackAndRestoreIfPossible = 3,
  // This value must be the last entry.
  kMaxValue = 4
};

// Whether the device should do rollback and powerwash on channel downgrade.
// Matches chrome_device_policy.proto's
// |AutoUpdateSettingsProto::ChannelDowngradeBehavior|.
enum class ChannelDowngradeBehavior {
  kUnspecified = 0,
  kWaitForVersionToCatchUp = 1,
  kRollback = 2,
  kAllowUserToConfigure = 3,
  // These values must be kept up to date.
  kFirstValue = kUnspecified,
  kLastValue = kAllowUserToConfigure
};

}  // namespace chromeos_update_manager

#endif  // UPDATE_ENGINE_UPDATE_MANAGER_ROLLBACK_PREFS_H_