• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /**
17  * @addtogroup OH_CommonEvent
18  * @{
19  *
20  * @brief Provides the APIs of common event service.
21  *
22  * @since 12
23  */
24 /**
25  * @file oh_commonevent_support.h
26  *
27  * @brief Declares the constants of system-defined common event.
28  *
29  * @library libohcommonevent.so
30  * @kit BasicServicesKit
31  * @syscap SystemCapability.Notification.CommonEvent
32  * @since 12
33  * @version 1.0
34  */
35 
36 #ifndef OH_COMMONEVENT_SUPPORT_H
37 #define OH_COMMONEVENT_SUPPORT_H
38 
39 #include <stdint.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /**
46  * @brief This commonEvent means when the device is shutting down, note: turn off, not sleeping.
47  *
48  * @since 12
49  */
50 static const char* const COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN";
51 
52 /**
53  * @brief This commonEvent means when the charging state, level and so on about the battery.
54  *
55  * @since 12
56  */
57 static const char* const COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED";
58 
59 /**
60  * @brief This commonEvent means when the device in low battery state.
61  *
62  * @since 12
63  */
64 static const char* const COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW";
65 
66 /**
67  * @brief This commonEvent means when the battery level is an ok state.
68  *
69  * @since 12
70  */
71 static const char* const COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY";
72 
73 /**
74  * @brief This commonEvent means when the other power is connected to the device.
75  *
76  * @since 12
77  */
78 static const char* const COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED";
79 
80 /**
81  * @brief This commonEvent means when the other power is removed from the device.
82  *
83  * @since 12
84  */
85 static const char* const COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED";
86 
87 /**
88  * @brief This commonEvent means when the screen is turned off.
89  *
90  * @since 12
91  */
92 static const char* const COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF";
93 
94 /**
95  * @brief This commonEvent means when the device is awakened and interactive.
96  *
97  * @since 12
98  */
99 static const char* const COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON";
100 
101 /**
102  * @brief This commonEvent means when the device is is about to enter the hibernate mode.
103  *
104  * @since 15
105  */
106 static const char* const COMMON_EVENT_ENTER_HIBERNATE = "usual.event.ENTER_HIBERNATE";
107 
108 /**
109  * @brief This commonEvent means when the device is exits the hibernate mode.
110  *
111  * @since 15
112  */
113 static const char* const COMMON_EVENT_EXIT_HIBERNATE = "usual.event.EXIT_HIBERNATE";
114 
115 /**
116  * @brief This commonEvent means when the thermal state level change
117  *
118  * @since 12
119  */
120 static const char* const COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED";
121 
122 /**
123  * @brief This commonEvent means when the current time is changed.
124  *
125  * @since 12
126  */
127 static const char* const COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK";
128 
129 /**
130  * @brief This commonEvent means when the time is set.
131  *
132  * @since 12
133  */
134 static const char* const COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED";
135 
136 /**
137  * @brief This commonEvent means when the time zone is changed.
138  *
139  * @since 12
140  */
141 static const char* const COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED";
142 
143 /**
144  * @brief This commonEvent means when a new application package is installed on the device.
145  *
146  * @since 12
147  */
148 static const char* const COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED";
149 
150 /**
151  * @brief This commonEvent means when an existing application package is removed from the device.
152  *
153  * @since 12
154  */
155 static const char* const COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED";
156 
157 /**
158  * @brief This commonEvent means when an installed application's add-on package is removed from the device.
159  *
160  * @since 12
161  */
162 static const char* const COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED";
163 
164 /**
165  * @brief This commonEvent means when an existing application package is completely removed from the device.
166  *
167  * @since 12
168  */
169 static const char* const COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED";
170 
171 /**
172  * @brief This commonEvent means when an existing application package has been changed.
173  *
174  * @since 12
175  */
176 static const char* const COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED";
177 
178 /**
179  * @brief This commonEvent means the user has restarted a package, and all of its processes have been killed.
180  *
181  * @since 12
182  */
183 static const char* const COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED";
184 
185 /**
186  * @brief This commonEvent means the user has cleared the package data.
187  *
188  * @since 12
189  */
190 static const char* const COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED";
191 
192 /**
193  * @brief This commonEvent means the user has cleared the package cache.
194  *
195  * @since 12
196  */
197 static const char* const COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED";
198 
199 /**
200  * @brief This commonEvent means the packages have been suspended.
201  *
202  * @since 12
203  */
204 static const char* const COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED";
205 
206 /**
207  * @brief This commonEvent Sent to a package that has been suspended by the system.
208  *
209  * @since 12
210  */
211 static const char* const COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED";
212 
213 /**
214  * @brief Sent to a package that has been un-suspended.
215  *
216  * @since 12
217  */
218 static const char* const COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED";
219 
220 /**
221  * @brief The current device's locale has changed.
222  *
223  * @since 12
224  */
225 static const char* const COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED";
226 
227 /**
228  * @brief Indicates low memory condition notification acknowledged by user and package
229  * management should be started.
230  *
231  * @since 12
232  */
233 static const char* const COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE";
234 
235 /**
236  * @brief Remind new user of that the service has been unlocked.
237  *
238  * @since 12
239  */
240 static const char* const COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED";
241 
242 /**
243  * @brief Distributed account logout successfully.
244  *
245  * @since 12
246  */
247 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT = "common.event.DISTRIBUTED_ACCOUNT_LOGOUT";
248 
249 /**
250  * @brief Distributed account is invalid.
251  *
252  * @since 12
253  */
254 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID =
255     "common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID";
256 
257 /**
258  * @brief Distributed account logs off.
259  *
260  * @since 12
261  */
262 static const char* const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF = "common.event.DISTRIBUTED_ACCOUNT_LOGOFF";
263 
264 /**
265  * @brief WIFI state.
266  *
267  * @since 12
268  */
269 static const char* const COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE";
270 
271 /**
272  * @brief WIFI scan results.
273  *
274  * @since 12
275  */
276 static const char* const COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED";
277 
278 /**
279  * @brief WIFI RSSI change.
280  *
281  * @since 12
282  */
283 static const char* const COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE";
284 
285 /**
286  * @brief WIFI connect state.
287  *
288  * @since 12
289  */
290 static const char* const COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE";
291 
292 /**
293  * @brief WIFI hotspot state.
294  *
295  * @since 12
296  */
297 static const char* const COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE";
298 
299 /**
300  * @brief WIFI ap sta join.
301  *
302  * @since 12
303  */
304 static const char* const COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN";
305 
306 /**
307  * @brief WIFI ap sta join.
308  *
309  * @since 12
310  */
311 static const char* const COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE";
312 
313 /**
314  * @brief Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink.
315  *
316  * @since 12
317  */
318 static const char* const COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE";
319 
320 /**
321  * @brief Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P.
322  *
323  * @since 12
324  */
325 static const char* const COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE";
326 
327 /**
328  * @brief Indicates that the Wi-Fi P2P state change.
329  *
330  * @since 12
331  */
332 static const char* const COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE";
333 
334 /**
335  * @brief Indicates that the Wi-Fi P2P peers state change.
336  *
337  * @since 12
338  */
339 static const char* const COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = "usual.event.wifi.p2p.DEVICES_CHANGE";
340 
341 /**
342  * @brief Indicates that the Wi-Fi P2P discovery state change.
343  *
344  * @since 12
345  */
346 static const char* const COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED =
347     "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE";
348 
349 /**
350  * @brief Indicates that the Wi-Fi P2P current device state change.
351  *
352  * @since 12
353  */
354 static const char* const COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED =
355     "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE";
356 
357 /**
358  * @brief Indicates that the Wi-Fi P2P group info is changed.
359  *
360  * @since 12
361  */
362 static const char* const COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED = "usual.event.wifi.p2p.GROUP_STATE_CHANGED";
363 
364 /**
365  * @brief Nfc state change.
366  *
367  * @since 12
368  */
369 static const char* const COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = "usual.event.nfc.action.ADAPTER_STATE_CHANGED";
370 
371 /**
372  * @brief Nfc field on detected.
373  *
374  * @since 12
375  */
376 static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = "usual.event.nfc.action.RF_FIELD_ON_DETECTED";
377 
378 /**
379  * @brief Nfc field off detected.
380  *
381  * @since 12
382  */
383 static const char* const COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED";
384 
385 /**
386  * @brief Sent when stop charging battery.
387  *
388  * @since 12
389  */
390 static const char* const COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING";
391 
392 /**
393  * @brief Sent when start charging battery.
394  *
395  * @since 12
396  */
397 static const char* const COMMON_EVENT_CHARGING = "usual.event.CHARGING";
398 
399 /**
400  * @brief Sent when device's idle mode changed
401  *
402  * @since 12
403  */
404 static const char* const COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED";
405 
406 /**
407  * @brief Sent when device's charge idle mode changed.
408  *
409  * @since 12
410  */
411 static const char* const COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED = "usual.event.CHARGE_IDLE_MODE_CHANGED";
412 
413 /**
414  * @brief Sent when device's power save mode changed
415  *
416  * @since 12
417  */
418 static const char* const COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED";
419 
420 /**
421  * @brief The usb state change events.
422  * This is a protected common event that can only be sent by system.
423  *
424  * @since 12
425  */
426 static const char* const COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE";
427 
428 /**
429  * @brief The usb port changed.
430  * This is a protected common event that can only be sent by system.
431  *
432  * @since 12
433  */
434 static const char* const COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED";
435 
436 /**
437  * @brief The usb device attached.
438  * This is a protected common event that can only be sent by system.
439  *
440  * @since 12
441  */
442 static const char* const COMMON_EVENT_USB_DEVICE_ATTACHED = "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED";
443 
444 /**
445  * @brief The usb device detached.
446  * This is a protected common event that can only be sent by system.
447  *
448  * @since 12
449  */
450 static const char* const COMMON_EVENT_USB_DEVICE_DETACHED = "usual.event.hardware.usb.action.USB_DEVICE_DETACHED";
451 
452 /**
453  * @brief Indicates the common event Action indicating that the airplane mode status of the device changes.
454  * Users can register this event to listen to the change of the airplane mode status of the device.
455  *
456  * @since 12
457  */
458 static const char* const COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE";
459 
460 /**
461  * @brief sent by the window manager service when the window mode is split.
462  *
463  * @since 12
464  */
465 static const char* const COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN";
466 
467 /**
468  * @brief Indicate the result of quick fix apply.
469  * This common event can be triggered only by system.
470  *
471  * @since 12
472  */
473 static const char* const COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT";
474 
475 /**
476  * @brief Indicate the result of quick fix revoke.
477  * This common event can be triggered only by system.
478  *
479  * @since 12
480  */
481 static const char* const COMMON_EVENT_QUICK_FIX_REVOKE_RESULT = "usual.event.QUICK_FIX_REVOKE_RESULT";
482 
483 /**
484  * @brief Indicate the action of a common event that the user information has been updated.
485  * This common event can be triggered only by system.
486  *
487  * @since 12
488  */
489 static const char* const COMMON_EVENT_USER_INFO_UPDATED = "usual.event.USER_INFO_UPDATED";
490 
491 /**
492  * @brief Indicates the action of a common event that the phone SIM card state has changed.
493  * This is a protected common event that can only be sent by system.
494  *
495  * @since 12
496  */
497 static const char* const COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM_STATE_CHANGED";
498 
499 /**
500  * @brief Indicates the action of a common event that the call state has been changed.
501  * To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE
502  * permission.
503  * This is a protected common event that can only be sent by system.
504  *
505  * @since 12
506  */
507 static const char* const COMMON_EVENT_CALL_STATE_CHANGED = "usual.event.CALL_STATE_CHANGED";
508 
509 /**
510  * @brief Indicates the action of a common event that the network state has been changed.
511  * This is a protected common event that can only be sent by system.
512  *
513  * @since 12
514  */
515 static const char* const COMMON_EVENT_NETWORK_STATE_CHANGED = "usual.event.NETWORK_STATE_CHANGED";
516 
517 /**
518  * @brief Indicates the action of a common event that the signal info has been changed.
519  * This is a protected common event that can only be sent by system.
520  *
521  * @since 12
522  */
523 static const char* const COMMON_EVENT_SIGNAL_INFO_CHANGED = "usual.event.SIGNAL_INFO_CHANGED";
524 
525 /**
526  * @brief This commonEvent means when the screen is unlocked.
527  *
528  * @since 12
529  */
530 static const char* const COMMON_EVENT_SCREEN_UNLOCKED = "usual.event.SCREEN_UNLOCKED";
531 
532 /**
533  * @brief This commonEvent means when the screen is locked.
534  *
535  * @since 12
536  */
537 static const char* const COMMON_EVENT_SCREEN_LOCKED = "usual.event.SCREEN_LOCKED";
538 
539 /**
540  * @brief This commonEvent means when the http proxy change.
541  *
542  * This is a protected common event that can only be sent by system.
543  *
544  * @since 12
545  */
546 static const char* const COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE";
547 
548 /**
549  * @brief This commonEvent means when the network connectivityy change.
550  *
551  * This is a protected common event that can only be sent by system.
552  *
553  * @since 12
554  */
555 static const char* const COMMON_EVENT_CONNECTIVITY_CHANGE = "usual.event.CONNECTIVITY_CHANGE";
556 
557 /**
558  * @brief This common event means that minors mode is enabled.
559  * This is a protected common event that can only be sent by system.
560  *
561  * @since 12
562  */
563 static const char* const COMMON_EVENT_MINORSMODE_ON = "usual.event.MINORSMODE_ON";
564 
565 /**
566  * @brief This common event means that minors mode is disabled.
567  * This is a protected common event that can only be sent by system.
568  *
569  * @since 12
570  */
571 static const char* const COMMON_EVENT_MINORSMODE_OFF = "usual.event.MINORSMODE_OFF";
572 
573 /**
574  * @brief This common event means that the managed browser policy is changed.
575  * This is a protected common event that can only be sent by system.
576  *
577  * @since 15
578  */
579 static const char* const COMMON_EVENT_MANAGED_BROWSER_POLICY_CHANGED = "usual.event.MANAGED_BROWSER_POLICY_CHANGED";
580 #ifdef __cplusplus
581 }
582 #endif
583 #endif // OH_COMMONEVENT_SUPPORT_H
584 /** @} */
585