• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 #include "common_event_support.h"
17 
18 namespace OHOS {
19 namespace EventFwk {
20 /**
21  * Indicate the action of a common event that the user has finished booting and the system has been loaded.
22  * To subscribe to this common event, your application must have the ohos.permission.RECEIVER_STARTUP_COMPLETED
23  * permission.
24  * This common event can only be published by the system.
25  */
26 const std::string CommonEventSupport::COMMON_EVENT_BOOT_COMPLETED = "usual.event.BOOT_COMPLETED";
27 /**
28  * Indicate the action of a common event that the user has finished booting and the system has been loaded but the
29  * screen is still locked.
30  * To subscribe to this common event, your application must have the ohos.permission.RECEIVER_STARTUP_COMPLETED
31  * permission.
32  * This common event can only be published by the system.
33  */
34 const std::string CommonEventSupport::COMMON_EVENT_LOCKED_BOOT_COMPLETED = "usual.event.LOCKED_BOOT_COMPLETED";
35 /**
36  * Indicate the action of a common event that the device is being shut down and the final shutdown will proceed.
37  * This is different from sleeping. All unsaved data will be lost after shut down.
38  * This common event can only be published by the system.
39  */
40 const std::string CommonEventSupport::COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN";
41 /**
42  * Indicate the action of a common event that the charging state, level, and other information about the battery
43  * have changed.
44  * This common event can only be published by the system.
45  */
46 const std::string CommonEventSupport::COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED";
47 /**
48  * Indicate the action of a common event that the battery level is low.
49  * This common event can only be published by the system.
50  */
51 const std::string CommonEventSupport::COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW";
52 /**
53  * Indicate the action of a common event that the battery exit the low state.
54  * This common event can only be published by the system.
55  */
56 const std::string CommonEventSupport::COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY";
57 /**
58  * Indicate the action of a common event that the device is connected to the external power.
59  * This common event can only be published by the system.
60  */
61 const std::string CommonEventSupport::COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED";
62 /**
63  * Indicate the action of a common event that the device is disconnected from the external power.
64  * This common event can only be published by the system.
65  */
66 const std::string CommonEventSupport::COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED";
67 
68 /**
69  * Indicate the action of a common event that the device screen is off and the device is sleeping.
70  * This common event can only be published by the system.
71  */
72 const std::string CommonEventSupport::COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF";
73 /**
74  * Indicate the action of a common event that the device screen is on and the device is interactive.
75  * This common event can only be published by the system.
76  */
77 const std::string CommonEventSupport::COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON";
78 /**
79  * Indicate the action of a common event that the user unlocks the device.
80  * This common event can only be published by the system.
81  */
82 const std::string CommonEventSupport::COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT";
83 
84 /**
85  * Indicate the action of a common event that the system time has changed.
86  * This common event can only be published by the system.
87  */
88 const std::string CommonEventSupport::COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK";
89 /**
90  * Indicate the action of a common event that the system time is set.
91  * This common event can only be published by the system.
92  */
93 const std::string CommonEventSupport::COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED";
94 /**
95  * Indicate the action of a common event that the system date has changed.
96  * This common event can only be published by the system.
97  */
98 const std::string CommonEventSupport::COMMON_EVENT_DATE_CHANGED = "usual.event.DATE_CHANGED";
99 /**
100  * Indicate the action of a common event that the system time zone has changed.
101  * This common event can only be published by the system.
102  */
103 const std::string CommonEventSupport::COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED";
104 
105 /**
106  * Indicate the action of a common event that a user closes a temporary system dialog box.
107  * This common event can only be published by the system.
108  */
109 const std::string CommonEventSupport::COMMON_EVENT_CLOSE_SYSTEM_DIALOGS = "usual.event.CLOSE_SYSTEM_DIALOGS";
110 
111 /**
112  * Indicate the action of a common event that a new application package has been installed on the device.
113  * This common event can only be published by the system.
114  */
115 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED";
116 /**
117  * Indicate the action of a common event that a new version of an installed application package has replaced
118  * the previous one on the device.
119  * This common event can only be published by the system.
120  */
121 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_REPLACED = "usual.event.PACKAGE_REPLACED";
122 /**
123  * Indicate the action of a common event that a new version of your application package has replaced
124  * the previous one. This common event is sent only to the application that was replaced.
125  * This common event can only be published by the system.
126  */
127 const std::string CommonEventSupport::COMMON_EVENT_MY_PACKAGE_REPLACED = "usual.event.MY_PACKAGE_REPLACED";
128 /**
129  * Indicate the action of a common event that an installed application has been uninstalled from the device
130  * with the application data remained.
131  * This common event can only be published by the system.
132  */
133 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED";
134 /**
135  * Indicate the action of a common event that an installed application, including both the application data and
136  * code, have been completely uninstalled from the device.
137  * This common event can only be published by the system.
138  */
139 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED";
140 /**
141  * Indicate the action of a common event that an application package has been changed
142  * (for example, a component in the package has been enabled or disabled).
143  * This common event can only be published by the system.
144  */
145 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED";
146 /**
147  * Indicate the action of a common event that the user has restarted the application package and killed all its
148  * processes.
149  * This common event can only be published by the system.
150  */
151 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED";
152 /**
153  * Indicate the action of a common event that the user has cleared the application package data.
154  * This common event is published after COMMON_EVENT_PACKAGE_RESTARTED is triggered and the data has been cleared.
155  * This common event can only be published by the system.
156  */
157 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED";
158 /**
159  * Indicate the action of a common event that application packages have been suspended.
160  * This common event can only be published by the system.
161  */
162 const std::string CommonEventSupport::COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED";
163 /**
164  * Indicate the action of a common event that application packages have not been suspended.
165  * This common event can only be published by the system.
166  */
167 const std::string CommonEventSupport::COMMON_EVENT_PACKAGES_UNSUSPENDED = "usual.event.PACKAGES_UNSUSPENDED";
168 /**
169  * Indicate the action of a common event that an application package has been suspended.
170  * This common event can only be published by the system.
171  */
172 const std::string CommonEventSupport::COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED";
173 /**
174  * Indicate the action of a common event that an application package has not been suspended.
175  * This common event can only be published by the system.
176  */
177 const std::string CommonEventSupport::COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED";
178 /**
179  * Indicate the action of a common event that a user ID has been removed from the system.
180  * This common event can only be published by the system.
181  */
182 const std::string CommonEventSupport::COMMON_EVENT_UID_REMOVED = "usual.event.UID_REMOVED";
183 /**
184  * Indicate the action of a common event that an installed application is started for the first time.
185  * This common event can only be published by the system.
186  */
187 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_FIRST_LAUNCH = "usual.event.PACKAGE_FIRST_LAUNCH";
188 /**
189  * Indicate the action of a common event that an application requires system verification.
190  * This common event can only be published by the system.
191  */
192 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION =
193     "usual.event.PACKAGE_NEEDS_VERIFICATION";
194 /**
195  * Indicate the action of a common event that an application has been verified by the system.
196  * This common event can only be published by the system.
197  */
198 const std::string CommonEventSupport::COMMON_EVENT_PACKAGE_VERIFIED = "usual.event.PACKAGE_VERIFIED";
199 
200 /**
201  * Indicate the action of a common event that applications installed on the external storage become
202  * available for the system.
203  * This common event can only be published by the system.
204  */
205 const std::string CommonEventSupport::COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE =
206     "usual.event.EXTERNAL_APPLICATIONS_AVAILABLE";
207 /**
208  * Indicate the action of a common event that applications installed on the external storage become unavailable for
209  * the system.
210  * This common event can only be published by the system.
211  */
212 const std::string CommonEventSupport::COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE =
213     "usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE";
214 
215 /**
216  * Indicates the action of a common event that the device state (for example, orientation and locale) has changed.
217  * This common event can only be published by the system.
218  */
219 const std::string CommonEventSupport::COMMON_EVENT_CONFIGURATION_CHANGED = "usual.event.CONFIGURATION_CHANGED";
220 /**
221  * Indicate the action of a common event that the device locale has changed.
222  * This common event can only be published by the system.
223  */
224 const std::string CommonEventSupport::COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED";
225 
226 /**
227  * Indicate the action of a common event that the device storage is insufficient.
228  */
229 const std::string CommonEventSupport::COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE";
230 
231 /**
232  * Indicate the action of a common event that the system is in driving mode.
233  * This is a protected common event, which can be sent only by the system.
234  */
235 const std::string CommonEventSupport::COMMON_EVENT_DRIVE_MODE = "common.event.DRIVE_MODE";
236 /**
237  * Indicate the action of a common event that the system is in home mode.
238  * This is a protected common event, which can be sent only by the system.
239  */
240 const std::string CommonEventSupport::COMMON_EVENT_HOME_MODE = "common.event.HOME_MODE";
241 /**
242  * Indicate the action of a common event that the system is in office mode.
243  * This is a protected common event, which can be sent only by the system.
244  */
245 const std::string CommonEventSupport::COMMON_EVENT_OFFICE_MODE = "common.event.OFFICE_MODE";
246 
247 /**
248  * Indicate the action of a common event that the user has been started.
249  */
250 const std::string CommonEventSupport::COMMON_EVENT_USER_STARTED = "usual.event.USER_STARTED";
251 /**
252  * Indicate the action of a common event that the user has been brought to the background.
253  */
254 const std::string CommonEventSupport::COMMON_EVENT_USER_BACKGROUND = "usual.event.USER_BACKGROUND";
255 /**
256  * Indicate the action of a common event that the user has been brought to the foreground.
257  */
258 const std::string CommonEventSupport::COMMON_EVENT_USER_FOREGROUND = "usual.event.USER_FOREGROUND";
259 /**
260  * Indicate the action of a common event that a user switch is happening.
261  * To subscribe to this common event, your application must have the ohos.permission.MANAGE_LOCAL_ACCOUNTS permission.
262  */
263 const std::string CommonEventSupport::COMMON_EVENT_USER_SWITCHED = "usual.event.USER_SWITCHED";
264 /**
265  * Indicate the action of a common event that the user is going to be started.
266  * To subscribe to this common event, your application must have the ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
267  * permission.
268  */
269 const std::string CommonEventSupport::COMMON_EVENT_USER_STARTING = "usual.event.USER_STARTING";
270 /**
271  * Indicate the action of a common event that the credential-encrypted storage has become unlocked
272  * for the current user when the device is unlocked after being restarted.
273  */
274 const std::string CommonEventSupport::COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED";
275 /**
276  * Indicate the action of a common event that the user is going to be stopped.
277  * To subscribe to this common event, your application must have the ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
278  * permission.
279  */
280 const std::string CommonEventSupport::COMMON_EVENT_USER_STOPPING = "usual.event.USER_STOPPING";
281 /**
282  * Indicate the action of a common event that the user has been stopped.
283  */
284 const std::string CommonEventSupport::COMMON_EVENT_USER_STOPPED = "usual.event.USER_STOPPED";
285 /**
286  * Indicate the action of a common event about a login of a user with account ID.
287  * This is a protected common event, which can be sent only by the system.
288  */
289 const std::string CommonEventSupport::COMMON_EVENT_HWID_LOGIN = "common.event.HWID_LOGIN";
290 /**
291  * Indicate the action of a common event about a logout of a user with account ID.
292  * This is a protected common event, which can be sent only by the system.
293  */
294 const std::string CommonEventSupport::COMMON_EVENT_HWID_LOGOUT = "common.event.HWID_LOGOUT";
295 /**
296  * Indicate the action of a common event that the account ID is invalid.
297  * This is a protected common event, which can be sent only by the system.
298  */
299 const std::string CommonEventSupport::COMMON_EVENT_HWID_TOKEN_INVALID = "common.event.HWID_TOKEN_INVALID";
300 
301 /**
302  * Indicate the action of a common event about a logoff of an account ID.
303  * This is a protected common event, which can be sent only by the system.
304  */
305 const std::string CommonEventSupport::COMMON_EVENT_HWID_LOGOFF = "common.event.HWID_LOGOFF";
306 
307 /**
308  * Indicate the action of a common event about the Wi-Fi state, such as enabled and disabled.
309  */
310 const std::string CommonEventSupport::COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE";
311 
312 /**
313  * Indicate the action of a common event that the Wi-Fi access point has been scanned and proven to be available.
314  * To subscribe to this common event, your application must have the ohos.permission.LOCATION permission.
315  */
316 const std::string CommonEventSupport::COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED";
317 
318 /**
319  * Indicate the action of a common event that the Wi-Fi signal strength (RSSI) has changed.
320  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
321  */
322 const std::string CommonEventSupport::COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE";
323 
324 /**
325  * Indicate the action of a common event that the Wi-Fi connection state has changed.
326  */
327 const std::string CommonEventSupport::COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE";
328 
329 /**
330  * Indicate the action of a common event about the Wi-Fi hotspot state, such as enabled or disabled.
331  */
332 const std::string CommonEventSupport::COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE";
333 
334 /**
335  * Indicates the action of a common event that a client has joined the Wi-Fi hotspot of the current device. You can
336  * register this common event to listen for information about the clients joining your hotspot.
337  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
338  */
339 const std::string CommonEventSupport::COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN";
340 
341 /**
342  * Indicates the action of a common event that a client has dropped connection to the Wi-Fi hotspot of the current
343  * device. You can register this common event to listen for information about the clients leaving your hotspot.
344  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
345  */
346 const std::string CommonEventSupport::COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE";
347 
348 /**
349  * Indicate the action of a common event that the state of MPLink (an enhanced Wi-Fi feature) has changed.
350  * To subscribe to this common event, your application must have the ohos.permission.MPLINK_CHANGE_STATE permission.
351  */
352 const std::string CommonEventSupport::COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE";
353 
354 /**
355  * Indicate the action of a common event that the Wi-Fi P2P connection state has changed.
356  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO and
357  * ohos.permission.LOCATION permissions.
358  */
359 const std::string CommonEventSupport::COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE";
360 
361 /**
362  * Indicate the action of a common event about the Wi-Fi P2P state, such as enabled and disabled.
363  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
364  */
365 const std::string CommonEventSupport::COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE";
366 
367 /**
368  * Indicate that the Wi-Fi P2P peers state change.
369  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
370  */
371 const std::string CommonEventSupport::COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = "usual.event.wifi.p2p.DEVICES_CHANGE";
372 
373 /**
374  * Indicate that the Wi-Fi P2P discovery state change.
375  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
376  */
377 const std::string CommonEventSupport::COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED =
378     "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE";
379 
380 /**
381  * Indicate that the Wi-Fi P2P current device state change.
382  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
383  */
384 const std::string CommonEventSupport::COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED =
385     "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE";
386 
387 /**
388  * Indicate that the Wi-Fi P2P group info is changed.
389  * To subscribe to this common event, your application must have the ohos.permission.GET_WIFI_INFO permission.
390  */
391 const std::string CommonEventSupport::COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED =
392     "usual.event.wifi.p2p.GROUP_STATE_CHANGED";
393 
394 /**
395  * Indicate the action of a common event about the connection state of Bluetooth handsfree communication.
396  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
397  */
398 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE =
399     "usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE";
400 
401 /**
402  * Indicate the action of a common event that the device connected to the Bluetooth handsfree is active.
403  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
404  */
405 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE =
406     "usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE";
407 
408 /**
409  * Indicate the action of a common event that the connection state of Bluetooth A2DP has changed.
410  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
411  */
412 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE =
413     "usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE";
414 
415 /**
416  * Indicate the action of a common event about the connection state of Bluetooth A2DP.
417  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
418  */
419 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE =
420     "usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE";
421 
422 /**
423  * Indicate the action of a common event that the device connected using Bluetooth A2DP is active.
424  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
425  */
426 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE =
427     "usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE";
428 
429 /**
430  * Indicate the action of a common event that the playing state of Bluetooth A2DP has changed.
431  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
432  */
433 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE =
434     "usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE";
435 
436 /**
437  * Indicate the action of a common event that the AVRCP connection state of Bluetooth A2DP has changed.
438  */
439 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE =
440     "usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE";
441 
442 /**
443  * Indicate the action of a common event that the audio codec state of Bluetooth A2DP has changed.
444  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
445  */
446 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE =
447     "usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE";
448 
449 /**
450  * Indicate the action of a common event that a remote Bluetooth device has been discovered.
451  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH and
452  * ohos.permission.LOCATION permissions.
453  */
454 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED =
455     "usual.event.bluetooth.remotedevice.DISCOVERED";
456 
457 /**
458  * Indicate the action of a common event that the Bluetooth class of a remote Bluetooth device has changed.
459  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
460  */
461 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE =
462     "usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE";
463 
464 /**
465  * Indicate the action of a common event that a low level (ACL) connection has been established with a remote
466  * Bluetooth device.
467  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
468  */
469 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED =
470     "usual.event.bluetooth.remotedevice.ACL_CONNECTED";
471 
472 /**
473  * Indicate the action of a common event that a low level (ACL) connection has been disconnected from a remote
474  * Bluetooth device.
475  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
476  */
477 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED =
478     "usual.event.bluetooth.remotedevice.ACL_DISCONNECTED";
479 
480 /**
481  * Indicate the action of a common event that the friendly name of a remote Bluetooth device has been retrieved for
482  * the first time or has been changed since the last retrieval.
483  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
484  */
485 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE =
486     "usual.event.bluetooth.remotedevice.NAME_UPDATE";
487 
488 /**
489  * Indicate the action of a common event that the connection state of a remote Bluetooth device has changed.
490  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
491  */
492 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE =
493     "usual.event.bluetooth.remotedevice.PAIR_STATE";
494 
495 /**
496  * Indicate the action of a common event that the battery level of a remote Bluetooth device has been retrieved
497  * for the first time or has been changed since the last retrieval.
498  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
499  */
500 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE =
501     "usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE";
502 
503 /**
504  * Indicate the action of a common event about the SDP state of a remote Bluetooth device.
505  */
506 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT =
507     "usual.event.bluetooth.remotedevice.SDP_RESULT";
508 
509 /**
510  * Indicate the action of a common event about the UUID connection state of a remote Bluetooth device.
511  * To subscribe to this common event, your application must have the ohos.permission.DISCOVER_BLUETOOTH permission.
512  */
513 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE =
514     "usual.event.bluetooth.remotedevice.UUID_VALUE";
515 
516 /**
517  * Indicate the action of a common event about the pairing request from a remote Bluetooth device.
518  * To subscribe to this common event, your application must have the ohos.permission.DISCOVER_BLUETOOTH permission.
519  */
520 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ =
521     "usual.event.bluetooth.remotedevice.PAIRING_REQ";
522 
523 /**
524  * Indicate the action of a common event that Bluetooth pairing is canceled.
525  */
526 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL =
527     "usual.event.bluetooth.remotedevice.PAIRING_CANCEL";
528 
529 /**
530  * Indicate the action of a common event about the connection request from a remote Bluetooth device.
531  */
532 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ =
533     "usual.event.bluetooth.remotedevice.CONNECT_REQ";
534 
535 /**
536  * Indicate the action of a common event about the response to the connection request from a remote Bluetooth
537  * device.
538  */
539 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY =
540     "usual.event.bluetooth.remotedevice.CONNECT_REPLY";
541 
542 /**
543  * Indicate the action of a common event that the connection to a remote Bluetooth device has been canceled.
544  */
545 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL =
546     "usual.event.bluetooth.remotedevice.CONNECT_CANCEL";
547 
548 /**
549  * Indicate the action of a common event that the connection state of a Bluetooth handsfree has changed.
550  */
551 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE =
552     "usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE";
553 
554 /**
555  * Indicate the action of a common event that the audio state of a Bluetooth handsfree has changed.
556  */
557 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE =
558     "usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE";
559 
560 /**
561  * Indicate the action of a common event that the audio gateway state of a Bluetooth handsfree has changed.
562  */
563 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT =
564     "usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT";
565 
566 /**
567  * Indicate the action of a common event that the calling state of a Bluetooth handsfree has changed.
568  */
569 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE =
570     "usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE";
571 
572 /**
573  * Indicate the action of a common event that the state of a Bluetooth adapter has been changed, for example,
574  * Bluetooth has been turned on or off.
575  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
576  */
577 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE =
578     "usual.event.bluetooth.host.STATE_UPDATE";
579 
580 /**
581  * Indicate the action of a common event about the requests for the user to allow Bluetooth to be scanned.
582  */
583 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE =
584     "usual.event.bluetooth.host.REQ_DISCOVERABLE";
585 
586 /**
587  * Indicate the action of a common event about the requests for the user to turn on Bluetooth.
588  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
589  */
590 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE = "usual.event.bluetooth.host.REQ_ENABLE";
591 
592 /**
593  * Indicate the action of a common event about the requests for the user to turn off Bluetooth.
594  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
595  */
596 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE =
597     "usual.event.bluetooth.host.REQ_DISABLE";
598 
599 /**
600  * Indicate the action of a common event that the Bluetooth scanning mode of a device has changed.
601  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
602  */
603 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE =
604     "usual.event.bluetooth.host.SCAN_MODE_UPDATE";
605 
606 /**
607  * Indicate the action of a common event that the Bluetooth scanning has been started on the device.
608  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
609  */
610 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED =
611     "usual.event.bluetooth.host.DISCOVERY_STARTED";
612 
613 /**
614  * Indicate the action of a common event that the Bluetooth scanning is finished on the device.
615  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
616  */
617 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED =
618     "usual.event.bluetooth.host.DISCOVERY_FINISHED";
619 
620 /**
621  * Indicate the action of a common event that the Bluetooth adapter name of the device has changed.
622  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
623  */
624 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE =
625     "usual.event.bluetooth.host.NAME_UPDATE";
626 
627 /**
628  * Indicate the action of a common event that the connection state of Bluetooth A2DP Sink has changed.
629  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
630  */
631 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE =
632     "usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE";
633 
634 /**
635  * Indicate the action of a common event that the playing state of Bluetooth A2DP Sink has changed.
636  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
637  */
638 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE =
639     "usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE";
640 
641 /**
642  * Indicate the action of a common event that the audio state of Bluetooth A2DP Sink has changed.
643  * To subscribe to this common event, your application must have the ohos.permission.USE_BLUETOOTH permission.
644  */
645 const std::string CommonEventSupport::COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE =
646     "usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE";
647 
648 /**
649  * Indicate the action of a common event that the state of the device NFC adapter has changed.
650  * This is a protected common event, which can be sent only by the system.
651  */
652 const std::string CommonEventSupport::COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED =
653     "usual.event.nfc.action.ADAPTER_STATE_CHANGED";
654 
655 /**
656  * Indicate the action of a common event that the NFC RF field is detected to be in the enabled state.
657  * To subscribe to this common event, your application must have the ohos.permission.MANAGE_SECURE_SETTINGS
658  * permission.
659  * This is a protected common event, which can be sent only by the system.
660  */
661 const std::string CommonEventSupport::COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED =
662     "usual.event.nfc.action.RF_FIELD_ON_DETECTED";
663 
664 /**
665  * Indicate the action of a common event that the NFC RF field is detected to be in the disabled state.
666  * To subscribe to this common event, your application must have the ohos.permission.MANAGE_SECURE_SETTINGS
667  * permission.
668  * This is a protected common event, which can be sent only by the system.
669  */
670 const std::string CommonEventSupport::COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED =
671     "usual.event.nfc.action.RF_FIELD_OFF_DETECTED";
672 
673 /**
674  * Indicate the action of a common event that the system stops charging the battery.
675  * This is a protected common event, which can be sent only by the system.
676  */
677 const std::string CommonEventSupport::COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING";
678 
679 /**
680  * Indicate the action of a common event that the system starts charging the battery.
681  * This is a protected common event, which can be sent only by the system.
682  */
683 const std::string CommonEventSupport::COMMON_EVENT_CHARGING = "usual.event.CHARGING";
684 
685 /**
686  * Indicate the action of a common event that the system idle mode has changed.
687  * This is a protected common event, which can be sent only by the system.
688  */
689 const std::string CommonEventSupport::COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED";
690 
691 /**
692  * Indicate the action of a common event that the power save mode of the system has changed.
693  * This is a protected common event, which can be sent only by the system.
694  */
695 const std::string CommonEventSupport::COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED";
696 
697 /**
698  * Indicate the action of a common event that a user has been added to the system.
699  * To subscribe to this common event, your application must have the ohos.permission.MANAGE_LOCAL_ACCOUNTS permission.
700  */
701 const std::string CommonEventSupport::COMMON_EVENT_USER_ADDED = "usual.event.USER_ADDED";
702 /**
703  * Indicate the action of a common event that a user has been removed from the system.
704  * To subscribe to this common event, your application must have the ohos.permission.MANAGE_LOCAL_ACCOUNTS permission.
705  */
706 const std::string CommonEventSupport::COMMON_EVENT_USER_REMOVED = "usual.event.USER_REMOVED";
707 
708 /**
709  * Indicate the action of a common event that an ability has been added.
710  * To subscribe to this common event, your application must have the ohos.permission.LISTEN_BUNDLE_CHANGE
711  * permission.
712  * This is a protected common event, which can be sent only by the system.
713  */
714 const std::string CommonEventSupport::COMMON_EVENT_ABILITY_ADDED = "common.event.ABILITY_ADDED";
715 
716 /**
717  * Indicate the action of a common event that an ability has been removed.
718  * To subscribe to this common event, your application must have the ohos.permission.LISTEN_BUNDLE_CHANGE
719  * permission.
720  * This is a protected common event, which can be sent only by the system.
721  */
722 const std::string CommonEventSupport::COMMON_EVENT_ABILITY_REMOVED = "common.event.ABILITY_REMOVED";
723 
724 /**
725  * Indicate the action of a common event that an ability has been updated.
726  * To subscribe to this common event, your application must have the ohos.permission.LISTEN_BUNDLE_CHANGE
727  * permission.
728  * This is a protected common event, which can be sent only by the system.
729  */
730 const std::string CommonEventSupport::COMMON_EVENT_ABILITY_UPDATED = "common.event.ABILITY_UPDATED";
731 
732 /**
733  * Indicate the action of a common event that the location mode of the system has changed.
734  * This is a protected common event, which can be sent only by the system.
735  */
736 const std::string CommonEventSupport::COMMON_EVENT_LOCATION_MODE_STATE_CHANGED =
737     "usual.event.location.MODE_STATE_CHANGED";
738 
739 /**
740  * Indicate the action of a common event that the in-vehicle infotainment (IVI) system of a vehicle is sleeping.
741  * This is a protected common event, which can be sent only by the system.
742  */
743 const std::string CommonEventSupport::COMMON_EVENT_IVI_SLEEP = "common.event.IVI_SLEEP";
744 
745 /**
746  * The ivi is slept and notify the app stop playing.
747  * This is a protected common event that can only be sent by system.
748  */
749 const std::string CommonEventSupport::COMMON_EVENT_IVI_PAUSE = "common.event.IVI_PAUSE";
750 
751 /**
752  * Indicate the action of a common event that a third-party application is instructed to pause the current work.
753  * This is a protected common event, which can be sent only by the system.
754  */
755 const std::string CommonEventSupport::COMMON_EVENT_IVI_STANDBY = "common.event.IVI_STANDBY";
756 
757 /**
758  * Indicate the action of a common event that a third-party application is instructed to save its last mode.
759  * This is a protected common event, which can be sent only by the system.
760  */
761 const std::string CommonEventSupport::COMMON_EVENT_IVI_LASTMODE_SAVE = "common.event.IVI_LASTMODE_SAVE";
762 
763 /**
764  * Indicate the action of a common event that the voltage of the vehicle power system is abnormal.
765  * This is a protected common event, which can be sent only by the system.
766  */
767 const std::string CommonEventSupport::COMMON_EVENT_IVI_VOLTAGE_ABNORMAL = "common.event.IVI_VOLTAGE_ABNORMAL";
768 
769 /**
770  * The ivi temperature is too high.
771  * This is a protected common event that can only be sent by system.
772  * This common event will be delete later, please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL.
773  */
774 const std::string CommonEventSupport::COMMON_EVENT_IVI_HIGH_TEMPERATURE = "common.event.IVI_HIGH_TEMPERATURE";
775 
776 /**
777  * The ivi temperature is extreme high.
778  * This is a protected common event that can only be sent by system.
779  * This common event will be delete later, please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL.
780  */
781 const std::string CommonEventSupport::COMMON_EVENT_IVI_EXTREME_TEMPERATURE = "common.event.IVI_EXTREME_TEMPERATURE";
782 
783 /**
784  * Indicate the action of a common event that the in-vehicle system has an extreme temperature.
785  * This is a protected common event, which can be sent only by the system.
786  */
787 const std::string CommonEventSupport::COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL = "common.event.IVI_TEMPERATURE_ABNORMAL";
788 
789 /**
790  * Indicate the action of a common event that the voltage of the vehicle power system is restored to normal.
791  * This is a protected common event, which can be sent only by the system.
792  */
793 const std::string CommonEventSupport::COMMON_EVENT_IVI_VOLTAGE_RECOVERY = "common.event.IVI_VOLTAGE_RECOVERY";
794 
795 /**
796  * Indicate the action of a common event that the temperature of the in-vehicle system is restored to normal.
797  * This is a protected common event, which can be sent only by the system.
798  */
799 const std::string CommonEventSupport::COMMON_EVENT_IVI_TEMPERATURE_RECOVERY = "common.event.IVI_TEMPERATURE_RECOVERY";
800 
801 /**
802  * Indicate the action of a common event that the battery service is active.
803  * This is a protected common event, which can be sent only by the system.
804  */
805 const std::string CommonEventSupport::COMMON_EVENT_IVI_ACTIVE = "common.event.IVI_ACTIVE";
806 
807 /**
808  * The usb state changed.
809  * This is a protected common event that can only be sent by system.
810  */
811 const std::string CommonEventSupport::COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE";
812 
813 /**
814  * The usb port changed.
815  * This is a protected common event that can only be sent by system.
816  */
817 const std::string CommonEventSupport::COMMON_EVENT_USB_PORT_CHANGED =
818     "usual.event.hardware.usb.action.USB_PORT_CHANGED";
819 
820 /**
821  * Indicate the action of a common event that a USB device has been attached when the user device functions as a USB
822  * host.
823  * This is a protected common event, which can be sent only by the system.
824  */
825 const std::string CommonEventSupport::COMMON_EVENT_USB_DEVICE_ATTACHED =
826     "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED";
827 
828 /**
829  * Indicate the action of a common event that a USB device has been detached when the user device functions as a USB
830  * host.
831  * This is a protected common event, which can be sent only by the system.
832  */
833 const std::string CommonEventSupport::COMMON_EVENT_USB_DEVICE_DETACHED =
834     "usual.event.hardware.usb.action.USB_DEVICE_DETACHED";
835 
836 /**
837  * Indicate the action of a common event that a USB accessory has been attached.
838  * This is a protected common event, which can be sent only by the system.
839  */
840 const std::string CommonEventSupport::COMMON_EVENT_USB_ACCESSORY_ATTACHED =
841     "usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED";
842 
843 /**
844  * Indicate the action of a common event that a USB accessory has been detached.
845  * This is a protected common event, which can be sent only by the system.
846  */
847 const std::string CommonEventSupport::COMMON_EVENT_USB_ACCESSORY_DETACHED =
848     "usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED";
849 
850 /**
851  * The storage space is low.
852  * This is a protected common event that can only be sent by system.
853  */
854 const std::string CommonEventSupport::COMMON_EVENT_DEVICE_STORAGE_LOW = "usual.event.DEVICE_STORAGE_LOW";
855 
856 /**
857  * The storage space is normal.
858  * This is a protected common event that can only be sent by system.
859  */
860 const std::string CommonEventSupport::COMMON_EVENT_DEVICE_STORAGE_OK = "usual.event.DEVICE_STORAGE_OK";
861 
862 /**
863  * The storage space is full.
864  * This is a protected common event that can only be sent by system.
865  */
866 const std::string CommonEventSupport::COMMON_EVENT_DEVICE_STORAGE_FULL = "usual.event.DEVICE_STORAGE_FULL";
867 
868 /**
869  * The network connection was changed.
870  * This is a protected common event that can only be sent by system.
871  */
872 const std::string CommonEventSupport::COMMON_EVENT_CONNECTIVITY_CHANGE = "usual.event.CONNECTIVITY_CHANGE";
873 
874 /**
875  * Indicate the action of a common event that an external storage device was removed.
876  * To subscribe to this common event, your application must have the ohos.permission.WRITE_USER_STORAGE or
877  * ohos.permission.READ_USER_STORAGE permission.
878  * This common event can be published only by system applications.
879  */
880 const std::string CommonEventSupport::COMMON_EVENT_DISK_REMOVED = "usual.event.data.DISK_REMOVED";
881 
882 /**
883  * Indicate the action of a common event that an external storage device was unmounted.
884  * To subscribe to this common event, your application must have the ohos.permission.WRITE_USER_STORAGE or
885  * ohos.permission.READ_USER_STORAGE permission.
886  * This common event can be published only by system applications.
887  */
888 const std::string CommonEventSupport::COMMON_EVENT_DISK_UNMOUNTED = "usual.event.data.DISK_UNMOUNTED";
889 
890 /**
891  * Indicate the action of a common event that an external storage device was mounted.
892  * To subscribe to this common event, your application must have the ohos.permission.WRITE_USER_STORAGE or
893  * ohos.permission.READ_USER_STORAGE permission.
894  * This common event can be published only by system applications.
895  */
896 const std::string CommonEventSupport::COMMON_EVENT_DISK_MOUNTED = "usual.event.data.DISK_MOUNTED";
897 
898 /**
899  * Indicate the action of a common event that an external storage device was removed without being unmounted.
900  * To subscribe to this common event, your application must have the ohos.permission.WRITE_USER_STORAGE or
901  * ohos.permission.READ_USER_STORAGE permission.
902  * This common event can be published only by system applications.
903  */
904 const std::string CommonEventSupport::COMMON_EVENT_DISK_BAD_REMOVAL = "usual.event.data.DISK_BAD_REMOVAL";
905 
906 /**
907  * Indicate the action of a common event that an external storage device becomes unmountable.
908  * To subscribe to this common event, your application must have the ohos.permission.WRITE_USER_STORAGE or
909  * ohos.permission.READ_USER_STORAGE permission.
910  * This common event can be published only by system applications.
911  */
912 const std::string CommonEventSupport::COMMON_EVENT_DISK_UNMOUNTABLE = "usual.event.data.DISK_UNMOUNTABLE";
913 
914 /**
915  * Indicate the action of a common event that an external storage device was ejected.
916  * To subscribe to this common event, your application must have the ohos.permission.WRITE_USER_STORAGE or
917  * ohos.permission.READ_USER_STORAGE permission.
918  * This common event can be published only by system applications.
919  */
920 const std::string CommonEventSupport::COMMON_EVENT_DISK_EJECT = "usual.event.data.DISK_EJECT";
921 
922 /**
923  * Indicate the action of a common event that the account visible changed.
924  * To subscribe to this common event, your application must have the ohos.permission.GET_APP_ACCOUNTS permission.
925  * This is a protected common event, which can be sent only by the system.
926  */
927 const std::string CommonEventSupport::COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED =
928     "usual.event.data.VISIBLE_ACCOUNTS_UPDATED";
929 
930 /**
931  * Indicate the action of a common event that the account is deleted.
932  * To subscribe to this common event, your application must have the ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
933  * permission.
934  * This is a protected common event, which can be sent only by the system.
935  */
936 const std::string CommonEventSupport::COMMON_EVENT_ACCOUNT_DELETED = "usual.event.data.ACCOUNT_DELETED";
937 
938 /**
939  * Indicate the action of a common event that the foundation is ready.
940  * To subscribe to this common event, your application must have the ohos.permission.RECEIVER_STARTUP_COMPLETED
941  * permission.
942  * This is a protected common event, which can be sent only by the system.
943  */
944 const std::string CommonEventSupport::COMMON_EVENT_FOUNDATION_READY = "common.event.FOUNDATION_READY";
945 
946 /**
947  * Indicates the action of a common event that the phone SIM card state has changed.
948  * This is a protected common event that can only be sent by system.
949  */
950 const std::string CommonEventSupport::COMMON_EVENT_SIM_CARD_DEFAULT_VOICE_SUBSCRIPTION_CHANGED =
951     "usual.event.SIM.DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
952 
953 /**
954  * Indicates the action of a common event that the phone SIM card state has changed.
955  * This is a protected common event that can only be sent by system.
956  */
957 const std::string CommonEventSupport::COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM.CARD_STATE_CHANGED";
958 
959 /**
960  * Indicate the action of a common event that the airplane mode of the device has changed.
961  * This common event can be triggered only by system applications.
962  */
963 const std::string CommonEventSupport::COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE";
964 
965 /**
966  * Only for test case.
967  */
968 const std::string CommonEventSupport::COMMON_EVENT_TEST_ACTION1 = "usual.event.test1";
969 
970 /**
971  * Only for test case.
972  */
973 const std::string CommonEventSupport::COMMON_EVENT_TEST_ACTION2 = "usual.event.test2";
974 
CommonEventSupport()975 CommonEventSupport::CommonEventSupport()
976 {
977     Init();
978 }
979 
~CommonEventSupport()980 CommonEventSupport::~CommonEventSupport()
981 {}
982 
Init()983 void CommonEventSupport::Init()
984 {
985     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_USER_PRESENT);
986     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_ADDED);
987     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_REPLACED);
988     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_REMOVED);
989     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_FULLY_REMOVED);
990     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_CHANGED);
991     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_RESTARTED);
992     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_DATA_CLEARED);
993     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGES_SUSPENDED);
994     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGES_UNSUSPENDED);
995     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_FIRST_LAUNCH);
996     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION);
997     commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_PACKAGE_VERIFIED);
998     return;
999 }
1000 
IsSystemEvent(std::string & str)1001 bool CommonEventSupport::IsSystemEvent(std::string& str)
1002 {
1003     return true;
1004 }
1005 } // namespace EventFwk
1006 } // namespace OHOS