1 /*
2  * Copyright (c) 2022-2024 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 HIVIEW_PLUGINS_USAGE_EVENT_REPORT_SREVICE_USAGE_EVENT_COMMON_H
17 #define HIVIEW_PLUGINS_USAGE_EVENT_REPORT_SREVICE_USAGE_EVENT_COMMON_H
18 
19 #include <string>
20 
21 #include "hiview_event_common.h"
22 
23 namespace OHOS {
24 namespace HiviewDFX {
25 namespace AppUsageEventSpace {
26 const std::string EVENT_NAME = "APP_USAGE";
27 const std::string KEY_OF_PACKAGE = "PACKAGE";
28 const std::string KEY_OF_VERSION = "VERSION";
29 const std::string KEY_OF_USAGE = "USAGE";
30 const std::string KEY_OF_DATE = "DATE";
31 const std::string KEY_OF_START_NUM = "TOTAL_START_NUM";
32 }
33 
34 namespace FoldAppUsageEventSpace {
35 const std::string EVENT_NAME = "FOLD_APP_USAGE";
36 const std::string KEY_OF_PACKAGE = "PACKAGE";
37 const std::string KEY_OF_VERSION = "VERSION";
38 const std::string KEY_OF_USAGE = "USAGE";
39 const std::string KEY_OF_FOLD_VER_USAGE = "FOLD_V";
40 const std::string KEY_OF_FOLD_HOR_USAGE = "FOLD_H";
41 const std::string KEY_OF_EXPD_VER_USAGE = "EXPD_V";
42 const std::string KEY_OF_EXPD_HOR_USAGE = "EXPD_H";
43 const std::string KEY_OF_DATE = "DATE";
44 const std::string KEY_OF_START_NUM = "TOTAL_START_NUM";
45 const std::string SCENEBOARD_BUNDLE_NAME = "com.ohos.sceneboard"; // NOT include sceneboard
46 }
47 
48 namespace SysUsageEventSpace {
49 const std::string EVENT_NAME = "SYS_USAGE";
50 const std::string KEY_OF_START = "START";
51 const std::string KEY_OF_END = "END";
52 const std::string KEY_OF_POWER = "POWER";
53 const std::string KEY_OF_RUNNING = "RUNNING";
54 }
55 
56 namespace SysUsageDbSpace {
57 const std::string SYS_USAGE_TABLE = "sys_usage";
58 const std::string LAST_SYS_USAGE_TABLE = "last_sys_usage";
59 }
60 namespace DomainSpace {
61 constexpr char HIVIEWDFX_UE_DOMAIN[] = "HIVIEWDFX_UE";
62 }
63 
64 namespace FoldEventId {
65     constexpr int EVENT_APP_START = 1101;
66     constexpr int EVENT_APP_EXIT = 1102;
67     constexpr int EVENT_SCREEN_STATUS_CHANGED = 1103;
68     constexpr int EVENT_COUNT_DURATION = 1104;
69 }
70 
71 namespace AppEventSpace {
72     const std::string FOREGROUND_EVENT_NAME = "APP_FOREGROUND";
73     const std::string BACKGROUND_EVENT_NAME = "APP_BACKGROUND";
74     const std::string KEY_OF_PROCESS_NAME = "PROCESS_NAME";
75     const std::string KEY_OF_VERSION_NAME = "VERSION_NAME";
76     const std::string KEY_OF_CALLER_BUNDLENAME = "CALLER_BUNDLENAME";
77     const std::string KEY_OF_BUNDLE_TYPE = "BUNDLE_TYPE";
78     const std::string KEY_OF_VERSION_CODE = "VERSION_CODE";
79     const std::string KEY_OF_BUNDLE_NAME = "BUNDLE_NAME";
80     const std::string KEY_OF_APP_PID = "APP_PID";
81     const std::string KEY_OF_PROCESS_TYPE = "PROCESS_TYPE";
82 }
83 
84 namespace FoldStateChangeEventSpace {
85     const std::string EVENT_NAME = "NOTIFY_FOLD_STATE_CHANGE";
86     const std::string KEY_OF_CURRENT_STATUS = "CURRENT_FOLD_STATUS";
87     const std::string KEY_OF_NEXT_STATUS = "NEXT_FOLD_STATUS";
88     const std::string KEY_OF_SENSOR_POSTURE = "SENSOR_POSTURE";
89 }
90 
91 namespace VhModeChangeEventSpace {
92     const std::string EVENT_NAME = "VH_MODE";
93     const std::string KEY_OF_MODE = "MODE";
94 }
95 
96 namespace ScreenFoldStatus {
97     constexpr int EXPAND_LANDSCAPE_STATUS = 11;
98     constexpr int EXPAND_PORTRAIT_STATUS = 12;
99     constexpr int FOLD_LANDSCAPE_STATUS = 21;
100     constexpr int FOLD_PORTRAIT_STATUS = 22;
101 }
102 
103 namespace FoldEventTable {
104     const std::string FIELD_ID = "id";
105     const std::string FIELD_UID = "uid";
106     const std::string FIELD_EVENT_ID = "rawid";
107     const std::string FIELD_TS = "ts";
108     const std::string FIELD_FOLD_STATUS = "fold_status";
109     const std::string FIELD_PRE_FOLD_STATUS = "pre_fold_status";
110     const std::string FIELD_VERSION_NAME = "version_name";
111     const std::string FIELD_HAPPEN_TIME = "happen_time";
112     const std::string FIELD_FOLD_PORTRAIT_DURATION = "fold_portrait_duration";
113     const std::string FIELD_FOLD_LANDSCAPE_DURATION = "fold_landscape_duration";
114     const std::string FIELD_EXPAND_PORTRAIT_DURATION = "expand_portrait_duration";
115     const std::string FIELD_EXPAND_LANDSCAPE_DURATION = "expand_landscape_duration";
116     const std::string FIELD_BUNDLE_NAME = "bundle_name";
117 }
118 } // namespace HiviewDFX
119 } // namespace OHOS
120 #endif // HIVIEW_PLUGINS_USAGE_EVENT_REPORT_SREVICE_USAGE_EVENT_COMMON_H
121