1 /* 2 * Copyright (c) 2022-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 STATS_HISYSEVENT_H 17 #define STATS_HISYSEVENT_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace PowerMgr { 23 class StatsHiSysEvent { 24 public: 25 enum HiSysEventType { 26 HISYSEVENT_TYPE_INVALID = -1, 27 HISYSEVENT_TYPE_POWER_RUNNINGLOCK, 28 HISYSEVENT_TYPE_SCREEN_STATE, 29 HISYSEVENT_TYPE_BRIGHTNESS_NIT, 30 HISYSEVENT_TYPE_BACKLIGHT_DISCOUNT, 31 HISYSEVENT_TYPE_AMBIENT_LIGHT, 32 HISYSEVENT_TYPE_BATTERY_CHANGED, 33 HISYSEVENT_TYPE_POWER_TEMPERATURE, 34 HISYSEVENT_TYPE_THERMAL_LEVEL_CHANGED, 35 HISYSEVENT_TYPE_POWER_WORKSCHEDULER, 36 HISYSEVENT_TYPE_WORK_ADD, 37 HISYSEVENT_TYPE_WORK_REMOVE, 38 HISYSEVENT_TYPE_WORK_START, 39 HISYSEVENT_TYPE_WORK_STOP, 40 HISYSEVENT_TYPE_TORCH_STATE, 41 HISYSEVENT_TYPE_CAMERA_CONNECT, 42 HISYSEVENT_TYPE_CAMERA_DISCONNECT, 43 HISYSEVENT_TYPE_FLASHLIGHT_ON, 44 HISYSEVENT_TYPE_FLASHLIGHT_OFF, 45 HISYSEVENT_TYPE_STREAM_CHANGE, 46 HISYSEVENT_TYPE_POWER_SENSOR_GRAVITY, 47 HISYSEVENT_TYPE_POWER_SENSOR_PROXIMITY, 48 HISYSEVENT_TYPE_GNSS_STATE, 49 HISYSEVENT_TYPE_BR_SWITCH_STATE, 50 HISYSEVENT_TYPE_DISCOVERY_STATE, 51 HISYSEVENT_TYPE_BLE_SWITCH_STATE, 52 HISYSEVENT_TYPE_BLE_SCAN_START, 53 HISYSEVENT_TYPE_BLE_SCAN_STOP, 54 HISYSEVENT_TYPE_WIFI_CONNECTION, 55 HISYSEVENT_TYPE_WIFI_SCAN, 56 HISYSEVENT_TYPE_WIFI_SIGNAL, 57 HISYSEVENT_TYPE_WIFI_BAND, 58 HISYSEVENT_TYPE_START_REMOTE_ABILITY, 59 HISYSEVENT_TYPE_MISC_TIME_STATISTIC_REPORT, 60 HISYSEVENT_TYPE_THERMAL_ACTION_TRIGGERED, 61 HISYSEVENT_TYPE_CALL_STATE, 62 HISYSEVENT_TYPE_DATA_CONNECTION_STATE, 63 HISYSEVENT_TYPE_END 64 }; 65 66 static constexpr const char* POWER_RUNNINGLOCK = "RUNNINGLOCK"; 67 static constexpr const char* SCREEN_STATE = "SCREEN_STATE"; 68 static constexpr const char* BRIGHTNESS_NIT = "BRIGHTNESS_NIT"; 69 static constexpr const char* BACKLIGHT_DISCOUNT = "BACKLIGHT_DISCOUNT"; 70 static constexpr const char* AMBIENT_LIGHT = "AMBIENT_LIGHT"; 71 static constexpr const char* BATTERY_CHANGED = "CHANGED"; 72 static constexpr const char* POWER_TEMPERATURE = "POWER_TEMPERATURE"; 73 static constexpr const char* THERMAL_LEVEL_CHANGED = "LEVEL_CHANGED"; 74 static constexpr const char* POWER_WORKSCHEDULER = "POWER_WORKSCHEDULER"; 75 static constexpr const char* WORK_ADD = "WORK_ADD"; 76 static constexpr const char* WORK_REMOVE = "WORK_REMOVE"; 77 static constexpr const char* WORK_START = "WORK_START"; 78 static constexpr const char* WORK_STOP = "WORK_STOP"; 79 static constexpr const char* TORCH_STATE = "TORCH_STATE"; 80 static constexpr const char* CAMERA_CONNECT = "CAMERA_CONNECT"; 81 static constexpr const char* FLASHLIGHT_ON = "FLASHLIGHT_ON"; 82 static constexpr const char* CAMERA_DISCONNECT = "CAMERA_DISCONNECT"; 83 static constexpr const char* FLASHLIGHT_OFF = "FLASHLIGHT_OFF"; 84 static constexpr const char* STREAM_CHANGE = "STREAM_CHANGE"; 85 static constexpr const char* POWER_SENSOR_GRAVITY = "POWER_SENSOR_GRAVITY"; 86 static constexpr const char* POWER_SENSOR_PROXIMITY = "POWER_SENSOR_PROXIMITY"; 87 static constexpr const char* GNSS_STATE = "GNSS_STATE"; 88 static constexpr const char* BR_SWITCH_STATE = "BR_SWITCH_STATE"; 89 static constexpr const char* DISCOVERY_STATE = "DISCOVERY_STATE"; 90 static constexpr const char* BLE_SWITCH_STATE = "BLE_SWITCH_STATE"; 91 static constexpr const char* BLE_SCAN_START = "BLE_SCAN_START"; 92 static constexpr const char* BLE_SCAN_STOP = "BLE_SCAN_STOP"; 93 static constexpr const char* WIFI_CONNECTION = "WIFI_CONNECTION"; 94 static constexpr const char* WIFI_SCAN = "WIFI_SCAN"; 95 static constexpr const char* WIFI_SIGNAL = "WIFI_SIGNAL"; 96 static constexpr const char* WIFI_BAND = "WIFI_BAND"; 97 static constexpr const char* START_REMOTE_ABILITY = "START_REMOTE_ABILITY"; 98 static constexpr const char* MISC_TIME_STATISTIC_REPORT = "MISC_TIME_STATISTIC_REPORT"; 99 static constexpr const char* THERMAL_ACTION_TRIGGERED = "ACTION_TRIGGERED"; 100 static constexpr const char* CALL_STATE = "CALL_STATE"; 101 static constexpr const char* DATA_CONNECTION_STATE = "DATA_CONNECTION_STATE"; 102 103 static constexpr const char* HISYSEVENT_LIST[HISYSEVENT_TYPE_END] = { 104 POWER_RUNNINGLOCK, 105 SCREEN_STATE, 106 BRIGHTNESS_NIT, 107 BACKLIGHT_DISCOUNT, 108 AMBIENT_LIGHT, 109 BATTERY_CHANGED, 110 POWER_TEMPERATURE, 111 THERMAL_LEVEL_CHANGED, 112 POWER_WORKSCHEDULER, 113 WORK_ADD, 114 WORK_REMOVE, 115 WORK_START, 116 WORK_STOP, 117 TORCH_STATE, 118 CAMERA_CONNECT, 119 CAMERA_DISCONNECT, 120 FLASHLIGHT_ON, 121 FLASHLIGHT_OFF, 122 STREAM_CHANGE, 123 POWER_SENSOR_GRAVITY, 124 POWER_SENSOR_PROXIMITY, 125 GNSS_STATE, 126 BR_SWITCH_STATE, 127 DISCOVERY_STATE, 128 BLE_SWITCH_STATE, 129 BLE_SCAN_START, 130 BLE_SCAN_STOP, 131 WIFI_CONNECTION, 132 WIFI_SCAN, 133 WIFI_SIGNAL, 134 WIFI_BAND, 135 START_REMOTE_ABILITY, 136 MISC_TIME_STATISTIC_REPORT, 137 THERMAL_ACTION_TRIGGERED, 138 CALL_STATE, 139 DATA_CONNECTION_STATE, 140 }; 141 142 static bool CheckHiSysEvent(const std::string& eventName); 143 }; 144 } // namespace PowerMgr 145 } // namespace OHOS 146 #endif // STATS_HISYSEVENT_H