1 /*
2  * Copyright (c) 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 OH_COMMONEVENT_SUPPORT_CODE_H
17 #define OH_COMMONEVENT_SUPPORT_CODE_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /**
26  * This commonEvent means when the device finnish booting, but still in the locked state.
27  */
28 static const char* const COMMON_EVENT_LOCKED_BOOT_COMPLETED = "usual.event.LOCKED_BOOT_COMPLETED";
29 
30 /**
31  * This commonEvent means when the device is shutting down, note: turn off, not sleeping.
32  */
33 static const char* const COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN";
34 
35 /**
36  * This commonEvent means when the charging state, level and so on about the battery.
37  */
38 static const char* const COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED";
39 
40 /**
41  * This commonEvent means when the device in low battery state..
42  */
43 static const char* const COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW";
44 
45 /**
46  * This commonEvent means when the battery level is an ok state.
47  */
48 static const char* const COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY";
49 
50 /**
51  * This commonEvent means when the other power is connected to the device.
52  */
53 static const char* const COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED";
54 
55 /**
56  * This commonEvent means when the other power is removed from the device.
57  */
58 static const char* const COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED";
59 
60 /**
61  * This commonEvent means when the screen is turned off.
62  */
63 static const char* const COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF";
64 
65 /**
66  * This commonEvent means when the device is awakened and interactive.
67  */
68 static const char* const COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON";
69 
70 /**
71  * This commonEvent means when the thermal state level change
72  */
73 static const char* const COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED";
74 
75 /**
76  * This commonEvent means when the current time is changed.
77  */
78 static const char* const COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK";
79 
80 /**
81  * This commonEvent means when the time is set.
82  */
83 static const char* const COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED";
84 
85 /**
86  * This commonEvent means when the time zone is changed.
87  */
88 static const char* const COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED";
89 
90 /**
91  * This commonEvent means when a new application package is installed on the device.
92  */
93 static const char* const COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED";
94 
95 /**
96  * This commonEvent means when an existing application package is removed from the device.
97  */
98 static const char* const COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED";
99 
100 /**
101  * This commonEvent means when an existing application package is removed from the device.
102  */
103 static const char* const COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED";
104 
105 /**
106  * This commonEvent means when an existing application package is completely removed from the device.
107  */
108 static const char* const COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED";
109 
110 /**
111  * This commonEvent means when an existing application package has been changed.
112  */
113 static const char* const COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED";
114 
115 /**
116  * This commonEvent means the user has restarted a package, and all of its processes have been killed.
117  */
118 static const char* const COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED";
119 
120 /**
121  * This commonEvent means the user has cleared the package data.
122  */
123 static const char* const COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED";
124 
125 /**
126  * This commonEvent means the user has cleared the package cache.
127  */
128 static const char* const COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED";
129 
130 /**
131  * This commonEvent means the packages have been suspended.
132  */
133 static const char* const COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED";
134 
135 /**
136  * This commonEvent Sent to a package that has been suspended by the system.
137  */
138 static const char* const COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED";
139 
140 /**
141  * Sent to a package that has been un-suspended.
142  */
143 static const char* const COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED";
144 
145 /**
146  * The current device's locale has changed.
147  */
148 static const char* const COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED";
149 
150 /**
151  *  Indicates low memory condition notification acknowledged by user and package management should be started.
152  */
153 static const char* const COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE";
154 
155 /**
156  * Remind new user of that the service has been unlocked.
157  */
158 static const char* const COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED";
159 
160 /**
161  * Distributed account login successfully.
162  */
163 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGIN = "common.event.DISTRIBUTED_ACCOUNT_LOGIN";
164 
165 /**
166  * Distributed account logout successfully.
167  */
168 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT = "common.event.DISTRIBUTED_ACCOUNT_LOGOUT";
169 
170 /**
171  * Distributed account is invalid.
172  */
173 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID =
174     "common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID";
175 
176 /**
177  * Distributed account logs off.
178  */
179 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF = "common.event.DISTRIBUTED_ACCOUNT_LOGOFF";
180 
181 /**
182  * WIFI state.
183  */
184 static const char* const COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE";
185 
186 /**
187  * WIFI scan results.
188  */
189 static const char* const COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED";
190 
191 /**
192  * WIFI RSSI change.
193  */
194 static const char* const COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE";
195 
196 /**
197  * WIFI connect state.
198  */
199 static const char* const COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE";
200 
201 /**
202  * WIFI hotspot state.
203  */
204 static const char* const COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE";
205 
206 /**
207  * WIFI ap sta join.
208  */
209 static const char* const COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN";
210 
211 /**
212  * WIFI ap sta join.
213  */
214 static const char* const COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE";
215 
216 /**
217  * Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink.
218  */
219 static const char* const COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE";
220 
221 /**
222  * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P.
223  */
224 static const char* const COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE";
225 
226 /**
227  * Indicates that the Wi-Fi P2P state change.
228  */
229 static const char* const COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE";
230 
231 /**
232  * Indicates that the Wi-Fi P2P peers state change.
233  */
234 static const char* const COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = "usual.event.wifi.p2p.DEVICES_CHANGE";
235 
236 /**
237  * Indicates that the Wi-Fi P2P discovery state change.
238  */
239 static const char* const COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED =
240     "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE";
241 
242 /**
243  * Indicates that the Wi-Fi P2P current device state change.
244  */
245 static const char* const COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED =
246     "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE";
247 
248 /**
249  * Indicates that the Wi-Fi P2P group info is changed.
250  */
251 static const char* const COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED = "usual.event.wifi.p2p.GROUP_STATE_CHANGED";
252 
253 /**
254  * Nfc state change.
255  */
256 static const char* const COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = "usual.event.nfc.action.ADAPTER_STATE_CHANGED";
257 
258 /**
259  * Nfc field on detected.
260  */
261 static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = "usual.event.nfc.action.RF_FIELD_ON_DETECTED";
262 
263 /**
264  * Nfc field off detected.
265  */
266 static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED";
267 
268 /**
269  * Sent when stop charging battery.
270  */
271 static const char* const COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING";
272 
273 /**
274  * Sent when start charging battery.
275  */
276 static const char* const COMMON_EVENT_CHARGING = "usual.event.CHARGING";
277 
278 /**
279  * Sent when device's idle mode changed
280  */
281 static const char* const COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED";
282 
283 /**
284  * Sent when device's charge idle mode changed.
285  */
286 static const char* const COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED = "usual.event.CHARGE_IDLE_MODE_CHANGED";
287 
288 /**
289  * Sent when device's power save mode changed
290  */
291 static const char* const COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED";
292 
293 /**
294  * The usb state change events.
295  * This is a protected common event that can only be sent by system.
296  */
297 static const char* const COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE";
298 
299 /**
300  * The usb port changed.
301  * This is a protected common event that can only be sent by system.
302  */
303 static const char* const COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED";
304 
305 /**
306  * The usb device attached.
307  * This is a protected common event that can only be sent by system.
308  */
309 static const char* const COMMON_EVENT_USB_DEVICE_ATTACHED = "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED";
310 
311 /**
312  * The usb device detached.
313  * This is a protected common event that can only be sent by system.
314  */
315 static const char* const COMMON_EVENT_USB_DEVICE_DETACHED = "usual.event.hardware.usb.action.USB_DEVICE_DETACHED";
316 
317 /**
318  * Indicates the common event Action indicating that the airplane mode status of the device changes.
319  * Users can register this event to listen to the change of the airplane mode status of the device.
320  */
321 static const char* const COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE";
322 
323 /**
324  * sent by the window manager service when the window mode is split.
325  */
326 static const char* const COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN";
327 
328 /**
329  * Indicate the result of quick fix apply.
330  * This common event can be triggered only by system.
331  */
332 static const char* const COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT";
333 
334 /**
335  * Indicate the result of quick fix revoke.
336  * This common event can be triggered only by system.
337  */
338 static const char* const COMMON_EVENT_QUICK_FIX_REVOKE_RESULT = "usual.event.QUICK_FIX_REVOKE_RESULT";
339 
340 /**
341  * Indicate the action of a common event that the user information has been updated.
342  * This common event can be triggered only by system.
343  */
344 static const char* const COMMON_EVENT_USER_INFO_UPDATED = "usual.event.USER_INFO_UPDATED";
345 
346 /**
347  * Indicate http proxy has been changed.
348  * This is a protected common event that can only be sent by system.
349  */
350 static const char* const COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE";
351 
352 /**
353  * Indicates the action of a common event that the phone SIM card state has changed.
354  * This is a protected common event that can only be sent by system.
355  */
356 static const char* const COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM_STATE_CHANGED";
357 
358 /**
359  * Indicates the action of a common event that the call state has been changed.
360  * To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE
361  * permission.
362  * This is a protected common event that can only be sent by system.
363  */
364 static const char* const COMMON_EVENT_CALL_STATE_CHANGED = "usual.event.CALL_STATE_CHANGED";
365 
366 /**
367  * Indicates the action of a common event that the network state has been changed.
368  * This is a protected common event that can only be sent by system.
369  */
370 static const char* const COMMON_EVENT_NETWORK_STATE_CHANGED = "usual.event.NETWORK_STATE_CHANGED";
371 
372 /**
373  * Indicates the action of a common event that the signal info has been changed.
374  * This is a protected common event that can only be sent by system.
375  */
376 static const char* const COMMON_EVENT_SIGNAL_INFO_CHANGED = "usual.event.SIGNAL_INFO_CHANGED";
377 
378 /**
379  * This commonEvent means when the screen is unlocked.
380  */
381 static const char* const COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLOCKED";
382 
383 /**
384  * This commonEvent means when the screen is locked.
385  */
386 static const char* const COMMON_EVENT_SCREEN_LOCKED = "usual.event.SCREEN_LOCKED";
387 
388 /**
389  * Indicates the action of a common event that the network connectivity changed.
390  * This is a protected common event that can only be sent by system.
391  */
392 static const char* const COMMON_EVENT_CONNECTIVITY_CHANGE = "usual.event.CONNECTIVITY_CHANGE";
393 
394 /**
395  * This common event means that minors mode is enabled.
396  * This is a protected common event that can only be sent by system.
397  */
398 static const char* const COMMON_EVENT_MINORSMODE_ON = "usual.event.MINORSMODE_ON";
399 
400 /**
401  * This common event means that minors mode is disabled.
402  * This is a protected common event that can only be sent by system.
403  */
404 static const char* const COMMON_EVENT_MINORSMODE_OFF = "usual.event.MINORSMODE_OFF";
405 
406 /**
407  * This common event means that datashare is ready.
408  * This is a protected common event that can only be sent by system.
409  */
410 static const char* const COMMON_EVENT_DATA_SHARE_READY = "usual.event.DATA_SHARE_READY";
411 
412 #ifdef __cplusplus
413 }
414 #endif
415 #endif // OH_COMMONEVENT_SUPPORT_CODE_H