• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef STARTUP_CONSTANT_H
17 #define STARTUP_CONSTANT_H
18 
19 #include <cstdint>
20 #include <string>
21 #include <vector>
22 
23 namespace OHOS {
24 namespace UpdateEngine {
25 enum class StartupReason {
26     UNKNOWN = -1,
27     DEVICE_REBOOT = 0,
28     SCHEDULE_TASK = 1,
29     PROCESS_ENV_RESET = 2,
30 };
31 
32 enum class TaskPriority {
33     LOW = 0,
34     NORMAL = 1,
35     HIGH = 2,
36 };
37 
38 enum class AccessType {
39     DEFAULT = 0,
40     FIRMWARE = 1,
41     PARAM = 2,
42     DOWNLOAD = 3,
43     REPORT = 4,
44 };
45 
46 namespace Startup {
47 const std::vector<AccessType> ACCESS_TYPES{AccessType::FIRMWARE};
48 const std::string UPDATER_SA_NAME = "updater_sa";
49 
50 constexpr uint64_t ONE_SECOND_MILLISECONDS = 1000L;
51 constexpr uint64_t ONE_MINUTE_SECONDS = 60L;
52 constexpr uint64_t ONE_HOUR_MINUTES = 60L;
53 
54 const std::string PULLUP_INTERVAL_CONFIG = "pullupInterval";                      // SA拉起间隔配置项
55 constexpr uint64_t PULLUP_INTERVAL = 4 * ONE_HOUR_MINUTES * ONE_MINUTE_SECONDS;   // SA拉起间隔
56 const std::string IDLE_CHECK_INTERVAL_CONFIG = "idleCheckInterval";               // 空闲检测间隔配置项
57 constexpr uint64_t IDLE_CHECK_INTERVAL = 5 * ONE_MINUTE_SECONDS;                  // 空闲检测间隔
58 } // namespace Startup
59 } // namespace UpdateEngine
60 } // namespace OHOS
61 #endif // STARTUP_CONSTANT_H