1 /* 2 * Copyright (c) 2022-2025 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 FOCUS_WINDOW = "FOCUS_WINDOW"; 73 const std::string KEY_OF_BUNDLE_NAME = "BUNDLE_NAME"; 74 const std::string KEY_OF_WINDOW_TYPE = "WINDOW_TYPE"; 75 } 76 77 namespace FoldStateChangeEventSpace { 78 const std::string EVENT_NAME = "NOTIFY_FOLD_STATE_CHANGE"; 79 const std::string KEY_OF_NEXT_STATUS = "NEXT_FOLD_STATUS"; 80 } 81 82 namespace VhModeChangeEventSpace { 83 const std::string EVENT_NAME = "VH_MODE"; 84 const std::string KEY_OF_MODE = "MODE"; 85 } 86 87 namespace ScreenFoldStatus { 88 constexpr int EXPAND_LANDSCAPE_STATUS = 11; 89 constexpr int EXPAND_PORTRAIT_STATUS = 12; 90 constexpr int FOLD_LANDSCAPE_STATUS = 21; 91 constexpr int FOLD_PORTRAIT_STATUS = 22; 92 } 93 94 namespace FoldEventTable { 95 const std::string FIELD_ID = "id"; 96 const std::string FIELD_UID = "uid"; 97 const std::string FIELD_EVENT_ID = "rawid"; 98 const std::string FIELD_TS = "ts"; 99 const std::string FIELD_FOLD_STATUS = "fold_status"; 100 const std::string FIELD_PRE_FOLD_STATUS = "pre_fold_status"; 101 const std::string FIELD_VERSION_NAME = "version_name"; 102 const std::string FIELD_HAPPEN_TIME = "happen_time"; 103 const std::string FIELD_FOLD_PORTRAIT_DURATION = "fold_portrait_duration"; 104 const std::string FIELD_FOLD_LANDSCAPE_DURATION = "fold_landscape_duration"; 105 const std::string FIELD_EXPAND_PORTRAIT_DURATION = "expand_portrait_duration"; 106 const std::string FIELD_EXPAND_LANDSCAPE_DURATION = "expand_landscape_duration"; 107 const std::string FIELD_BUNDLE_NAME = "bundle_name"; 108 } 109 } // namespace HiviewDFX 110 } // namespace OHOS 111 #endif // HIVIEW_PLUGINS_USAGE_EVENT_REPORT_SREVICE_USAGE_EVENT_COMMON_H 112