1 /*
2  * Copyright (c) 2022 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 BUNDLE_ACTIVE_GROUP_COMMON_H
17 #define BUNDLE_ACTIVE_GROUP_COMMON_H
18 
19 namespace OHOS {
20 namespace DeviceUsageStats {
21 namespace DeviceUsageStatsGroupConst {
22 const int32_t ACTIVE_GROUP_UNKNOWN = -1;
23 const int32_t ACTIVE_GROUP_FORCED_SET = 5;
24 const int32_t ACTIVE_GROUP_ALIVE = 10;
25 const int32_t ACTIVE_GROUP_DAILY = 20;
26 const int32_t ACTIVE_GROUP_FIXED = 30;
27 const int32_t ACTIVE_GROUP_RARE = 40;
28 const int32_t ACTIVE_GROUP_LIMIT = 50;
29 const int32_t ACTIVE_GROUP_NEVER = 60;
30 const int64_t FIVE_SECOND = 5 * 1000LL;
31 const int64_t ONE_MINUTE = 60 * 1000LL;
32 const int64_t TWO_MINUTE = 2 * ONE_MINUTE;
33 const int64_t THREE_MINUTE = 3 * ONE_MINUTE;
34 const int64_t FOUR_MINUTE = 4 * ONE_MINUTE;
35 const int64_t TEN_MINUTE = 10 * ONE_MINUTE;
36 const int64_t SIXTEEN_MINUTE = 16 * ONE_MINUTE;
37 const int64_t ONE_HOUR = 60 * ONE_MINUTE;
38 const int64_t TWO_HOUR = 2 * ONE_HOUR;
39 const int64_t THREE_HOUR = 3 * ONE_HOUR;
40 const int64_t TWELVE_HOUR = 12 * ONE_HOUR;
41 const int64_t TWENTY_FOUR_HOUR = 24 * ONE_HOUR;
42 const int64_t FOURTY_EIGHT_HOUR = 48 * ONE_HOUR;
43 const int64_t DEFAULT_EVENT_TIMEOUT = ONE_HOUR;
44 const int64_t DEFAULT_NOTIFY_EVENT_TIMEOUT = 12 * ONE_HOUR;
45 const int64_t DEFAULT_SYSTEevent__TIMEOUT = 2 * ONE_HOUR;
46 const int64_t DEFAULT_LONT_TIME_TASK_START_EVENT_TIMEOUT = 30 * ONE_MINUTE;
47 const uint32_t GROUP_CONTROL_REASON_MASK = 0xFF00;
48 const uint32_t GROUP_CONTROL_REASON_DEFAULT = 0x0100;
49 const uint32_t GROUP_CONTROL_REASON_TIMEOUT = 0x0200;
50 const uint32_t GROUP_CONTROL_REASON_USAGE = 0x0300;
51 const uint32_t GROUP_CONTROL_REASON_FORCED = 0x0400;
52 const uint32_t GROUP_CONTROL_REASON_CALCULATED = 0x0500;
53 const uint32_t GROUP_EVENT_REASON_MASK = 0x00FF;
54 const uint32_t GROUP_EVENT_REASON_SYSTEM = 0x0001;
55 const uint32_t GROUP_EVENT_REASON_NOTIFY_SEEN = 0x0002;
56 const uint32_t GROUP_EVENT_REASON_USER_INTERACTION = 0x0003;
57 const uint32_t GROUP_EVENT_REASON_FOREGROUND = 0x0004;
58 const uint32_t GROUP_EVENT_REASON_BACKGROUND = 0x0005;
59 const uint32_t GROUP_EVENT_REASON_ALIVE_TIMEOUT = 0x0006;
60 const uint32_t GROUP_EVENT_REASON_LONG_TIME_TASK_STARTTED = 0x0007;
61 const uint32_t GROUP_EVENT_REASON_CALCULATED_RESTORED = 0x0008;
62 const uint32_t GROUP_EVENT_REASON_ALIVE_NOT_TIMEOUT = 0x0009;
63 }
64 }  // namespace DeviceUsageStats
65 }  // namespace OHOS
66 #endif  // BUNDLE_ACTIVE_GROUP_COMMON_H
67 
68