• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-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 */
15import { AsyncCallback } from './basic';
16import { CommonEventData } from './commonEvent/commonEventData';
17import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber';
18import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo';
19import { CommonEventPublishData } from './commonEvent/commonEventPublishData';
20
21/**
22 * the definition for commonevent
23 * @name commonEvent
24 * @since 7
25 * @syscap SystemCapability.Notification.CommonEvent
26 * @permission N/A
27 */
28declare namespace commonEvent {
29  /**
30   * Publishes an ordered, sticky, or standard common event.
31   *
32   * @since 7
33   * @param event name of the common event.
34   * @param callback Specified callback method.
35   * @return -
36   */
37  function publish(event: string, callback: AsyncCallback<void>): void;
38
39  /**
40   * Publishes an ordered, sticky, or standard common event.
41   *
42   * @since 7
43   * @param event name of the common event.
44   * @param options Indicate the CommonEventPublishData containing the common event content and attributes.
45   * @param callback Specified callback method.
46   * @return -
47   */
48  function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback<void>): void;
49
50
51  /**
52   * create the CommonEventSubscriber for the SubscribeInfo.
53   *
54   * @since 7
55   * @param subscribeInfo Indicate the information of the subscriber.
56   * @param callback Specified callback method.
57   * @return -
58   */
59  function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback<CommonEventSubscriber>): void;
60
61  /**
62   * create the CommonEventSubscriber for the SubscribeInfo.
63   *
64   * @since 7
65   * @param subscribeInfo Indicate the information of the subscriber.
66   * @return Returns common event subscriber object
67   */
68  function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise<CommonEventSubscriber>;
69
70  /**
71   * subscribe an ordered, sticky, or standard common event.
72   *
73   * @since 7
74   * @param subscriber Indicate the subscriber of the common event.
75   * @param callback Specified callback method.
76   * @return -
77   */
78  function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback<CommonEventData>): void;
79
80  /**
81   * unsubscribe an ordered, sticky, or standard common event.
82   *
83   * @since 7
84   * @param subscriber Indicate the subscriber of the common event.
85   * @param callback Specified callback method.
86   * @return -
87   */
88  function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback<void>): void;
89
90  /**
91   * the event type that the commonEvent supported
92   * @name Support
93   * @since 7
94   * @permission N/A
95   */
96  export enum Support {
97    /**
98     * this commonEvent means when the device is booted or system upgrade completed, and only be sent by system.
99     */
100    COMMON_EVENT_BOOT_COMPLETED = "usual.event.BOOT_COMPLETED",
101
102    /**
103     * this commonEvent means when the device finnish booting, but still in the locked state.
104     */
105    COMMON_EVENT_LOCKED_BOOT_COMPLETED = "usual.event.LOCKED_BOOT_COMPLETED",
106
107    /**
108     * this commonEvent means when the device is shutting down, note: turn off, not sleeping.
109     */
110    COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN",
111
112    /**
113     * this commonEvent means when the charging state, level and so on about the battery.
114     */
115    COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED",
116
117    /**
118     * this commonEvent means when the device in low battery state..
119     */
120    COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW",
121
122    /**
123     * this commonEvent means when the battery level is an ok state.
124     */
125    COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY",
126
127    /**
128     * this commonEvent means when the other power is connected to the device.
129     */
130    COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED",
131
132    /**
133     * this commonEvent means when the other power is removed from the device.
134     */
135    COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED",
136
137    /**
138     * this commonEvent means when the screen is turned off.
139     */
140    COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF",
141
142    /**
143     * this commonEvent means when the device is waked up and interactive.
144     */
145    COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON",
146
147    /**
148     * this commonEvent means when the thermal state level change
149     * @since 8
150     */
151    COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED",
152
153    /**
154     * this commonEvent means when the user is present after the device waked up.
155     */
156    COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT",
157
158    /**
159     * this commonEvent means when the current time is changed.
160     */
161    COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK",
162
163    /**
164     * this commonEvent means when the time is set.
165     */
166    COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED",
167
168    /**
169     * this commonEvent means when the current date is changed.
170     */
171    COMMON_EVENT_DATE_CHANGED = "usual.event.DATE_CHANGED",
172
173    /**
174     * this commonEvent means when the time zone is changed.
175     */
176    COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED",
177
178    /**
179     * this commonEvent means when the dialog to dismiss.
180     */
181    COMMON_EVENT_CLOSE_SYSTEM_DIALOGS = "usual.event.CLOSE_SYSTEM_DIALOGS",
182
183    /**
184     * this commonEvent means when a new application package is installed on the device.
185     */
186    COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED",
187
188    /**
189     * this commonEvent means when a new version application package is installed on the device and
190     * replace the old version.the data contains the name of the package.
191     */
192    COMMON_EVENT_PACKAGE_REPLACED = "usual.event.PACKAGE_REPLACED",
193
194    /**
195     * this commonEvent means when a new version application package is installed on the device and
196     * replace the old version, it does not contain additional data and only be sent to the replaced application.
197     */
198    COMMON_EVENT_MY_PACKAGE_REPLACED = "usual.event.MY_PACKAGE_REPLACED",
199
200    /**
201     * this commonEvent means when an existing application package is removed from the device.
202     */
203    COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED",
204
205    /**
206     * this commonEvent means when an existing application package is removed from the device.
207     */
208    COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED",
209
210    /**
211     * this commonEvent means when an existing application package is completely removed from the device.
212     */
213    COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED",
214
215    /**
216     * this commonEvent means when an existing application package has been changed.
217     */
218    COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED",
219
220    /**
221     * this commonEvent means the user has restarted a package, and all of its processes have been killed.
222     */
223    COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED",
224
225    /**
226     * this commonEvent means the user has cleared the package data.
227     */
228    COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED",
229
230    /**
231     * this commonEvent means the user has cleared the package cache.
232     * since 9
233     */
234    COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED",
235
236    /**
237     * this commonEvent means the packages have been suspended.
238     */
239    COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED",
240
241    /**
242     * this commonEvent means the packages have been un-suspended.
243     */
244    COMMON_EVENT_PACKAGES_UNSUSPENDED = "usual.event.PACKAGES_UNSUSPENDED",
245
246    /**
247     * this commonEvent Sent to a package that has been suspended by the system.
248     */
249    COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED",
250
251    /**
252     * Sent to a package that has been un-suspended.
253     */
254    COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED",
255
256    /**
257     * a user id has been removed from the system.
258     */
259    COMMON_EVENT_UID_REMOVED = "usual.event.UID_REMOVED",
260
261    /**
262     * the application is first launched after installed.
263     */
264    COMMON_EVENT_PACKAGE_FIRST_LAUNCH = "usual.event.PACKAGE_FIRST_LAUNCH",
265
266    /**
267     * sent by system package verifier when a package need to be verified.
268     */
269    COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION =
270        "usual.event.PACKAGE_NEEDS_VERIFICATION",
271
272    /**
273     * sent by system package verifier when a package is verified.
274     */
275    COMMON_EVENT_PACKAGE_VERIFIED = "usual.event.PACKAGE_VERIFIED",
276
277    /**
278     * Resources for a set of packages (which were previously unavailable) are currently
279     * available since the media on which they exist is available.
280     */
281    COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE =
282        "usual.event.EXTERNAL_APPLICATIONS_AVAILABLE",
283
284    /**
285     * Resources for a set of packages are currently unavailable since the media on which they exist is unavailable.
286     */
287    COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE =
288        "usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE",
289
290    /**
291     * the device configuration such as orientation,locale have been changed.
292     */
293    COMMON_EVENT_CONFIGURATION_CHANGED = "usual.event.CONFIGURATION_CHANGED",
294
295    /**
296     * The current device's locale has changed.
297     */
298    COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED",
299
300    /**
301     *  Indicates low memory condition notification acknowledged by user and package management should be started.
302     */
303    COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE",
304
305    /**
306     * sent by the smart function when the system in drive mode.
307     */
308    COMMON_EVENT_DRIVE_MODE = "common.event.DRIVE_MODE",
309
310    /**
311     * sent by the smart function when the system in home mode.
312     */
313    COMMON_EVENT_HOME_MODE = "common.event.HOME_MODE",
314
315    /**
316     * sent by the smart function when the system in office mode.
317     */
318    COMMON_EVENT_OFFICE_MODE = "common.event.OFFICE_MODE",
319
320    /**
321     * remind new user of preparing to start.
322     */
323    COMMON_EVENT_USER_STARTED = "usual.event.USER_STARTED",
324
325    /**
326     * remind previous user of that the service has been the background.
327     */
328    COMMON_EVENT_USER_BACKGROUND = "usual.event.USER_BACKGROUND",
329
330    /**
331     * remind new user of that the service has been the foreground.
332     */
333    COMMON_EVENT_USER_FOREGROUND = "usual.event.USER_FOREGROUND",
334
335    /**
336     * remind new user of that the service has been switched to new user.
337     */
338    COMMON_EVENT_USER_SWITCHED = "usual.event.USER_SWITCHED",
339
340    /**
341     * remind new user of that the service has been starting.
342     */
343    COMMON_EVENT_USER_STARTING = "usual.event.USER_STARTING",
344
345    /**
346     * remind new user of that the service has been unlocked.
347     */
348    COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED",
349
350    /**
351     * remind new user of that the service has been stopping.
352     */
353    COMMON_EVENT_USER_STOPPING = "usual.event.USER_STOPPING",
354
355    /**
356     * remind new user of that the service has stopped.
357     */
358    COMMON_EVENT_USER_STOPPED = "usual.event.USER_STOPPED",
359
360    /**
361     * HW id login successfully.
362     */
363    COMMON_EVENT_HWID_LOGIN = "common.event.HWID_LOGIN",
364
365    /**
366     * HW id logout successfully.
367     */
368    COMMON_EVENT_HWID_LOGOUT = "common.event.HWID_LOGOUT",
369
370    /**
371     * HW id is invalid.
372     */
373    COMMON_EVENT_HWID_TOKEN_INVALID = "common.event.HWID_TOKEN_INVALID",
374
375    /**
376     * HW id logs off.
377     */
378    COMMON_EVENT_HWID_LOGOFF = "common.event.HWID_LOGOFF",
379
380    /**
381     * WIFI state.
382     */
383    COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE",
384
385    /**
386     * WIFI scan results.
387     */
388    COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED",
389
390    /**
391     * WIFI RSSI change.
392     */
393    COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE",
394
395    /**
396     * WIFI connect state.
397     */
398    COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE",
399
400    /**
401     * WIFI hotspot state.
402     */
403    COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE",
404
405    /**
406     * WIFI ap sta join.
407     */
408    COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN",
409
410    /**
411     * WIFI ap sta join.
412     */
413    COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE",
414
415    /**
416     * Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink.
417     */
418    COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE",
419
420    /**
421     * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnecting P2P.
422     */
423    COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE",
424
425    /**
426     * Indicates that the Wi-Fi P2P state change.
427     */
428    COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE",
429
430    /**
431     * Indicates that the Wi-Fi P2P peers state change.
432     */
433    COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED =
434        "usual.event.wifi.p2p.DEVICES_CHANGE",
435
436    /**
437     * Indicates that the Wi-Fi P2P discovery state change.
438     */
439    COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED =
440        "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE",
441
442    /**
443     * Indicates that the Wi-Fi P2P current device state change.
444     */
445    COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED =
446        "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE",
447
448    /**
449     * Indicates that the Wi-Fi P2P group info is changed.
450     */
451    COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED =
452        "usual.event.wifi.p2p.GROUP_STATE_CHANGED",
453
454    /**
455     * bluetooth.handsfree.ag.connect.state.update.
456     */
457    COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE =
458        "usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE",
459
460    /**
461     * bluetooth.handsfree.ag.current.device.update.
462     */
463    COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE =
464        "usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE",
465
466    /**
467     * bluetooth.handsfree.ag.audio.state.update.
468     */
469    COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE =
470        "usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE",
471
472    /**
473     * bluetooth.a2dpsource.connect.state.update.
474     */
475    COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE =
476        "usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE",
477
478    /**
479     * bluetooth.a2dpsource.current.device.update.
480     */
481    COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE =
482        "usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE",
483
484    /**
485     * bluetooth.a2dpsource.playing.state.update.
486     */
487    COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE =
488        "usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE",
489
490    /**
491     * bluetooth.a2dpsource.avrcp.connect.state.update.
492     */
493    COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE =
494        "usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE",
495
496    /**
497     * bluetooth.a2dpsource.codec.value.update.
498     */
499    COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE =
500        "usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE",
501
502    /**
503     * bluetooth.remotedevice.discovered.
504     */
505    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED =
506        "usual.event.bluetooth.remotedevice.DISCOVERED",
507
508    /**
509     * bluetooth.remotedevice.class.value.update.
510     */
511    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE =
512        "usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE",
513
514    /**
515     * bluetooth.remotedevice.acl.connected.
516     */
517    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED =
518        "usual.event.bluetooth.remotedevice.ACL_CONNECTED",
519
520    /**
521     * bluetooth.remotedevice.acl.disconnected.
522     */
523    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED =
524        "usual.event.bluetooth.remotedevice.ACL_DISCONNECTED",
525
526    /**
527     * bluetooth.remotedevice.name.update.
528     */
529    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE =
530        "usual.event.bluetooth.remotedevice.NAME_UPDATE",
531
532    /**
533     * bluetooth.remotedevice.pair.state.
534     */
535    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE =
536        "usual.event.bluetooth.remotedevice.PAIR_STATE",
537
538    /**
539     * bluetooth.remotedevice.battery.value.update.
540     */
541    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE =
542        "usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE",
543
544    /**
545     * bluetooth.remotedevice.sdp.result.
546     */
547    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT =
548        "usual.event.bluetooth.remotedevice.SDP_RESULT",
549
550    /**
551     * bluetooth.remotedevice.uuid.value.
552     */
553    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE =
554        "usual.event.bluetooth.remotedevice.UUID_VALUE",
555
556    /**
557     * bluetooth.remotedevice.pairing.req.
558     */
559    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ =
560        "usual.event.bluetooth.remotedevice.PAIRING_REQ",
561
562    /**
563     * bluetooth.remotedevice.pairing.cancel.
564     */
565    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL =
566        "usual.event.bluetooth.remotedevice.PAIRING_CANCEL",
567
568    /**
569     * bluetooth.remotedevice.connect.req.
570     */
571    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ =
572        "usual.event.bluetooth.remotedevice.CONNECT_REQ",
573
574    /**
575     * bluetooth.remotedevice.connect.reply.
576     */
577    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY =
578        "usual.event.bluetooth.remotedevice.CONNECT_REPLY",
579
580    /**
581     * bluetooth.remotedevice.connect.cancel.
582     */
583    COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL =
584        "usual.event.bluetooth.remotedevice.CONNECT_CANCEL",
585
586    /**
587     * bluetooth.handsfreeunit.connect.state.update.
588     */
589    COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE =
590        "usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE",
591
592    /**
593     * bluetooth.handsfreeunit.audio.state.update.
594     */
595    COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE =
596        "usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE",
597
598    /**
599     * bluetooth.handsfreeunit.ag.common.event.
600     */
601    COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT =
602        "usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT",
603
604    /**
605     * bluetooth.handsfreeunit.ag.call.state.update.
606     */
607    COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE =
608        "usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE",
609
610    /**
611     * bluetooth.host.state.update.
612     */
613    COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE =
614        "usual.event.bluetooth.host.STATE_UPDATE",
615
616    /**
617     * bluetooth.host.req.discoverable.
618     */
619    COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE =
620        "usual.event.bluetooth.host.REQ_DISCOVERABLE",
621
622    /**
623     * bluetooth.host.req.enable.
624     */
625    COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE = "usual.event.bluetooth.host.REQ_ENABLE",
626
627    /**
628     * bluetooth.host.req.disable.
629     */
630    COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE =
631        "usual.event.bluetooth.host.REQ_DISABLE",
632
633    /**
634     * bluetooth.host.scan.mode.update.
635     */
636    COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE =
637        "usual.event.bluetooth.host.SCAN_MODE_UPDATE",
638
639    /**
640     * bluetooth.host.discovery.stated.
641     */
642    COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED =
643        "usual.event.bluetooth.host.DISCOVERY_STARTED",
644
645    /**
646     * bluetooth.host.discovery.finished.
647     */
648    COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED =
649        "usual.event.bluetooth.host.DISCOVERY_FINISHED",
650
651    /**
652     * bluetooth.host.name.update.
653     */
654    COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE =
655        "usual.event.bluetooth.host.NAME_UPDATE",
656
657    /**
658     * bluetooth.a2dp.connect.state.update.
659     */
660    COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE =
661        "usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE",
662
663    /**
664     * bluetooth.a2dp.playing.state.update.
665     */
666    COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE =
667        "usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE",
668
669    /**
670     * bluetooth.a2dp.audio.state.update.
671     */
672    COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE =
673        "usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE",
674
675    /**
676     * nfc state change.
677     */
678    COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED =
679        "usual.event.nfc.action.ADAPTER_STATE_CHANGED",
680
681    /**
682     * nfc field on detected.
683     */
684    COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED =
685        "usual.event.nfc.action.RF_FIELD_ON_DETECTED",
686
687    /**
688     * nfc field off detected.
689     */
690    COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED =
691        "usual.event.nfc.action.RF_FIELD_OFF_DETECTED",
692
693    /**
694     * Sent when stop charging battery.
695     */
696    COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING",
697
698    /**
699     * Sent when start charging battery.
700     */
701    COMMON_EVENT_CHARGING = "usual.event.CHARGING",
702
703    /**
704     * Sent when device's idle mode changed
705     */
706    COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED",
707
708    /**
709     * Sent when device's power save mode changed
710     */
711    COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED",
712
713    /**
714     * user added.
715     */
716    COMMON_EVENT_USER_ADDED = "usual.event.USER_ADDED",
717
718    /**
719     * user removed.
720     */
721    COMMON_EVENT_USER_REMOVED = "usual.event.USER_REMOVED",
722
723    /**
724     * Sent when ability is added.
725     */
726    COMMON_EVENT_ABILITY_ADDED = "common.event.ABILITY_ADDED",
727
728    /**
729     * Sent when ability is removed.
730     */
731    COMMON_EVENT_ABILITY_REMOVED = "common.event.ABILITY_REMOVED",
732
733    /**
734     * Sent when ability is updated.
735     */
736    COMMON_EVENT_ABILITY_UPDATED = "common.event.ABILITY_UPDATED",
737
738    /**
739     * gps mode state changed.
740     */
741    COMMON_EVENT_LOCATION_MODE_STATE_CHANGED =
742        "usual.event.location.MODE_STATE_CHANGED",
743
744    /**
745     * The ivi is about to go into sleep state when the ivi is turned off power.
746     * This is a protected common event that can only be sent by system.
747     */
748    COMMON_EVENT_IVI_SLEEP = "common.event.IVI_SLEEP",
749
750    /**
751     * The ivi is slept and notify the app stop playing.
752     * This is a protected common event that can only be sent by system.
753     */
754    COMMON_EVENT_IVI_PAUSE = "common.event.IVI_PAUSE",
755
756    /**
757     * The ivi is standby and notify the app stop playing.
758     * This is a protected common event that can only be sent by system.
759     */
760    COMMON_EVENT_IVI_STANDBY = "common.event.IVI_STANDBY",
761
762    /**
763     * The app stop playing and save state.
764     * This is a protected common event that can only be sent by system.
765     */
766    COMMON_EVENT_IVI_LASTMODE_SAVE = "common.event.IVI_LASTMODE_SAVE",
767
768    /**
769     * The ivi is voltage abnormal.
770     * This is a protected common event that can only be sent by system.
771     */
772    COMMON_EVENT_IVI_VOLTAGE_ABNORMAL = "common.event.IVI_VOLTAGE_ABNORMAL",
773
774    /**
775     * The ivi temperature is too high.
776     * This is a protected common event that can only be sent by system.this common event will be delete later,
777     * please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL.
778     */
779    COMMON_EVENT_IVI_HIGH_TEMPERATURE = "common.event.IVI_HIGH_TEMPERATURE",
780
781    /**
782     * The ivi temperature is extreme high.
783     * This is a protected common event that can only be sent by system.this common event will be delete later,
784     * please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL.
785     */
786    COMMON_EVENT_IVI_EXTREME_TEMPERATURE = "common.event.IVI_EXTREME_TEMPERATURE",
787
788    /**
789     * The ivi temperature is abnormal.
790     * This is a protected common event that can only be sent by system.
791     */
792    COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL = "common.event.IVI_TEMPERATURE_ABNORMAL",
793
794    /**
795     * The ivi voltage is recovery.
796     * This is a protected common event that can only be sent by system.
797     */
798    COMMON_EVENT_IVI_VOLTAGE_RECOVERY = "common.event.IVI_VOLTAGE_RECOVERY",
799
800    /**
801     * The ivi temperature is recovery.
802     * This is a protected common event that can only be sent by system.
803     */
804    COMMON_EVENT_IVI_TEMPERATURE_RECOVERY = "common.event.IVI_TEMPERATURE_RECOVERY",
805
806    /**
807     * The battery service is active.
808     * This is a protected common event that can only be sent by system.
809     */
810    COMMON_EVENT_IVI_ACTIVE = "common.event.IVI_ACTIVE",
811
812    /**
813     * The usb state changed.
814     * This is a protected common event that can only be sent by system.
815     */
816    COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE",
817
818    /**
819     * The usb port changed.
820     * This is a protected common event that can only be sent by system.
821     */
822    COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED",
823
824    /**
825     * The usb device attached.
826     * This is a protected common event that can only be sent by system.
827     */
828    COMMON_EVENT_USB_DEVICE_ATTACHED =
829        "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED",
830
831    /**
832     * The usb device detached.
833     * This is a protected common event that can only be sent by system.
834     */
835    COMMON_EVENT_USB_DEVICE_DETACHED =
836        "usual.event.hardware.usb.action.USB_DEVICE_DETACHED",
837
838    /**
839     * The usb accessory attached.
840     * This is a protected common event that can only be sent by system.
841     */
842    COMMON_EVENT_USB_ACCESSORY_ATTACHED =
843        "usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED",
844
845    /**
846     * The usb accessory detached.
847     * This is a protected common event that can only be sent by system.
848     */
849    COMMON_EVENT_USB_ACCESSORY_DETACHED =
850        "usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED",
851
852    /**
853     * The external storage was removed.
854     * This is a protected common event that can only be sent by system.
855     */
856    COMMON_EVENT_DISK_REMOVED = "usual.event.data.DISK_REMOVED",
857
858    /**
859     * The external storage was unmounted.
860     * This is a protected common event that can only be sent by system.
861     */
862    COMMON_EVENT_DISK_UNMOUNTED = "usual.event.data.DISK_UNMOUNTED",
863
864    /**
865     * The external storage was mounted.
866     * This is a protected common event that can only be sent by system.
867     */
868    COMMON_EVENT_DISK_MOUNTED = "usual.event.data.DISK_MOUNTED",
869
870    /**
871     * The external storage was bad removal.
872     * This is a protected common event that can only be sent by system.
873     */
874    COMMON_EVENT_DISK_BAD_REMOVAL = "usual.event.data.DISK_BAD_REMOVAL",
875
876    /**
877     * The external storage was unmountable.
878     * This is a protected common event that can only be sent by system.
879     */
880    COMMON_EVENT_DISK_UNMOUNTABLE = "usual.event.data.DISK_UNMOUNTABLE",
881
882    /**
883     * The external storage was eject.
884     * This is a protected common event that can only be sent by system.
885     */
886    COMMON_EVENT_DISK_EJECT = "usual.event.data.DISK_EJECT",
887
888    /**
889     * The external storage was removed.
890     * This is a protected common event that can only be sent by system.
891     * @since 9
892     */
893    COMMON_EVENT_VOLUME_REMOVED = "usual.event.data.VOLUME_REMOVED",
894
895    /**
896     * The external storage was unmounted.
897     * This is a protected common event that can only be sent by system.
898     * @since 9
899     */
900    COMMON_EVENT_VOLUME_UNMOUNTED = "usual.event.data.VOLUME_UNMOUNTED",
901
902    /**
903     * The external storage was mounted.
904     * This is a protected common event that can only be sent by system.
905     * @since 9
906     */
907    COMMON_EVENT_VOLUME_MOUNTED = "usual.event.data.VOLUME_MOUNTED",
908
909    /**
910     * The external storage was bad removal.
911     * This is a protected common event that can only be sent by system.
912     * @since 9
913     */
914    COMMON_EVENT_VOLUME_BAD_REMOVAL = "usual.event.data.VOLUME_BAD_REMOVAL",
915
916    /**
917     * The external storage was eject.
918     * This is a protected common event that can only be sent by system.
919     * @since 9
920     */
921    COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT",
922
923    /**
924     * The visible of account was updated.
925     * This is a protected common event that can only be sent by system.
926     */
927    COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED =
928        "usual.event.data.VISIBLE_ACCOUNTS_UPDATED",
929
930    /**
931     * Account was deleted.
932     * This is a protected common event that can only be sent by system.
933     */
934    COMMON_EVENT_ACCOUNT_DELETED = "usual.event.data.ACCOUNT_DELETED",
935
936    /**
937     * Foundation was ready.
938     * This is a protected common event that can only be sent by system.
939     */
940    COMMON_EVENT_FOUNDATION_READY = "common.event.FOUNDATION_READY",
941
942    /**
943     * Indicates the action of a common event that the phone SIM card state has changed.
944     * This is a protected common event that can only be sent by system.
945     * @since 8
946     */
947    COMMON_EVENT_SIM_STATE_CHANGED = "usual.event.SIM_STATE_CHANGED",
948
949    /**
950     * Indicates the common event Action indicating that the airplane mode status of the device changes.
951     * Users can register this event to listen to the change of the airplane mode status of the device.
952     */
953    COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE",
954
955    /**
956     * Indicate the action of a common event that a new sms bas been received by the device.
957     * To subscribe to this common event, your application must have the ohos.permission.RECEIVE_SMS permission.
958     * This common event can be triggered only by system.
959     * @since 8
960     */
961    COMMON_EVENT_SMS_RECEIVE_COMPLETED = "usual.event.SMS_RECEIVE_COMPLETED",
962
963    /**
964     * Indicate the action of a common event that a new sms emergency cell broadcast bas been received by the device.
965     * This common event can be triggered only by system.
966     * @since 8
967     */
968    COMMON_EVENT_SMS_EMERGENCY_CB_RECEIVE_COMPLETED = "usual.event.SMS_EMERGENCY_CB_RECEIVE_COMPLETED",
969
970    /**
971     * Indicate the action of a common event that a new sms normal cell broadcast bas been received by the device.
972     * This common event can be triggered only by system.
973     * @since 8
974     */
975    COMMON_EVENT_SMS_CB_RECEIVE_COMPLETED = "usual.event.SMS_CB_RECEIVE_COMPLETED",
976
977    /**
978     * Indicate the action of a common event that a STK command has been received by the device.
979     * This common event can be triggered only by system.
980     * @since 8
981     */
982    COMMON_EVENT_STK_COMMAND = "usual.event.STK_COMMAND",
983
984    /**
985     * Indicate the action of a common event that STK session end.
986     * This common event can be triggered only by system.
987     * @since 8
988     */
989    COMMON_EVENT_STK_SESSION_END = "usual.event.STK_SESSION_END",
990
991    /**
992     * Indicate the action of a common event that the STK phone card state has changed.
993     * This common event can be triggered only by system.
994     * @since 8
995     */
996    COMMON_EVENT_STK_CARD_STATE_CHANGED = "usual.event.STK_CARD_STATE_CHANGED",
997
998    /**
999     * Indicate the action of a common event that an alpha string during call control has been received by the device.
1000     * This common event can be triggered only by system.
1001     * @since 8
1002     */
1003    COMMON_EVENT_STK_ALPHA_IDENTIFIER = "usual.event.STK_ALPHA_IDENTIFIER",
1004
1005    /**
1006     * Indicate the action of a common event that the spn display information has been updated.
1007     * This common event can be triggered only by system.
1008     * @since 8
1009     */
1010    COMMON_EVENT_SPN_INFO_CHANGED = "usual.event.SPN_INFO_CHANGED",
1011
1012    /**
1013     * sent by the window manager service when the window mode is split.
1014     * @since 8
1015     */
1016    COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN",
1017
1018    /**
1019     * Indicate the action of a common event that a new sms wappush has been received by the device.
1020     * This common event can be triggered only by system.
1021     * @since 8
1022     */
1023    COMMON_EVENT_SMS_WAPPUSH_RECEIVE_COMPLETED = "usual.event.SMS_WAPPUSH_RECEIVE_COMPLETED",
1024
1025    /**
1026     * Indicate the action of a common event that the operator config has been updated.
1027     * This common event can be triggered only by system.
1028     * @since 8
1029     */
1030    COMMON_EVENT_OPERATOR_CONFIG_CHANGED = "usual.event.OPERATOR_CONFIG_CHANGED",
1031
1032    /**
1033     * Indicates the action of a common event that the default SMS subscription has been changed.
1034     * This is a protected common event that can only be sent by system.
1035     * @since 9
1036     */
1037    COMMON_EVENT_SIM_CARD_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "usual.event.SIM.DEFAULT_SMS_SUBSCRIPTION_CHANGED",
1038
1039    /**
1040     * Indicates the action of a common event that the default data subscription has been changed.
1041     * This is a protected common event that can only be sent by system.
1042     * @since 9
1043     */
1044    COMMON_EVENT_SIM_CARD_DEFAULT_DATA_SUBSCRIPTION_CHANGED = "usual.event.SIM.DEFAULT_DATA_SUBSCRIPTION_CHANGED",
1045
1046    /**
1047     * Indicates the action of a common event that the default main subscription has been changed.
1048     * This is a protected common event that can only be sent by system.
1049     * @since 9
1050     */
1051    COMMON_EVENT_SIM_CARD_DEFAULT_MAIN_SUBSCRIPTION_CHANGED = "usual.event.SIM.DEFAULT_MAIN_SUBSCRIPTION_CHANGED",
1052
1053    /**
1054     * Indicates the action of a common event that the default voice subscription has been changed.
1055     * This is a protected common event that can only be sent by system.
1056     * @since 9
1057     */
1058    COMMON_EVENT_SIM_CARD_DEFAULT_VOICE_SUBSCRIPTION_CHANGED = "usual.event.SIM.DEFAULT_VOICE_SUBSCRIPTION_CHANGED",
1059
1060    /**
1061     * Indicates the action of a common event that the call state has been changed.
1062     * To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE
1063     * permission.
1064     * This is a protected common event that can only be sent by system.
1065     * @since 9
1066     */
1067    COMMON_EVENT_CALL_STATE_CHANGED = "usual.event.CALL_STATE_CHANGED",
1068
1069    /**
1070     * Indicates the action of a common event that the cellular data state has been changed.
1071     * This is a protected common event that can only be sent by system.
1072     * @since 9
1073     */
1074    COMMON_EVENT_CELLULAR_DATA_STATE_CHANGED = "usual.event.CELLULAR_DATA_STATE_CHANGED",
1075
1076    /**
1077     * Indicates the action of a common event that the network state has been changed.
1078     * This is a protected common event that can only be sent by system.
1079     * @since 9
1080     */
1081    COMMON_EVENT_NETWORK_STATE_CHANGED = "usual.event.NETWORK_STATE_CHANGED",
1082
1083    /**
1084     * Indicates the action of a common event that the signal info has been changed.
1085     * This is a protected common event that can only be sent by system.
1086     * @since 9
1087     */
1088    COMMON_EVENT_SIGNAL_INFO_CHANGED = "usual.event.SIGNAL_INFO_CHANGED",
1089
1090    /**
1091     * Indicates the action of a common event that the incoming call has been missed.
1092     * To subscribe to this protected common event, your application must have the ohos.permission.GET_TELEPHONY_STATE
1093     * permission.
1094     * This is a protected common event that can only be sent by system.
1095     * @since 9
1096     */
1097    COMMON_EVENT_INCOMING_CALL_MISSED = "usual.event.INCOMING_CALL_MISSED",
1098
1099    /**
1100     * Indicate the result of quick fix apply.
1101     * This common event can be triggered only by system.
1102     * @since 9
1103     */
1104    COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT",
1105
1106    /**
1107     * Indicates the action of a common event that radio state change.
1108     * To subscribe to this protected common event that can only be sent by system.
1109     * @since 9
1110     */
1111    COMMON_EVENT_RADIO_STATE_CHANGE = "usual.event.RADIO_STATE_CHANGE",
1112
1113    /**
1114     * Indicates the action of a common event that radio state change.
1115     * To subscribe to this protected common event that can only be sent by system.
1116     * @since 10
1117     */
1118    COMMON_EVENT_HTTP_PROXY_CHANGE = "usual.event.HTTP_PROXY_CHANGE"
1119  }
1120}
1121
1122export default commonEvent;
1123