未验证 提交 321590b3 编写于 作者: O openharmony_ci 提交者: Gitee

!16290 【3.2-Beta5】翻译完成 15393+16116+16045+16206

Merge pull request !16290 from ester.zhou/C05-16206
...@@ -15,11 +15,11 @@ Common events are classified into system common events and custom common events. ...@@ -15,11 +15,11 @@ Common events are classified into system common events and custom common events.
Common events are also classified into unordered, ordered, and sticky common events. Common events are also classified into unordered, ordered, and sticky common events.
- Unordered common events: CES forwards common events based on the subscription sequence, regardless of whether subscribers receive the events. - Unordered common events: common events that CES forwards based on the subscription sequence, regardless of whether subscribers receive the events.
- Ordered common event: CES forwards common events to the next subscriber only after receiving a reply from the previous subscriber. - Ordered common events: common events that CES forwards based on the subscriber priority. CES forwards common events to the subscriber with lower priority only after receiving a reply from the previous subscriber with higher priority.
- Sticky common event: a public event that can be sent to a subscriber before they initiate a subscription. Only system applications or system services can send sticky common event, and they must request the **ohos.permission.COMMONEVENT_STICKY** permission. For details about the configuration, see [Permission Application Guide](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file). - Sticky common events: common events that can be sent to a subscriber before they initiate a subscription. Only system applications and system services can send sticky common events, and they must request the **ohos.permission.COMMONEVENT_STICKY** permission. For details about the configuration, see [Permission Application Guide](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file).
Each application can subscribe to common events as required. After your application subscribes to a common event, the system sends it to your application every time the event is published. Such an event may be published by the system, other applications, or your own application. Each application can subscribe to common events as required. After your application subscribes to a common event, the system sends it to your application every time the event is published. Such an event may be published by the system, other applications, or your own application.
......
# Subscribing to Common Events in Static Mode (for System Applications Only)
## When to Use
A static subscriber is started once it receives a target event published by the system or application. At the same time, the **onReceiveEvent** callback is triggered, in which you can implement the service logic. For example, if an application needs to execute some initialization tasks during device power-on, the application can subscribe to the power-on event in static mode. After receiving the power-on event, the application is started to execute the initialization tasks. Subscribing to a common event in static mode is achieved by configuring a declaration file and implementing a class that inherits from **StaticSubscriberExtensionAbility**. Note that this subscribing mode has negative impact on system power consumption. Therefore, exercise caution when using this mode.
## How to Develop
1. Declaring a Static Subscriber
To declare a static subscriber, create an ExtensionAbility, which is derived from the **StaticSubscriberExtensionAbility** class, in the project. The sample code is as follows:
```ts
import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriberExtensionAbility'
export default class StaticSubscriber extends StaticSubscriberExtensionAbility {
onReceiveEvent(event) {
console.log('onReceiveEvent, event:' + event.event);
}
}
```
You can implement service logic in the **onReceiveEvent** callback.
2. Project Configuration for a Static Subscriber
After writing the static subscriber code, configure the subscriber in the **module.json5** file. The configuration format is as follows:
```ts
{
"module": {
......
"extensionAbilities": [
{
"name": "StaticSubscriber",
"srcEntrance": "./ets/StaticSubscriber/StaticSubscriber.ts",
"description": "$string:StaticSubscriber_desc",
"icon": "$media:icon",
"label": "$string:StaticSubscriber_label",
"type": "staticSubscriber",
"visible": true,
"metadata": [
{
"name": "ohos.extension.staticSubscriber",
"resource": "$profile:subscribe"
}
]
}
]
......
}
}
```
Pay attention to the following fields in the JSON file:
- **srcEntrance**: entry file path of the ExtensionAbility, that is, the file path of the static subscriber declared in Step 2.
- **type**: ExtensionAbility type. For a static subscriber, set this field to **staticSubscriber**.
- **metadata**: level-2 configuration file information of the ExtensionAbility. The configuration information varies according to the ExtensionAbility type. Therefore, you must use different config files to indicate the specific configuration.
- **name**: name of the ExtensionAbility. For a static subscriber, declare the name as **ohos.extension.staticSubscriber** for successful identification.
- **resource**: path that stores the ExtensionAbility configuration, which is customizable. In this example, the path is **resources/base/profile/subscribe.json**.
A level-2 configuration file pointed to by **metadata** must be in the following format:
```ts
{
"commonEvents": [
{
"name": "xxx",
"permission": "xxx",
"events":[
"xxx"
]
}
]
}
```
If the level-2 configuration file is not declared in this format, the file cannot be identified. The fields are described as follows:
- **name**: name of the ExtensionAbility, which must be the same as the name of **extensionAbility** declared in **module.json5**.
- **permission**: permission required for the publisher. If a publisher without the required permission attempts to publish an event, the event is regarded as invalid and will not be published.
- **events**: list of target events to subscribe to.
3. Device System Configuration
In the device system configuration file **/etc/static_subscriber_config.json**, add the bundle name of the static subscriber.
```json
{
"xxx",
"ohos.extension.staticSubscriber",
"xxx"
}
```
# Common Event Subscription Overview
​The common event service provides two subscription modes: dynamic and static. The biggest difference between these two modes is that dynamic subscription requires the application to be running, while static subscription does not.
- In dynamic subscription mode, a subscriber subscribes to common events by calling an API during the running period. For details, see [Subscribing to Common Events in Dynamic Mode](common-event-subscription.md).
- In static subscription mode, a subscriber subscribes to common events by configuring a declaration file and implementing a class that inherits from StaticSubscriberExtensionAbility. For details, see [Subscribing to Common Events in Static Mode](common-event-static-subscription.md).
# Subscribing to Common Events # Subscribing to Common Events in Dynamic Mode
## When to Use ## When to Use
You can create a subscriber object to subscribe to a common event so as to obtain the parameters passed in the event. Certain system common events [require specific permissions](../security/accesstoken-guidelines.md) to subscribe to. For details, see [Required Permissions](../reference/apis/js-apis-commonEventManager.md#support). In dynamic subscription mode, an application subscribes to a common event when it is running. If the subscribed event is published during the running period, the subscriber application will receive the event, together with the parameters passed in the event. For example, if an application expects to be notified of low battery so that it can reduce power consumption accordingly when running, then the application can subscribe to the low-battery event. Upon receiving the event, the application can close some unnecessary tasks to reduce power consumption. Certain system common events [require specific permissions](../security/accesstoken-guidelines.md) to subscribe to. For details, see [Required Permissions](../reference/apis/js-apis-commonEventManager.md#support).
## Available APIs ## Available APIs
For details about the APIs, see [API Reference](../reference/apis/js-apis-commonEventManager.md#commoneventmanagersubscribe). For details about the APIs, see [API Reference](../reference/apis/js-apis-commonEvent.md#commoneventcreatesubscriber).
| API| Description| | API| Description|
| -------- | -------- | | -------- | -------- |
...@@ -19,10 +19,10 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common ...@@ -19,10 +19,10 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common
## How to Develop ## How to Develop
1. Import the **commonEventManager** module. 1. Import the **commonEvent** module.
```ts ```ts
import commonEventManager from '@ohos.commonEventManager'; import commonEvent from '@ohos.commonEventManager';
``` ```
2. Create a **subscribeInfo** object. For details about the data types and parameters of the object, see [CommonEventSubscribeInfo](../reference/apis/js-apis-commonEventManager.md#commoneventsubscribeinfo). 2. Create a **subscribeInfo** object. For details about the data types and parameters of the object, see [CommonEventSubscribeInfo](../reference/apis/js-apis-commonEventManager.md#commoneventsubscribeinfo).
...@@ -40,7 +40,7 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common ...@@ -40,7 +40,7 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common
```ts ```ts
// Callback for subscriber creation. // Callback for subscriber creation.
commonEventManager.createSubscriber(subscribeInfo, (err, data) => { commonEvent.createSubscriber(subscribeInfo, (err, data) => {
if (err) { if (err) {
console.error(`[CommonEvent] CreateSubscriberCallBack err=${JSON.stringify(err)}`); console.error(`[CommonEvent] CreateSubscriberCallBack err=${JSON.stringify(err)}`);
} else { } else {
...@@ -56,7 +56,7 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common ...@@ -56,7 +56,7 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common
```ts ```ts
// Callback for common event subscription. // Callback for common event subscription.
if (subscriber !== null) { if (subscriber !== null) {
commonEventManager.subscribe(subscriber, (err, data) => { commonEvent.subscribe(subscriber, (err, data) => {
if (err) { if (err) {
console.error(`[CommonEvent] SubscribeCallBack err=${JSON.stringify(err)}`); console.error(`[CommonEvent] SubscribeCallBack err=${JSON.stringify(err)}`);
} else { } else {
......
# Unsubscribing from Common Events # Unsubscribing from Common Events in Dynamic Mode
## When to Use ## When to Use
You can call [unsubscribe()](../reference/apis/js-apis-commonEventManager.md#commoneventmanagerunsubscribe) to unsubscribe from a common event that is no longer required. You can call [unsubscribe()](../reference/apis/js-apis-commonEventManager.md#commoneventmanagerunsubscribe) to unsubscribe from a common event that is no longer required in dynamic mode.
## Available APIs ## Available APIs
...@@ -15,25 +15,25 @@ You can call [unsubscribe()](../reference/apis/js-apis-commonEventManager.md#com ...@@ -15,25 +15,25 @@ You can call [unsubscribe()](../reference/apis/js-apis-commonEventManager.md#com
## How to Develop ## How to Develop
1. Import the **commonEventManager** module. 1. Import the **commonEvent** module.
```ts ```ts
import commonEventManager from '@ohos.commonEventManager'; import commonEvent from '@ohos.commonEventManager';
``` ```
2. Subscribe to an event by following the procedure described in [Subscribing to Common Events](common-event-subscription.md). 2. Subscribe to an event by following the procedure described in [Subscribing to Common Events in Dynamic Mode](common-event-subscription.md).
3. Call **unsubscribe** in **CommonEvent** to unsubscribe from the common event. 3. Call **unsubscribe** in **CommonEvent** to unsubscribe from the common event.
```ts ```ts
// The subscriber object iscreated during event subscription. // The subscriber object is created during event subscription.
if (subscriber !== null) { if (subscriber !== null) {
commonEventManager.unsubscribe(subscriber, (err) => { commonEvent.unsubscribe(subscriber, (err) => {
if (err) { if (err) {
console.error(`[CommonEvent] UnsubscribeCallBack err=${JSON.stringify(err)}`); console.error(`[CommonEvent] UnsubscribeCallBack err=${JSON.stringify(err)}`)
} else { } else {
console.info(`[CommonEvent] Unsubscribe`); console.info(`[CommonEvent] Unsubscribe`)
subscriber = null; subscriber = null
} }
}) })
} }
......
# System Common Events
This document provides indexes for system common events defined in OpenHarmony.
For details about the definition of a system common event, see [Support in @ohos.commonEvent (Common Event)](./js-apis-commonEvent.md#support).
**System capability**: SystemCapability.Notification.CommonEvent
## COMMON_EVENT_BOOT_COMPLETED
Indicates that the user has finished booting and the system has been loaded.
- Value: **usual.event.BOOT_COMPLETED**
- Required subscriber permissions: ohos.permission.RECEIVER_STARTUP_COMPLETED
## COMMON_EVENT_LOCKED_BOOT_COMPLETED
(Reserved, not supported yet) Indicates that the user has finished booting and the system has been loaded but the screen is still locked.
- Value: **usual.event.LOCKED_BOOT_COMPLETED**
- Required subscriber permissions: ohos.permission.RECEIVER_STARTUP_COMPLETED
## COMMON_EVENT_SHUTDOWN
Indicates that the device is being shut down and the final shutdown will proceed.
- Value: **usual.event.SHUTDOWN**
- Required subscriber permissions: none
## COMMON_EVENT_BATTERY_CHANGED
Indicates that the charging state, level, and other information about the battery have changed.
- Value: **usual.event.BATTERY_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_BATTERY_LOW
Indicates that the battery level is low.
- Value: **usual.event.BATTERY_LOW**
- Required subscriber permissions: none
## COMMON_EVENT_BATTERY_OKAY
Indicates that the battery level is normal.
- Value: **usual.event.BATTERY_OKAY**
- Required subscriber permissions: none
## COMMON_EVENT_POWER_CONNECTED
Indicates that the device is connected to an external power supply.
- Value: **usual.event.POWER_CONNECTED**
- Required subscriber permissions: none
## COMMON_EVENT_POWER_DISCONNECTED
Indicates that the device is disconnected from the external power supply.
- Value: **usual.event.POWER_DISCONNECTED**
- Required subscriber permissions: none
## COMMON_EVENT_SCREEN_OFF
Indicates that the device screen is off and the device is in sleep mode.
- Value: **usual.event.SCREEN_OFF**
- Required subscriber permissions: none
## COMMON_EVENT_SCREEN_ON
Indicates that the device screen is on and the device is in interactive state.
- Value: **usual.event.SCREEN_ON**
- Required subscriber permissions: none
## COMMON_EVENT_THERMAL_LEVEL_CHANGED<sup>8+</sup>
Indicates that the device's thermal level has changed.
- Value: **usual.event.THERMAL_LEVEL_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_PRESENT
(Reserved, not supported yet) Indicates that the user unlocks the device.
- Value: **usual.event.USER_PRESENT**
- Required subscriber permissions: none
## COMMON_EVENT_TIME_TICK
Indicates that the system time has changed as time ticks by.
- Value: **usual.event.TIME_TICK**
- Required subscriber permissions: none
## COMMON_EVENT_TIME_CHANGED
Indicates that the system time is set.
- Value: **usual.event.TIME_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_DATE_CHANGED
(Reserved, not supported yet) Indicates that the system date has changed.
- Value: **usual.event.DATE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_TIMEZONE_CHANGED
Indicates that the system time zone has changed.
- Value: **usual.event.TIMEZONE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_CLOSE_SYSTEM_DIALOGS
(Reserved, not supported yet) Indicates that the user closes a temporary system dialog box.
- Value: **usual.event.CLOSE_SYSTEM_DIALOGS**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_ADDED
Indicates that a new application package has been installed on the device.
- Value: **usual.event.PACKAGE_ADDED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_CACHE_CLEARED<sup>9+</sup>
Indicates that the user cleared the application package cache.
- Value: **usual.event.PACKAGE_CACHE_CLEARED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_REPLACED
(Reserved, not supported yet) Indicates that a later version of an installed application package has replaced the previous one on the device.
- Value: **usual.event.PACKAGE_REPLACED**
- Required subscriber permissions: none
## COMMON_EVENT_MY_PACKAGE_REPLACED
(Reserved, not supported yet) Indicates that a later version of your application package has replaced the previous one.
- Value: **usual.event.MY_PACKAGE_REPLACED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_REMOVED
Indicates that an installed application has been uninstalled from the device with the application data retained.
- Value: **usual.event.PACKAGE_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_BUNDLE_REMOVED
(Reserved, not supported yet) Indicates that an installed bundle has been uninstalled from the device with the application data retained.
- Value: **usual.event.BUNDLE_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_FULLY_REMOVED
(Reserved, not supported yet) Indicates that an installed application, including both the application data and code, has been completely uninstalled from the device.
- Value: **usual.event.PACKAGE_FULLY_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_CHANGED
Indicates that an application package has been changed (for example, an ability in the package has been enabled or disabled).
- Value: **usual.event.PACKAGE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_RESTARTED
Indicates that the user closed all processes of the application and restarted the application.
- Value: **usual.event.PACKAGE_RESTARTED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_DATA_CLEARED
Indicates that the user cleared the application package data.
- Value: **usual.event.PACKAGE_DATA_CLEARED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGES_SUSPENDED
(Reserved, not supported yet) Indicates that application HAP files are suspended.
- Value: **usual.event.PACKAGES_SUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGES_UNSUSPENDED
(Reserved, not supported yet) Indicates that application HAP files are not suspended (restored from the suspended state).
- Value: **usual.event.PACKAGES_UNSUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_MY_PACKAGE_SUSPENDED
Indicates that an application HAP file is suspended.
- Value: **usual.event.MY_PACKAGE_SUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_MY_PACKAGE_UNSUSPENDED
Indicates that an application HAP file is not suspended.
- Value: **usual.event.MY_PACKAGE_UNSUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_UID_REMOVED
(Reserved, not supported yet) Indicates that a user ID has been removed from the system.
- Value: **usual.event.UID_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_FIRST_LAUNCH
(Reserved, not supported yet) Indicates that an installed application is started for the first time.
- Value: **usual.event.PACKAGE_FIRST_LAUNCH**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION
(Reserved, not supported yet) Indicates that an application requires system verification.
- Value: **usual.event.PACKAGE_NEEDS_VERIFICATION**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_VERIFIED
(Reserved, not supported yet) Indicates that an application has been verified by the system.
- Value: **usual.event.PACKAGE_VERIFIED**
- Required subscriber permissions: none
## COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE
(Reserved, not supported yet) Indicates that applications installed on the external storage are available for the system.
- Value: **usual.event.EXTERNAL_APPLICATIONS_AVAILABLE**
- Required subscriber permissions: none
## COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE
(Reserved, not supported yet) Indicates that applications installed on the external storage are not available for the system.
- Value: **usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE**
- Required subscriber permissions: none
## COMMON_EVENT_CONFIGURATION_CHANGED
(Reserved, not supported yet) Indicates that the device state (for example, orientation and locale) has changed.
- Value: **usual.event.CONFIGURATION_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_LOCALE_CHANGED
(Reserved, not supported yet) Indicates that the device locale has changed.
- Value: **usual.event.LOCALE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_MANAGE_PACKAGE_STORAGE
(Reserved, not supported yet) Indicates that the device storage is insufficient.
- Value: **usual.event.MANAGE_PACKAGE_STORAGE**
- Required subscriber permissions: none
## COMMON_EVENT_DRIVE_MODE
(Reserved, not supported yet) Indicates that the system is in driving mode.
- Value: **common.event.DRIVE_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_HOME_MODE
(Reserved, not supported yet) Indicates that the system is in home mode.
- Value: **common.event.HOME_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_OFFICE_MODE
(Reserved, not supported yet) Indicates that the system is in office mode.
- Value: **common.event.OFFICE_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_USER_STARTED
(Reserved, not supported yet) Indicates that the user has been started.
- Value: **usual.event.USER_STARTED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_BACKGROUND
(Reserved, not supported yet) Indicates that the user has been brought to the background.
- Value: **usual.event.USER_BACKGROUND**
- Required subscriber permissions: none
## COMMON_EVENT_USER_FOREGROUND
(Reserved, not supported yet) Indicates that the user has been brought to the foreground.
- Value: **usual.event.USER_FOREGROUND**
- Required subscriber permissions: none
## COMMON_EVENT_USER_SWITCHED
Indicates that user switching is in progress.
- Value: **usual.event.USER_SWITCHED**
- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_STARTING
(Reserved, not supported yet) Indicates that the user is being started.
- Value: **usual.event.USER_STARTING**
- Required subscriber permissions: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_UNLOCKED
(Reserved, not supported yet) Indicates that the credential-encrypted storage has been unlocked for the current user after the device is restarted.
- Value: **usual.event.USER_UNLOCKED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_STOPPING
(Reserved, not supported yet) Indicates that the user is going to be stopped.
- Value: **usual.event.USER_STOPPING**
- Required subscriber permissions: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_STOPPED
(Reserved, not supported yet) Indicates that the user has been stopped.
- Value: **usual.event.USER_STOPPED**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_POWER_STATE
Indicates that the Wi-Fi state has changed, for example, enabled or disabled.
- Value: **usual.event.wifi.POWER_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_SCAN_FINISHED
Indicates that the Wi-Fi access point has been detected and proven to be available.
- Value: **usual.event.wifi.SCAN_FINISHED**
- Required subscriber permissions: ohos.permission.LOCATION
## COMMON_EVENT_WIFI_RSSI_VALUE
Indicates that the Wi-Fi signal strength (RSSI) has changed.
- Value: **usual.event.wifi.RSSI_VALUE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_CONN_STATE
Indicates that the Wi-Fi connection state has changed.
- Value: **usual.event.wifi.CONN_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_HOTSPOT_STATE
Indicates that the Wi-Fi hotspot state has changed, for example, enabled or disabled.
- Value: **usual.event.wifi.HOTSPOT_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_AP_STA_JOIN
Indicates that a client has joined the Wi-Fi hotspot of the current device.
- Value: **usual.event.wifi.WIFI_HS_STA_JOIN**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_AP_STA_LEAVE
Indicates that a client has disconnected from the Wi-Fi hotspot of the current device.
- Value: **usual.event.wifi.WIFI_HS_STA_LEAVE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE
Indicates that the state of MPLINK (an enhanced Wi-Fi feature) has changed.
- Value: **usual.event.wifi.mplink.STATE_CHANGE**
- Required subscriber permissions: ohos.permission.MPLINK_CHANGE_STATE
## COMMON_EVENT_WIFI_P2P_CONN_STATE
Indicates that the Wi-Fi P2P connection state has changed.
- Value: **usual.event.wifi.p2p.CONN_STATE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
## COMMON_EVENT_WIFI_P2P_STATE_CHANGED
Indicates that the Wi-Fi P2P state has changed, for example, enabled or disabled.
- Value: **usual.event.wifi.p2p.STATE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED
Indicates that the state of the Wi-Fi P2P peer device has changed.
- Value: **usual.event.wifi.p2p.DEVICES_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED
Indicates that the Wi-Fi P2P discovery state has changed.
- Value: **usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED
Indicates that the state of the Wi-Fi P2P local device has changed.
- Value: **usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED
Indicates that the Wi-Fi P2P group information has changed.
- Value: **usual.event.wifi.p2p.GROUP_STATE_CHANGED**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates the connection state of Bluetooth handsfree communication.
- Value: **usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE
(Reserved, not supported yet) Indicates that the device connected through Bluetooth handsfree is active.
- Value: **usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE
(Reserved, not supported yet) Indicates that the connection state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates the connection state of Bluetooth A2DP.
- Value: **usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE
(Reserved, not supported yet) Indicates that the device connected using Bluetooth A2DP is active.
- Value: **usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE
(Reserved, not supported yet) Indicates that the playing state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates that the AVRCP connection state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE
(Reserved, not supported yet) Indicates that the audio codec state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED
(Reserved, not supported yet) Indicates that a remote Bluetooth device is discovered.
- Value: **usual.event.bluetooth.remotedevice.DISCOVERED**
- Required subscriber permissions: ohos.permission.LOCATION and ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE
(Reserved, not supported yet) Indicates that the Bluetooth class of a remote Bluetooth device has changed.
- Value: **usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED
(Reserved, not supported yet) Indicates that a low-ACL connection with a remote Bluetooth device has been established.
- Value: **usual.event.bluetooth.remotedevice.ACL_CONNECTED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED
(Reserved, not supported yet) Indicates that the low-ACL connection with a remote Bluetooth device has been terminated.
- Value: **usual.event.bluetooth.remotedevice.ACL_DISCONNECTED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE
(Reserved, not supported yet) Indicates that the friendly name of a remote Bluetooth device is retrieved for the first time or has changed since the last retrieval.
- Value: **usual.event.bluetooth.remotedevice.NAME_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE
(Reserved, not supported yet) Indicates that the connection state with a remote Bluetooth device has changed.
- Value: **usual.event.bluetooth.remotedevice.PAIR_STATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE
(Reserved, not supported yet) Indicates that the battery level of a remote Bluetooth device is retrieved for the first time or has changed since the last retrieval.
- Value: **usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT
(Reserved, not supported yet) Indicates the SDP state of a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.SDP_RESULT**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE
(Reserved, not supported yet) Indicates the UUID connection state with a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.UUID_VALUE**
- Required subscriber permissions: ohos.permission.DISCOVER_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ
(Reserved, not supported yet) Indicates the pairing request from a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.PAIRING_REQ**
- Required subscriber permissions: ohos.permission.DISCOVER_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL
(Reserved, not supported yet) Indicates that Bluetooth pairing has been canceled.
- Value: **usual.event.bluetooth.remotedevice.PAIRING_CANCEL**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ
(Reserved, not supported yet) Indicates the connection request from a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.CONNECT_REQ**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY
(Reserved, not supported yet) Indicates the response to the connection request from a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.CONNECT_REPLY**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL
(Reserved, not supported yet) Indicates that the connection to a remote Bluetooth device has been canceled.
- Value: **usual.event.bluetooth.remotedevice.CONNECT_CANCEL**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates that the connection state with a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE
(Reserved, not supported yet) Indicates that the audio state of a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT
(Reserved, not supported yet) Indicates that the audio gateway state of a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE
(Reserved, not supported yet) Indicates that the calling state of a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE
(Reserved, not supported yet) Indicates that the state of a Bluetooth adapter has changed, for example, Bluetooth has been enabled or disabled.
- Value: **usual.event.bluetooth.host.STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE
(Reserved, not supported yet) Indicates the request for the user to allow Bluetooth device scanning.
- Value: **usual.event.bluetooth.host.REQ_DISCOVERABLE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE
(Reserved, not supported yet) Indicates the request for the user to enable Bluetooth.
- Value: **usual.event.bluetooth.host.REQ_ENABLE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE
(Reserved, not supported yet) Indicates the request for the user to disable Bluetooth.
- Value: **usual.event.bluetooth.host.REQ_DISABLE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE
(Reserved, not supported yet) Indicates that the Bluetooth scanning mode of the device has changed.
- Value: **usual.event.bluetooth.host.SCAN_MODE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED
(Reserved, not supported yet) Indicates that Bluetooth scanning has been started on the device.
- Value: **usual.event.bluetooth.host.DISCOVERY_STARTED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED
(Reserved, not supported yet) Indicates that Bluetooth scanning is finished on the device.
- Value: **usual.event.bluetooth.host.DISCOVERY_FINISHED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE
(Reserved, not supported yet) Indicates that the Bluetooth adapter name of the device has changed.
- Value: **usual.event.bluetooth.host.NAME_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates that the connection state of Bluetooth A2DP Sink has changed.
- Value: **usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE
(Reserved, not supported yet) Indicates that the playing state of Bluetooth A2DP Sink has changed.
- Value: **usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE
(Reserved, not supported yet) Indicates that the audio state of Bluetooth A2DP Sink has changed.
- Value: **usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED
(Reserved, not supported yet) Indicates that the state of the device NFC adapter has changed.
- Value: **usual.event.nfc.action.ADAPTER_STATE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED
(Reserved, not supported yet) Indicates that the NFC RF field is detected to be in the enabled state.
- Value: **usual.event.nfc.action.RF_FIELD_ON_DETECTED**
- Required subscriber permissions: ohos.permission.MANAGE_SECURE_SETTINGS
## COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED
(Reserved, not supported yet) Indicates that the NFC RF field is detected to be in the disabled state.
- Value: **usual.event.nfc.action.RF_FIELD_OFF_DETECTED**
- Required subscriber permissions: ohos.permission.MANAGE_SECURE_SETTINGS
## COMMON_EVENT_DISCHARGING
Indicates that the system stops charging the battery.
- Value: **usual.event.DISCHARGING**
- Required subscriber permissions: none
## COMMON_EVENT_CHARGING
Indicates that the system starts charging the battery.
- Value: **usual.event.CHARGING**
- Required subscriber permissions: none
## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
(Reserved, not supported yet) Indicates that the system idle mode has changed.
- Value: **usual.event.DEVICE_IDLE_MODE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_POWER_SAVE_MODE_CHANGED
Indicates that the system power saving mode has changed.
- Value: **usual.event.POWER_SAVE_MODE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_ADDED
Indicates that a user has been added to the system.
- Value: **usual.event.USER_ADDED**
- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_REMOVED
Indicates that a user has been removed from the system.
- Value: **usual.event.USER_REMOVED**
- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
## COMMON_EVENT_ABILITY_ADDED
(Reserved, not supported yet) Indicates that an ability has been added.
- Value: **usual.event.ABILITY_ADDED**
- Required subscriber permissions: ohos.permission.LISTEN_BUNDLE_CHANGE
## COMMON_EVENT_ABILITY_REMOVED
(Reserved, not supported yet) Indicates that an ability has been removed.
- Value: **usual.event.ABILITY_REMOVED**
- Required subscriber permissions: ohos.permission.LISTEN_BUNDLE_CHANGE
## COMMON_EVENT_ABILITY_UPDATED
(Reserved, not supported yet) Indicates that an ability has been updated.
- Value: **usual.event.ABILITY_UPDATED**
- Required subscriber permissions: ohos.permission.LISTEN_BUNDLE_CHANGE
## COMMON_EVENT_LOCATION_MODE_STATE_CHANGED
(Reserved, not supported yet) Indicates that the location mode of the system has changed.
- Value: **usual.event.location.MODE_STATE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_SLEEP
(Reserved, not supported yet) Indicates that the in-vehicle infotainment (IVI) system is in sleep mode.
- Value: **common.event.IVI_SLEEP**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_PAUSE
(Reserved, not supported yet) Indicates that the IVI system as entered sleep mode and instructs the playing application to stop playback.
- Value: **common.event.IVI_PAUSE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_STANDBY
(Reserved, not supported yet) Requests a third-party application in the IVI system to pause the current work.
- Value: **common.event.IVI_STANDBY**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_LASTMODE_SAVE
(Reserved, not supported yet) Requests a third-party application in the IVI system to save its last mode.
- Value: **common.event.IVI_LASTMODE_SAVE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_VOLTAGE_ABNORMAL
(Reserved, not supported yet) Indicates that the voltage of the vehicle's power system is abnormal.
- Value: **common.event.IVI_VOLTAGE_ABNORMAL**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_HIGH_TEMPERATURE
(Reserved, not supported yet) Indicates that the temperature of the IVI system is high.
- Value: **common.event.IVI_HIGH_TEMPERATURE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_EXTREME_TEMPERATURE
(Reserved, not supported yet) Indicates that the temperature of the IVI system is extremely high.
- Value: **common.event.IVI_EXTREME_TEMPERATURE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL
(Reserved, not supported yet) Indicates that the IVI system is at an extreme temperature.
- Value: **common.event.IVI_TEMPERATURE_ABNORMAL**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_VOLTAGE_RECOVERY
(Reserved, not supported yet) Indicates that the voltage of the vehicle's power system is restored to normal.
- Value: **common.event.IVI_VOLTAGE_RECOVERY**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_TEMPERATURE_RECOVERY
(Reserved, not supported yet) Indicates that the temperature of the IVI system is restored to normal.
- Value: **common.event.IVI_TEMPERATURE_RECOVERY**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_ACTIVE
(Reserved, not supported yet) Indicates that the battery service of the IVI system is active.
- Value: **common.event.IVI_ACTIVE**
- Required subscriber permissions: none
## COMMON_EVENT_USB_STATE<sup>9+</sup>
Indicates that the USB device state has changed.
- Value: **usual.event.hardware.usb.action.USB_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_USB_PORT_CHANGED<sup>9+</sup>
Indicates that the USB port state of the device has changed.
- Value: **usual.event.hardware.usb.action.USB_PORT_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_DEVICE_ATTACHED
Indicates that a USB device has been attached to the device functioning as a USB host.
- Value: **usual.event.hardware.usb.action.USB_DEVICE_ATTACHED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_DEVICE_DETACHED
Indicates that a USB device has been detached from the device functioning as a USB host.
- Value: **usual.event.hardware.usb.action.USB_DEVICE_DETACHED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_ACCESSORY_ATTACHED
(Reserved, not supported yet) Indicates that a USB accessory was attached.
- Value: **usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_ACCESSORY_DETACHED
(Reserved, not supported yet) Indicates that a USB accessory was detached.
- Value: **usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED**
- Required subscriber permissions: none
## COMMON_EVENT_DISK_REMOVED
(Reserved, not supported yet) Indicates that an external storage device was removed.
- Value: **usual.event.data.DISK_REMOVED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_UNMOUNTED
(Reserved, not supported yet) Indicates that an external storage device was unmounted.
- Value: **usual.event.data.DISK_UNMOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_MOUNTED
(Reserved, not supported yet) Indicates that an external storage device was mounted.
- Value: **usual.event.data.DISK_MOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_BAD_REMOVAL
(Reserved, not supported yet) Indicates that an external storage device was removed without being unmounted.
- Value: **usual.event.data.DISK_BAD_REMOVAL**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_UNMOUNTABLE
(Reserved, not supported yet) Indicates that an external storage device is unmountable when the card is inserted.
- Value: **usual.event.data.DISK_UNMOUNTABLE**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_EJECT
(Reserved, not supported yet) Indicates that an external storage device was ejected (at the software level).
- Value: **usual.event.data.DISK_EJECT**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_REMOVED<sup>9+</sup>
Indicates that an external storage device was removed.
- Value: **usual.event.data.VOLUME_REMOVED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_UNMOUNTED<sup>9+</sup>
Indicates that an external storage device was unmounted.
- Value: **usual.event.data.VOLUME_UNMOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_MOUNTED<sup>9+</sup>
Indicates that an external storage device was mounted.
- Value: **usual.event.data.VOLUME_MOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_BAD_REMOVAL<sup>9+</sup>
Indicates that an external storage device was removed without being unmounted.
- Value: **usual.event.data.VOLUME_BAD_REMOVAL**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_EJECT<sup>9+</sup>
Indicates that an external storage device was ejected (at the software level).
- **Value: usual.event.data.VOLUME_EJECT**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED
(Reserved, not supported yet) Indicates that the account visibility changed.
- Value: **usual.event.data.VISIBLE_ACCOUNTS_UPDATED**
- Required subscriber permissions: ohos.permission.GET_APP_ACCOUNTS
## COMMON_EVENT_ACCOUNT_DELETED
(Reserved, not supported yet) Indicates that an account was deleted.
- Value: **usual.event.data.ACCOUNT_DELETED**
- Required subscriber permissions: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
## COMMON_EVENT_FOUNDATION_READY
(Reserved, not supported yet) Indicates that the foundation is ready.
- Value: **usual.event.data.FOUNDATION_READY**
- Required subscriber permissions: ohos.permission.RECEIVER_STARTUP_COMPLETED
## COMMON_EVENT_AIRPLANE_MODE_CHANGED
Indicates that the airplane mode of the device has changed.
- Value: **usual.event.AIRPLANE_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_SPLIT_SCREEN<sup>8+</sup>
Indicates that the screen has been split.
- Value: **usual.event.SPLIT_SCREEN**
- Required subscriber permissions: none
## COMMON_EVENT_SLOT_CHANGE<sup>9+</sup>
Indicates that the notification slot has been updated.
- Value: **usual.event.SLOT_CHANGE**
- Required subscriber permissions: ohos.permission.NOTIFICATION_CONTROLLER
## COMMON_EVENT_SPN_INFO_CHANGED<sup>9+</sup>
Indicates that the SPN displayed has been updated.
- Value: **usual.event.SPN_INFO_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_QUICK_FIX_APPLY_RESULT<sup>9+</sup>
Indicates the result of applying a quick fix to the application.
- Value: **usual.event.QUICK_FIX_APPLY_RESULT**
- Required subscriber permissions: none
# System Common Events
This document provides indexes for system common events defined in OpenHarmony.
For details about the definition of a system common event, see [Support in @ohos.commonEventManager (Common Event)](./js-apis-commonEventManager.md#support).
**System capability**: SystemCapability.Notification.CommonEvent
## COMMON_EVENT_BOOT_COMPLETED
Indicates that the user has finished booting and the system has been loaded.
- Value: **usual.event.BOOT_COMPLETED**
- Required subscriber permissions: ohos.permission.RECEIVER_STARTUP_COMPLETED
## COMMON_EVENT_LOCKED_BOOT_COMPLETED
(Reserved, not supported yet) Indicates that the user has finished booting and the system has been loaded but the screen is still locked.
- Value: **usual.event.LOCKED_BOOT_COMPLETED**
- Required subscriber permissions: ohos.permission.RECEIVER_STARTUP_COMPLETED
## COMMON_EVENT_SHUTDOWN
Indicates that the device is being shut down and the final shutdown will proceed.
- Value: **usual.event.SHUTDOWN**
- Required subscriber permissions: none
## COMMON_EVENT_BATTERY_CHANGED
Indicates that the charging state, level, and other information about the battery have changed.
- Value: **usual.event.BATTERY_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_BATTERY_LOW
Indicates that the battery level is low.
- Value: **usual.event.BATTERY_LOW**
- Required subscriber permissions: none
## COMMON_EVENT_BATTERY_OKAY
Indicates that the battery level is normal.
- Value: **usual.event.BATTERY_OKAY**
- Required subscriber permissions: none
## COMMON_EVENT_POWER_CONNECTED
Indicates that the device is connected to an external power supply.
- Value: **usual.event.POWER_CONNECTED**
- Required subscriber permissions: none
## COMMON_EVENT_POWER_DISCONNECTED
Indicates that the device is disconnected from the external power supply.
- Value: **usual.event.POWER_DISCONNECTED**
- Required subscriber permissions: none
## COMMON_EVENT_SCREEN_OFF
Indicates that the device screen is off and the device is in sleep mode.
- Value: **usual.event.SCREEN_OFF**
- Required subscriber permissions: none
## COMMON_EVENT_SCREEN_ON
Indicates that the device screen is on and the device is in interactive state.
- Value: **usual.event.SCREEN_ON**
- Required subscriber permissions: none
## COMMON_EVENT_THERMAL_LEVEL_CHANGED<sup>8+</sup>
Indicates that the device's thermal level has changed.
- Value: **usual.event.THERMAL_LEVEL_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_PRESENT
(Reserved, not supported yet) Indicates that the user unlocks the device.
- Value: **usual.event.USER_PRESENT**
- Required subscriber permissions: none
## COMMON_EVENT_TIME_TICK
Indicates that the system time has changed as time ticks by.
- Value: **usual.event.TIME_TICK**
- Required subscriber permissions: none
## COMMON_EVENT_TIME_CHANGED
Indicates that the system time is set.
- Value: **usual.event.TIME_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_DATE_CHANGED
(Reserved, not supported yet) Indicates that the system date has changed.
- Value: **usual.event.DATE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_TIMEZONE_CHANGED
Indicates that the system time zone has changed.
- Value: **usual.event.TIMEZONE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_CLOSE_SYSTEM_DIALOGS
(Reserved, not supported yet) Indicates that the user closes a temporary system dialog box.
- Value: **usual.event.CLOSE_SYSTEM_DIALOGS**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_ADDED
Indicates that a new application package has been installed on the device.
- Value: **usual.event.PACKAGE_ADDED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_REPLACED
(Reserved, not supported yet) Indicates that a later version of an installed application package has replaced the previous one on the device.
- Value: **usual.event.PACKAGE_REPLACED**
- Required subscriber permissions: none
## COMMON_EVENT_MY_PACKAGE_REPLACED
(Reserved, not supported yet) Indicates that a later version of your application package has replaced the previous one.
- Value: **usual.event.MY_PACKAGE_REPLACED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_REMOVED
Indicates that an installed application has been uninstalled from the device with the application data retained.
- Value: **usual.event.PACKAGE_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_BUNDLE_REMOVED
(Reserved, not supported yet) Indicates that an installed bundle has been uninstalled from the device with the application data retained.
- Value: **usual.event.BUNDLE_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_FULLY_REMOVED
(Reserved, not supported yet) Indicates that an installed application, including both the application data and code, has been completely uninstalled from the device.
- Value: **usual.event.PACKAGE_FULLY_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_CHANGED
Indicates that an application package has been changed (for example, an ability in the package has been enabled or disabled).
- Value: **usual.event.PACKAGE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_RESTARTED
Indicates that the user closed all processes of the application and restarted the application.
- Value: **usual.event.PACKAGE_RESTARTED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_DATA_CLEARED
Indicates that the user cleared the application package data.
- Value: **usual.event.PACKAGE_DATA_CLEARED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_CACHE_CLEARED<sup>9+</sup>
Indicates that the user cleared the application package cache.
- Value: **usual.event.PACKAGE_CACHE_CLEARED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGES_SUSPENDED
(Reserved, not supported yet) Indicates that application HAP files are suspended.
- Value: **usual.event.PACKAGES_SUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGES_UNSUSPENDED
(Reserved, not supported yet) Indicates that application HAP files are not suspended (restored from the suspended state).
- Value: **usual.event.PACKAGES_UNSUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_MY_PACKAGE_SUSPENDED
Indicates that an application HAP file is suspended.
- Value: **usual.event.MY_PACKAGE_SUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_MY_PACKAGE_UNSUSPENDED
Indicates that an application HAP file is not suspended.
- Value: **usual.event.MY_PACKAGE_UNSUSPENDED**
- Required subscriber permissions: none
## COMMON_EVENT_UID_REMOVED
(Reserved, not supported yet) Indicates that a user ID has been removed from the system.
- Value: **usual.event.UID_REMOVED**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_FIRST_LAUNCH
(Reserved, not supported yet) Indicates that an installed application is started for the first time.
- Value: **usual.event.PACKAGE_FIRST_LAUNCH**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION
(Reserved, not supported yet) Indicates that an application requires system verification.
- Value: **usual.event.PACKAGE_NEEDS_VERIFICATION**
- Required subscriber permissions: none
## COMMON_EVENT_PACKAGE_VERIFIED
(Reserved, not supported yet) Indicates that an application has been verified by the system.
- Value: **usual.event.PACKAGE_VERIFIED**
- Required subscriber permissions: none
## COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE
(Reserved, not supported yet) Indicates that applications installed on the external storage are available for the system.
- Value: **usual.event.EXTERNAL_APPLICATIONS_AVAILABLE**
- Required subscriber permissions: none
## COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE
(Reserved, not supported yet) Indicates that applications installed on the external storage are not available for the system.
- Value: **usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE**
- Required subscriber permissions: none
## COMMON_EVENT_CONFIGURATION_CHANGED
(Reserved, not supported yet) Indicates that the device state (for example, orientation and locale) has changed.
- Value: **usual.event.CONFIGURATION_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_LOCALE_CHANGED
(Reserved, not supported yet) Indicates that the device locale has changed.
- Value: **usual.event.LOCALE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_MANAGE_PACKAGE_STORAGE
(Reserved, not supported yet) Indicates that the device storage is insufficient.
- Value: **usual.event.MANAGE_PACKAGE_STORAGE**
- Required subscriber permissions: none
## COMMON_EVENT_DRIVE_MODE
(Reserved, not supported yet) Indicates that the system is in driving mode.
- Value: **common.event.DRIVE_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_HOME_MODE
(Reserved, not supported yet) Indicates that the system is in home mode.
- Value: **common.event.HOME_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_OFFICE_MODE
(Reserved, not supported yet) Indicates that the system is in office mode.
- Value: **common.event.OFFICE_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_USER_STARTED
(Reserved, not supported yet) Indicates that the user has been started.
- Value: **usual.event.USER_STARTED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_BACKGROUND
(Reserved, not supported yet) Indicates that the user has been brought to the background.
- Value: **usual.event.USER_BACKGROUND**
- Required subscriber permissions: none
## COMMON_EVENT_USER_FOREGROUND
(Reserved, not supported yet) Indicates that the user has been brought to the foreground.
- Value: **usual.event.USER_FOREGROUND**
- Required subscriber permissions: none
## COMMON_EVENT_USER_SWITCHED
Indicates that user switching is in progress.
- Value: **usual.event.USER_SWITCHED**
- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_STARTING
(Reserved, not supported yet) Indicates that the user is being started.
- Value: **usual.event.USER_STARTING**
- Required subscriber permissions: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_UNLOCKED
(Reserved, not supported yet) Indicates that the credential-encrypted storage has been unlocked for the current user after the device is restarted.
- Value: **usual.event.USER_UNLOCKED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_STOPPING
(Reserved, not supported yet) Indicates that the user is going to be stopped.
- Value: **usual.event.USER_STOPPING**
- Required subscriber permissions: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_STOPPED
(Reserved, not supported yet) Indicates that the user has been stopped.
- Value: **usual.event.USER_STOPPED**
- Required subscriber permissions: none
## COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGIN
(Reserved, not supported yet) Indicates a successful login to a distributed account.
- Value: **usual.event.DISTRIBUTED_ACCOUNT_LOGIN**
- Required subscriber permissions: none
## COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT
(Reserved, not supported yet) Indicates a successful logout of a distributed account.
- Value: **usual.event.DISTRIBUTED_ACCOUNT_LOGOUT**
- Required subscriber permissions: none
## COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID
(Reserved, not supported yet) Indicates the token of a distributed account is invalid.
- Value: **usual.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID**
- Required subscriber permissions: none
## COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF
(Reserved, not supported yet) Indicates that a distributed account is deregistered.
- Value: **usual.event.DISTRIBUTED_ACCOUNT_LOGOFF**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_POWER_STATE
Indicates that the Wi-Fi state has changed, for example, enabled or disabled.
- Value: **usual.event.wifi.POWER_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_SCAN_FINISHED
Indicates that the Wi-Fi access point has been detected and proven to be available.
- Value: **usual.event.wifi.SCAN_FINISHED**
- Required subscriber permissions: ohos.permission.LOCATION
## COMMON_EVENT_WIFI_RSSI_VALUE
Indicates that the Wi-Fi signal strength (RSSI) has changed.
- Value: **usual.event.wifi.RSSI_VALUE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_CONN_STATE
Indicates that the Wi-Fi connection state has changed.
- Value: **usual.event.wifi.CONN_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_HOTSPOT_STATE
Indicates that the Wi-Fi hotspot state has changed, for example, enabled or disabled.
- Value: **usual.event.wifi.HOTSPOT_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_WIFI_AP_STA_JOIN
Indicates that a client has joined the Wi-Fi hotspot of the current device.
- Value: **usual.event.wifi.WIFI_HS_STA_JOIN**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_AP_STA_LEAVE
Indicates that a client has disconnected from the Wi-Fi hotspot of the current device.
- Value: **usual.event.wifi.WIFI_HS_STA_LEAVE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE
Indicates that the state of MPLINK (an enhanced Wi-Fi feature) has changed.
- Value: **usual.event.wifi.mplink.STATE_CHANGE**
- Required subscriber permissions: ohos.permission.MPLINK_CHANGE_STATE
## COMMON_EVENT_WIFI_P2P_CONN_STATE
Indicates that the Wi-Fi P2P connection state has changed.
- Value: **usual.event.wifi.p2p.CONN_STATE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
## COMMON_EVENT_WIFI_P2P_STATE_CHANGED
Indicates that the Wi-Fi P2P state has changed, for example, enabled or disabled.
- Value: **usual.event.wifi.p2p.STATE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED
Indicates that the state of the Wi-Fi P2P peer device has changed.
- Value: **usual.event.wifi.p2p.DEVICES_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED
Indicates that the Wi-Fi P2P discovery state has changed.
- Value: **usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED
Indicates that the state of the Wi-Fi P2P local device has changed.
- Value: **usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED
Indicates that the Wi-Fi P2P group information has changed.
- Value: **usual.event.wifi.p2p.GROUP_STATE_CHANGED**
- Required subscriber permissions: ohos.permission.GET_WIFI_INFO
## COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates the connection state of Bluetooth handsfree communication.
- Value: **usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE
(Reserved, not supported yet) Indicates that the device connected through Bluetooth handsfree is active.
- Value: **usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE
(Reserved, not supported yet) Indicates that the connection state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates the connection state of Bluetooth A2DP.
- Value: **usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE
(Reserved, not supported yet) Indicates that the device connected using Bluetooth A2DP is active.
- Value: **usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE
(Reserved, not supported yet) Indicates that the playing state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates that the AVRCP connection state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE
(Reserved, not supported yet) Indicates that the audio codec state of Bluetooth A2DP has changed.
- Value: **usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED
(Reserved, not supported yet) Indicates that a remote Bluetooth device is discovered.
- Value: **usual.event.bluetooth.remotedevice.DISCOVERED**
- Required subscriber permissions: ohos.permission.LOCATION and ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE
(Reserved, not supported yet) Indicates that the Bluetooth class of a remote Bluetooth device has changed.
- Value: **usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED
(Reserved, not supported yet) Indicates that a low-ACL connection with a remote Bluetooth device has been established.
- Value: **usual.event.bluetooth.remotedevice.ACL_CONNECTED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED
(Reserved, not supported yet) Indicates that the low-ACL connection with a remote Bluetooth device has been terminated.
- Value: **usual.event.bluetooth.remotedevice.ACL_DISCONNECTED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE
(Reserved, not supported yet) Indicates that the friendly name of a remote Bluetooth device is retrieved for the first time or has changed since the last retrieval.
- Value: **usual.event.bluetooth.remotedevice.NAME_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE
(Reserved, not supported yet) Indicates that the connection state with a remote Bluetooth device has changed.
- Value: **usual.event.bluetooth.remotedevice.PAIR_STATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE
(Reserved, not supported yet) Indicates that the battery level of a remote Bluetooth device is retrieved for the first time or has changed since the last retrieval.
- Value: **usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT
(Reserved, not supported yet) Indicates the SDP state of a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.SDP_RESULT**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE
(Reserved, not supported yet) Indicates the UUID connection state with a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.UUID_VALUE**
- Required subscriber permissions: ohos.permission.DISCOVER_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ
(Reserved, not supported yet) Indicates the pairing request from a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.PAIRING_REQ**
- Required subscriber permissions: ohos.permission.DISCOVER_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL
(Reserved, not supported yet) Indicates that Bluetooth pairing has been canceled.
- Value: **usual.event.bluetooth.remotedevice.PAIRING_CANCEL**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ
(Reserved, not supported yet) Indicates the connection request from a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.CONNECT_REQ**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY
(Reserved, not supported yet) Indicates the response to the connection request from a remote Bluetooth device.
- Value: **usual.event.bluetooth.remotedevice.CONNECT_REPLY**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL
(Reserved, not supported yet) Indicates that the connection to a remote Bluetooth device has been canceled.
- Value: **usual.event.bluetooth.remotedevice.CONNECT_CANCEL**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates that the connection state with a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE
(Reserved, not supported yet) Indicates that the audio state of a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT
(Reserved, not supported yet) Indicates that the audio gateway state of a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE
(Reserved, not supported yet) Indicates that the calling state of a Bluetooth handsfree has changed.
- Value: **usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE
(Reserved, not supported yet) Indicates that the state of a Bluetooth adapter has changed, for example, Bluetooth has been enabled or disabled.
- Value: **usual.event.bluetooth.host.STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE
(Reserved, not supported yet) Indicates the request for the user to allow Bluetooth device scanning.
- Value: **usual.event.bluetooth.host.REQ_DISCOVERABLE**
- Required subscriber permissions: none
## COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE
(Reserved, not supported yet) Indicates the request for the user to enable Bluetooth.
- Value: **usual.event.bluetooth.host.REQ_ENABLE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE
(Reserved, not supported yet) Indicates the request for the user to disable Bluetooth.
- Value: **usual.event.bluetooth.host.REQ_DISABLE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE
(Reserved, not supported yet) Indicates that the Bluetooth scanning mode of the device has changed.
- Value: **usual.event.bluetooth.host.SCAN_MODE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED
(Reserved, not supported yet) Indicates that Bluetooth scanning has been started on the device.
- Value: **usual.event.bluetooth.host.DISCOVERY_STARTED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED
(Reserved, not supported yet) Indicates that Bluetooth scanning is finished on the device.
- Value: **usual.event.bluetooth.host.DISCOVERY_FINISHED**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE
(Reserved, not supported yet) Indicates that the Bluetooth adapter name of the device has changed.
- Value: **usual.event.bluetooth.host.NAME_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE
(Reserved, not supported yet) Indicates that the connection state of Bluetooth A2DP Sink has changed.
- Value: **usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE
(Reserved, not supported yet) Indicates that the playing state of Bluetooth A2DP Sink has changed.
- Value: **usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE
(Reserved, not supported yet) Indicates that the audio state of Bluetooth A2DP Sink has changed.
- Value: **usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE**
- Required subscriber permissions: ohos.permission.USE_BLUETOOTH
## COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED
(Reserved, not supported yet) Indicates that the state of the device NFC adapter has changed.
- Value: **usual.event.nfc.action.ADAPTER_STATE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED
(Reserved, not supported yet) Indicates that the NFC RF field is detected to be in the enabled state.
- Value: **usual.event.nfc.action.RF_FIELD_ON_DETECTED**
- Required subscriber permissions: ohos.permission.MANAGE_SECURE_SETTINGS
## COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED
(Reserved, not supported yet) Indicates that the NFC RF field is detected to be in the disabled state.
- Value: **usual.event.nfc.action.RF_FIELD_OFF_DETECTED**
- Required subscriber permissions: ohos.permission.MANAGE_SECURE_SETTINGS
## COMMON_EVENT_DISCHARGING
Indicates that the system stops charging the battery.
- Value: **usual.event.DISCHARGING**
- Required subscriber permissions: none
## COMMON_EVENT_CHARGING
Indicates that the system starts charging the battery.
- Value: **usual.event.CHARGING**
- Required subscriber permissions: none
## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
(Reserved, not supported yet) Indicates that the system idle mode has changed.
- Value: **usual.event.DEVICE_IDLE_MODE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_POWER_SAVE_MODE_CHANGED
Indicates that the system power saving mode has changed.
- Value: **usual.event.POWER_SAVE_MODE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_USER_ADDED
Indicates that a user has been added to the system.
- Value: **usual.event.USER_ADDED**
- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
## COMMON_EVENT_USER_REMOVED
Indicates that a user has been removed from the system.
- Value: **usual.event.USER_REMOVED**
- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
## COMMON_EVENT_ABILITY_ADDED
(Reserved, not supported yet) Indicates that an ability has been added.
- Value: **usual.event.ABILITY_ADDED**
- Required subscriber permissions: ohos.permission.LISTEN_BUNDLE_CHANGE
## COMMON_EVENT_ABILITY_REMOVED
(Reserved, not supported yet) Indicates that an ability has been removed.
- Value: **usual.event.ABILITY_REMOVED**
- Required subscriber permissions: ohos.permission.LISTEN_BUNDLE_CHANGE
## COMMON_EVENT_ABILITY_UPDATED
(Reserved, not supported yet) Indicates that an ability has been updated.
- Value: **usual.event.ABILITY_UPDATED**
- Required subscriber permissions: ohos.permission.LISTEN_BUNDLE_CHANGE
## COMMON_EVENT_LOCATION_MODE_STATE_CHANGED
(Reserved, not supported yet) Indicates that the location mode of the system has changed.
- Value: **usual.event.location.MODE_STATE_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_SLEEP
(Reserved, not supported yet) Indicates that the in-vehicle infotainment (IVI) system is in sleep mode.
- Value: **common.event.IVI_SLEEP**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_PAUSE
(Reserved, not supported yet) Indicates that the IVI system as entered sleep mode and instructs the playing application to stop playback.
- Value: **common.event.IVI_PAUSE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_STANDBY
(Reserved, not supported yet) Requests a third-party application in the IVI system to pause the current work.
- Value: **common.event.IVI_STANDBY**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_LASTMODE_SAVE
(Reserved, not supported yet) Requests a third-party application in the IVI system to save its last mode.
- Value: **common.event.IVI_LASTMODE_SAVE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_VOLTAGE_ABNORMAL
(Reserved, not supported yet) Indicates that the voltage of the vehicle's power system is abnormal.
- Value: **common.event.IVI_VOLTAGE_ABNORMAL**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_HIGH_TEMPERATURE
(Reserved, not supported yet) Indicates that the temperature of the IVI system is high.
- Value: **common.event.IVI_HIGH_TEMPERATURE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_EXTREME_TEMPERATURE
(Reserved, not supported yet) Indicates that the temperature of the IVI system is extremely high.
- Value: **common.event.IVI_EXTREME_TEMPERATURE**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL
(Reserved, not supported yet) Indicates that the IVI system is at an extreme temperature.
- Value: **common.event.IVI_TEMPERATURE_ABNORMAL**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_VOLTAGE_RECOVERY
(Reserved, not supported yet) Indicates that the voltage of the vehicle's power system is restored to normal.
- Value: **common.event.IVI_VOLTAGE_RECOVERY**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_TEMPERATURE_RECOVERY
(Reserved, not supported yet) Indicates that the temperature of the IVI system is restored to normal.
- Value: **common.event.IVI_TEMPERATURE_RECOVERY**
- Required subscriber permissions: none
## COMMON_EVENT_IVI_ACTIVE
(Reserved, not supported yet) Indicates that the battery service of the IVI system is active.
- Value: **common.event.IVI_ACTIVE**
- Required subscriber permissions: none
## COMMON_EVENT_USB_STATE<sup>9+</sup>
Indicates that the USB device state has changed.
- Value: **usual.event.hardware.usb.action.USB_STATE**
- Required subscriber permissions: none
## COMMON_EVENT_USB_PORT_CHANGED<sup>9+</sup>
Indicates that the USB port state of the device has changed.
- Value: **usual.event.hardware.usb.action.USB_PORT_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_DEVICE_ATTACHED
Indicates that a USB device has been attached to the device functioning as a USB host.
- Value: **usual.event.hardware.usb.action.USB_DEVICE_ATTACHED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_DEVICE_DETACHED
Indicates that a USB device has been detached from the device functioning as a USB host.
- Value: **usual.event.hardware.usb.action.USB_DEVICE_DETACHED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_ACCESSORY_ATTACHED
(Reserved, not supported yet) Indicates that a USB accessory was attached.
- Value: **usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED**
- Required subscriber permissions: none
## COMMON_EVENT_USB_ACCESSORY_DETACHED
(Reserved, not supported yet) Indicates that a USB accessory was detached.
- Value: **usual.event.data.DISK_MOUNTED**
- Required subscriber permissions: none
## COMMON_EVENT_DISK_REMOVED
(Reserved, not supported yet) Indicates that an external storage device was removed.
- Value: **usual.event.data.DISK_BAD_REMOVAL**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_UNMOUNTED
(Reserved, not supported yet) Indicates that an external storage device was unmounted.
- Value: **usual.event.data.DISK_UNMOUNTABLE**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_MOUNTED
(Reserved, not supported yet) Indicates that an external storage device was mounted.
- Value: **usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_BAD_REMOVAL
(Reserved, not supported yet) Indicates that an external storage device was removed without being unmounted.
- Value: usual.event.data.DISK_REMOVED
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_UNMOUNTABLE
(Reserved, not supported yet) Indicates that an external storage device is unmountable when the card is inserted.
- Value: **usual.event.data.DISK_UNMOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_DISK_EJECT
(Reserved, not supported yet) Indicates that an external storage device was ejected (at the software level).
- Value: **usual.event.data.DISK_EJECT**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_REMOVED<sup>9+</sup>
Indicates that an external storage device was removed.
- Value: **usual.event.data.VOLUME_REMOVED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_UNMOUNTED<sup>9+</sup>
Indicates that an external storage device was unmounted.
- Value: **usual.event.data.VOLUME_UNMOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_MOUNTED<sup>9+</sup>
Indicates that an external storage device was mounted.
- Value: **usual.event.data.VOLUME_MOUNTED**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_BAD_REMOVAL<sup>9+</sup>
Indicates that an external storage device was removed without being unmounted.
- Value: **usual.event.data.VOLUME_BAD_REMOVAL**
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VOLUME_EJECT<sup>9+</sup>
Indicates that an external storage device was ejected (at the software level).
- Value: usual.event.data.VOLUME_EJECT
- Required subscriber permissions: ohos.permission.STORAGE_MANAGER
## COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED
(Reserved, not supported yet) Indicates that the account visibility changed.
- Value: **usual.event.data.VISIBLE_ACCOUNTS_UPDATED**
- Required subscriber permissions: ohos.permission.GET_APP_ACCOUNTS
## COMMON_EVENT_ACCOUNT_DELETED
(Reserved, not supported yet) Indicates that an account was deleted.
- Value: **usual.event.data.ACCOUNT_DELETED**
- Required subscriber permissions: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
## COMMON_EVENT_FOUNDATION_READY
(Reserved, not supported yet) Indicates that the foundation is ready.
- Value: **usual.event.data.FOUNDATION_READY**
- Required subscriber permissions: ohos.permission.RECEIVER_STARTUP_COMPLETED
## COMMON_EVENT_AIRPLANE_MODE_CHANGED
Indicates that the airplane mode of the device has changed.
- Value: **usual.event.AIRPLANE_MODE**
- Required subscriber permissions: none
## COMMON_EVENT_SPLIT_SCREEN
Indicates that the screen has been split.
- Value: **usual.event.SPLIT_SCREEN**
- Required subscriber permissions: ohos.permission.RECEIVER_SPLIT_SCREEN
## COMMON_EVENT_SLOT_CHANGE<sup>9+</sup>
Indicates that the notification slot has been updated.
- Value: **usual.event.SLOT_CHANGE**
- Required subscriber permissions: ohos.permission.NOTIFICATION_CONTROLLER
## COMMON_EVENT_SPN_INFO_CHANGED<sup>9+</sup>
Indicates that the SPN displayed has been updated.
- Value: **usual.event.SPN_INFO_CHANGED**
- Required subscriber permissions: none
## COMMON_EVENT_QUICK_FIX_APPLY_RESULT<sup>9+</sup>
Indicates the result of applying a quick fix to the application.
- Value: **usual.event.QUICK_FIX_APPLY_RESULT**
- Required subscriber permissions: none
## COMMON_EVENT_USER_INFO_UPDATED<sup>9+</sup>
Indicates that the HTTP proxy configuration has changed.
- Value: **usual.event.USER_INFO_UPDATED**
- Required subscriber permissions: none
# @ohos.commonEvent # @ohos.commonEvent (Common Event)
The **CommonEvent** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data. The **CommonEvent** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data.
> **NOTE** > **NOTE**
> - The APIs provided by this module are no longer maintained since API version 9. You are advised to use [@ohos.commonEventManager](js-apis-commonEventManager.md). > - The APIs provided by this module are no longer maintained since API version 9. You are advised to use [@ohos.commonEventManager](js-apis-commonEventManager.md).
>
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -14,164 +15,9 @@ import CommonEvent from '@ohos.commonEvent'; ...@@ -14,164 +15,9 @@ import CommonEvent from '@ohos.commonEvent';
## Support ## Support
The table below lists the event types supported by the **CommonEvent** module. The name and value indicate the macro and name of a common event, respectively. A system common event is an event that is published by a system service or system application and requires specific permissions to subscribe to. To publish or subscribe to this type of event, you must follow the event-specific definitions.
**System capability**: SystemCapability.Notification.CommonEvent
| Name | Value | Subscriber Permission | Description |
| ------------ | ------------------ | ---------------------- | -------------------- |
| COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the user has finished booting and the system has been loaded. |
| COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the user has finished booting and the system has been loaded but the screen is still locked. |
| COMMON_EVENT_SHUTDOWN | usual.event.SHUTDOWN | - | Indicates the common event that the device is being shut down and the final shutdown will proceed. |
| COMMON_EVENT_BATTERY_CHANGED | usual.event.BATTERY_CHANGED | - | Indicates the common event that the charging state, level, and other information about the battery have changed. |
| COMMON_EVENT_BATTERY_LOW | usual.event.BATTERY_LOW | - | Indicates the common event that the battery level is low. |
| COMMON_EVENT_BATTERY_OKAY | usual.event.BATTERY_OKAY | - | Indicates the common event that the battery exits the low state. |
| COMMON_EVENT_POWER_CONNECTED | usual.event.POWER_CONNECTED | - | Indicates the common event that the device is connected to an external power supply. |
| COMMON_EVENT_POWER_DISCONNECTED | usual.event.POWER_DISCONNECTED | - | Indicates the common event that the device is disconnected from the external power supply. |
| COMMON_EVENT_SCREEN_OFF | usual.event.SCREEN_OFF | - | Indicates the common event that the device screen is off and the device is sleeping. |
| COMMON_EVENT_SCREEN_ON | usual.event.SCREEN_ON | - | Indicates the common event that the device screen is on and the device is in interactive state. |
| COMMON_EVENT_THERMAL_LEVEL_CHANGED<sup>8+<sup> | usual.event.THERMAL_LEVEL_CHANGED | - | Indicates the common event that the device's thermal level has changed. |
| COMMON_EVENT_USER_PRESENT | usual.event.USER_PRESENT | - | Indicates the common event that the user unlocks the device. |
| COMMON_EVENT_TIME_TICK | usual.event.TIME_TICK | - | Indicates the common event that the system time has changed. |
| COMMON_EVENT_TIME_CHANGED | usual.event.TIME_CHANGED | - | Indicates the common event that the system time is set. |
| COMMON_EVENT_DATE_CHANGED | usual.event.DATE_CHANGED | - | Indicates the common event that the system time has changed. |
| COMMON_EVENT_TIMEZONE_CHANGED | usual.event.TIMEZONE_CHANGED | - | Indicates the common event that the system time zone has changed. |
| COMMON_EVENT_CLOSE_SYSTEM_DIALOGS | usual.event.CLOSE_SYSTEM_DIALOGS | - | Indicates the common event that a user closes a temporary system dialog box. |
| COMMON_EVENT_PACKAGE_ADDED | usual.event.PACKAGE_ADDED | - | Indicates the common event that a new application package has been installed on the device. |
| COMMON_EVENT_PACKAGE_REPLACED | usual.event.PACKAGE_REPLACED | - | Indicates the common event that a later version of an installed application package has replaced the previous one on the device. |
| COMMON_EVENT_MY_PACKAGE_REPLACED | usual.event.MY_PACKAGE_REPLACED | - | Indicates the common event that a later version of your application package has replaced the previous one.
| COMMON_EVENT_PACKAGE_REMOVED | usual.event.PACKAGE_REMOVED | - | Indicates the common event that an installed application has been uninstalled from the device with the application data retained. |
| COMMON_EVENT_BUNDLE_REMOVED | usual.event.BUNDLE_REMOVED | - | Indicates the common event that an installed bundle has been uninstalled from the device with the application data retained. |
| COMMON_EVENT_PACKAGE_FULLY_REMOVED | usual.event.PACKAGE_FULLY_REMOVED | - | Indicates the common event that an installed application, including both the application data and code, has been completely uninstalled from the device. |
| COMMON_EVENT_PACKAGE_CHANGED | usual.event.PACKAGE_CHANGED | - | Indicates the common event that an application package has been changed (for example, a component in the package has been enabled or disabled). |
| COMMON_EVENT_PACKAGE_RESTARTED | usual.event.PACKAGE_RESTARTED | - | Indicates the common event that the user has restarted the application package and killed all its processes. |
| COMMON_EVENT_PACKAGE_DATA_CLEARED | usual.event.PACKAGE_DATA_CLEARED | - | Indicates the common event that the user has cleared the application package data. |
| COMMON_EVENT_PACKAGE_CACHE_CLEARED<sup>9+</sup> | usual.event.PACKAGE_CACHE_CLEARED | - | Indicates the common event that the user clears the application package cache. |
| COMMON_EVENT_PACKAGES_SUSPENDED | usual.event.PACKAGES_SUSPENDED | - | Indicates the common event that application packages have been suspended. |
| COMMON_EVENT_PACKAGES_UNSUSPENDED | usual.event.PACKAGES_UNSUSPENDED | - | Indicates the common event that application packages have not been suspended. |
| COMMON_EVENT_MY_PACKAGE_SUSPENDED | usual.event.MY_PACKAGE_SUSPENDED | - | Indicates the common event that an application package has been suspended. |
| COMMON_EVENT_MY_PACKAGE_UNSUSPENDED | usual.event.MY_PACKAGE_UNSUSPENDED | - | Indicates the common event that application package has not been suspended. |
| COMMON_EVENT_UID_REMOVED | usual.event.UID_REMOVED | - | Indicates the common event that a user ID has been removed from the system. |
| COMMON_EVENT_PACKAGE_FIRST_LAUNCH | usual.event.PACKAGE_FIRST_LAUNCH | - | Indicates the common event that an installed application is started for the first time. |
| COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION | usual.event.PACKAGE_NEEDS_VERIFICATION | - | Indicates the common event that an application requires system verification. |
| COMMON_EVENT_PACKAGE_VERIFIED | usual.event.PACKAGE_VERIFIED | - | Indicates the common event that an application has been verified by the system. |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE | usual.event.EXTERNAL_APPLICATIONS_AVAILABLE | - | Indicates the common event that applications installed on the external storage become available for the system. |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE | usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE | - | Indicates the common event that applications installed on the external storage become unavailable for the system. |
| COMMON_EVENT_CONFIGURATION_CHANGED | usual.event.CONFIGURATION_CHANGED | - | Indicates the common event that the device state (for example, orientation and locale) has changed. |
| COMMON_EVENT_LOCALE_CHANGED | usual.event.LOCALE_CHANGED | - | Indicates the common event that the device locale has changed. |
| COMMON_EVENT_MANAGE_PACKAGE_STORAGE | usual.event.MANAGE_PACKAGE_STORAGE | - | Indicates the common event that the device storage is insufficient. |
| COMMON_EVENT_DRIVE_MODE | common.event.DRIVE_MODE | - | Indicates the common event that the system is in driving mode. |
| COMMON_EVENT_HOME_MODE | common.event.HOME_MODE | - | Indicates the common event that the system is in home mode. |
| COMMON_EVENT_OFFICE_MODE | common.event.OFFICE_MODE | - | Indicates the common event that the system is in office mode. |
| COMMON_EVENT_USER_STARTED | usual.event.USER_STARTED | - | Indicates the common event that the user has been started. |
| COMMON_EVENT_USER_BACKGROUND | usual.event.USER_BACKGROUND | - | Indicates the common event that the user has been brought to the background. |
| COMMON_EVENT_USER_FOREGROUND | usual.event.USER_FOREGROUND | - | Indicates the common event that the user has been brought to the foreground. |
| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that user switching is happening. |
| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the user is going to be started. |
| COMMON_EVENT_USER_UNLOCKED | usual.event.USER_UNLOCKED | - | Indicates the common event that the credential-encrypted storage has been unlocked for the current user when the device is unlocked after being restarted. |
| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the user is going to be stopped. |
| COMMON_EVENT_USER_STOPPED | usual.event.USER_STOPPED | - | Indicates the common event that the user has been stopped. |
| COMMON_EVENT_WIFI_POWER_STATE | usual.event.wifi.POWER_STATE | - | Indicates the common event about the Wi-Fi network state, such as enabled and disabled. |
| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION | Indicates the common event that the Wi-Fi access point has been scanned and proven to be available. |
| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi signal strength (RSSI) has changed. |
| COMMON_EVENT_WIFI_CONN_STATE | usual.event.wifi.CONN_STATE | - | Indicates the common event that the Wi-Fi connection state has changed. |
| COMMON_EVENT_WIFI_HOTSPOT_STATE | usual.event.wifi.HOTSPOT_STATE | - | Indicates the common event about the Wi-Fi hotspot state, such as enabled or disabled. |
| COMMON_EVENT_WIFI_AP_STA_JOIN | usual.event.wifi.WIFI_HS_STA_JOIN | ohos.permission.GET_WIFI_INFO | Indicates the common event that a client has joined the Wi-Fi hotspot of the current device. |
| COMMON_EVENT_WIFI_AP_STA_LEAVE | usual.event.wifi.WIFI_HS_STA_LEAVE | ohos.permission.GET_WIFI_INFO |Indicates the common event that a client has disconnected from the Wi-Fi hotspot of the current device. |
| COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE | usual.event.wifi.mplink.STATE_CHANGE | ohos.permission.MPLINK_CHANGE_STATE | Indicates the common event that the state of MPLINK (an enhanced Wi-Fi feature) has changed. |
| COMMON_EVENT_WIFI_P2P_CONN_STATE | usual.event.wifi.p2p.CONN_STATE_CHANGE | ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION | Indicates the common event that the Wi-Fi P2P connection state has changed. |
| COMMON_EVENT_WIFI_P2P_STATE_CHANGED | usual.event.wifi.p2p.STATE_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the Wi-Fi P2P state, such as enabled and disabled. |
| COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED | usual.event.wifi.p2p.DEVICES_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the status change of Wi-Fi P2P peer devices. |
| COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED | usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the Wi-Fi P2P discovery status change. |
| COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED | usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the status change of the Wi-Fi P2P local device. |
| COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED | usual.event.wifi.p2p.GROUP_STATE_CHANGED | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi P2P group information has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the connection state of Bluetooth handsfree communication. |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the device connected to the Bluetooth handsfree is active. |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the connection state of Bluetooth A2DP. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the device connected using Bluetooth A2DP is active. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the playing state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the AVRCP connection state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE | usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the audio codec state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED | usual.event.bluetooth.remotedevice.DISCOVERED | ohos.permission.LOCATION and ohos.permission.USE_BLUETOOTH | Indicates the common event that a remote Bluetooth device is discovered. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE | usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth class of a remote Bluetooth device has changed. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED | usual.event.bluetooth.remotedevice.ACL_CONNECTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that a low-ACL connection has been established with a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED | usual.event.bluetooth.remotedevice.ACL_DISCONNECTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that a low-ACL connection has been disconnected from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE | usual.event.bluetooth.remotedevice.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the friendly name of a remote Bluetooth device is retrieved for the first time or is changed since the last retrieval. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE | usual.event.bluetooth.remotedevice.PAIR_STATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of a remote Bluetooth device has changed. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE | usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the battery level of a remote Bluetooth device is retrieved for the first time or is changed since the last retrieval. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT | usual.event.bluetooth.remotedevice.SDP_RESULT | - | Indicates the common event about the SDP state of a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE | usual.event.bluetooth.remotedevice.UUID_VALUE | ohos.permission.DISCOVER_BLUETOOTH | Indicates the common event about the UUID connection state of a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ | usual.event.bluetooth.remotedevice.PAIRING_REQ | ohos.permission.DISCOVER_BLUETOOTH | Indicates the common event about the pairing request from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL | usual.event.bluetooth.remotedevice.PAIRING_CANCEL | - | Indicates the common event that Bluetooth pairing is canceled. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ | usual.event.bluetooth.remotedevice.CONNECT_REQ | - | Indicates the common event about the connection request from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY | usual.event.bluetooth.remotedevice.CONNECT_REPLY | - | Indicates the common event about the response to the connection request from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL | usual.event.bluetooth.remotedevice.CONNECT_CANCEL | - | Indicates the common event that the connection to a remote Bluetooth device has been canceled. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE | - | Indicates the common event that the connection state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE | - | Indicates the common event that the audio state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT | usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT | - | Indicates the common event that the audio gateway state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE | - | Indicates the common event that the calling state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE | usual.event.bluetooth.host.STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the state of a Bluetooth adapter has been changed, for example, Bluetooth has been enabled or disabled. |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE | usual.event.bluetooth.host.REQ_DISCOVERABLE | - | Indicates the common event about the request for the user to allow Bluetooth device scanning. |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE | usual.event.bluetooth.host.REQ_ENABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to enable Bluetooth. |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE | usual.event.bluetooth.host.REQ_DISABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to disable Bluetooth. |
| COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE | usual.event.bluetooth.host.SCAN_MODE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning mode of a device has changed. |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED | usual.event.bluetooth.host.DISCOVERY_STARTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning has been started on the device. |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED | usual.event.bluetooth.host.DISCOVERY_FINISHED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning is finished on the device. |
| COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE | usual.event.bluetooth.host.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth adapter name of the device has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of Bluetooth A2DP Sink has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the playing state of Bluetooth A2DP Sink has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE | usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the audio state of Bluetooth A2DP Sink has changed. |
| COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED | usual.event.nfc.action.ADAPTER_STATE_CHANGED | - | Indicates the common event that the state of the device's NFC adapter has changed. |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED | usual.event.nfc.action.RF_FIELD_ON_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the enabled state. |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED | usual.event.nfc.action.RF_FIELD_OFF_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the disabled state. |
| COMMON_EVENT_DISCHARGING | usual.event.DISCHARGING | - | Indicates the common event that the system stops charging the battery. |
| COMMON_EVENT_CHARGING | usual.event.CHARGING | - | Indicates the common event that the system starts charging the battery. |
| COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED | usual.event.DEVICE_IDLE_MODE_CHANGED | - | Indicates the common event that the system idle mode has changed. |
| COMMON_EVENT_POWER_SAVE_MODE_CHANGED | usual.event.POWER_SAVE_MODE_CHANGED | - | Indicates the common event that the power saving mode of the system has changed. |
| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that a user has been added to the system. |
| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that a user has been removed from the system. |
| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been added. |
| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been removed. |
| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been updated. |
| COMMON_EVENT_LOCATION_MODE_STATE_CHANGED | usual.event.location.MODE_STATE_CHANGED | - | Indicates the common event that the location mode of the system has changed. |
| COMMON_EVENT_IVI_SLEEP | common.event.IVI_SLEEP | - | Indicates the common event that the in-vehicle infotainment (IVI) system of a vehicle is sleeping. |
| COMMON_EVENT_IVI_PAUSE | common.event.IVI_PAUSE | - | Indicates the common event that the IVI system of a vehicle has entered sleep mode and the playing application is instructed to stop playback. |
| COMMON_EVENT_IVI_STANDBY | common.event.IVI_STANDBY | - | Indicates the common event that a third-party application is instructed to pause the current work. |
| COMMON_EVENT_IVI_LASTMODE_SAVE | common.event.IVI_LASTMODE_SAVE | - | Indicates the common event that a third-party application is instructed to save its last mode. |
| COMMON_EVENT_IVI_VOLTAGE_ABNORMAL | common.event.IVI_VOLTAGE_ABNORMAL | - | Indicates the common event that the voltage of the vehicle's power system is abnormal. |
| COMMON_EVENT_IVI_HIGH_TEMPERATURE | common.event.IVI_HIGH_TEMPERATURE | - | Indicates the common event that the temperature of the IVI system is high. |
| COMMON_EVENT_IVI_EXTREME_TEMPERATURE | common.event.IVI_EXTREME_TEMPERATURE | - | Indicates the common event that the temperature of the IVI system is extremely high. |
| COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL | common.event.IVI_TEMPERATURE_ABNORMAL | - | Indicates the common event that the IVI system has an extreme temperature. |
| COMMON_EVENT_IVI_VOLTAGE_RECOVERY | common.event.IVI_VOLTAGE_RECOVERY | - | Indicates the common event that the voltage of the vehicle's power system is restored to normal. |
| COMMON_EVENT_IVI_TEMPERATURE_RECOVERY | common.event.IVI_TEMPERATURE_RECOVERY | - | Indicates the common event that the temperature of the IVI system is restored to normal. |
| COMMON_EVENT_IVI_ACTIVE | common.event.IVI_ACTIVE | - | Indicates the common event that the battery service is active. |
|COMMON_EVENT_USB_STATE<sup>9+</sup> | usual.event.hardware.usb.action.USB_STATE | - | Indicates the common event that the USB device status has changed. |
|COMMON_EVENT_USB_PORT_CHANGED<sup>9+</sup> | usual.event.hardware.usb.action.USB_PORT_CHANGED | - | Indicates the common event that the USB port status of the user device has changed. |
| COMMON_EVENT_USB_DEVICE_ATTACHED | usual.event.hardware.usb.action.USB_DEVICE_ATTACHED | - | Indicates the common event that a USB device has been attached when the user device functions as a USB host. |
| COMMON_EVENT_USB_DEVICE_DETACHED | usual.event.hardware.usb.action.USB_DEVICE_DETACHED | - | Indicates the common event that a USB device has been detached when the user device functions as a USB host. |
| COMMON_EVENT_USB_ACCESSORY_ATTACHED | usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED | - | Indicates the common event that a USB accessory was attached. |
| COMMON_EVENT_USB_ACCESSORY_DETACHED | usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED | - | Indicates the common event that a USB accessory was detached. |
| COMMON_EVENT_DISK_REMOVED | usual.event.data.DISK_REMOVED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed. |
| COMMON_EVENT_DISK_UNMOUNTED | usual.event.data.DISK_UNMOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was unmounted. |
| COMMON_EVENT_DISK_MOUNTED | usual.event.data.DISK_MOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was mounted. |
| COMMON_EVENT_DISK_BAD_REMOVAL | usual.event.data.DISK_BAD_REMOVAL | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed without being unmounted. |
| COMMON_EVENT_DISK_UNMOUNTABLE | usual.event.data.DISK_UNMOUNTABLE | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device becomes unmountable. |
| COMMON_EVENT_DISK_EJECT | usual.event.data.DISK_EJECT | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was ejected. |
| COMMON_EVENT_VOLUME_REMOVED<sup>9+<sup> | usual.event.data.VOLUME_REMOVED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed. |
| COMMON_EVENT_VOLUME_UNMOUNTED<sup>9+<sup> | usual.event.data.VOLUME_UNMOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was unmounted. |
| COMMON_EVENT_VOLUME_MOUNTED<sup>9+<sup> | usual.event.data.VOLUME_MOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was mounted. |
| COMMON_EVENT_VOLUME_BAD_REMOVAL<sup>9+<sup> | usual.event.data.VOLUME_BAD_REMOVAL | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed without being unmounted. |
| COMMON_EVENT_VOLUME_EJECT<sup>9+<sup> | usual.event.data.VOLUME_EJECT | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was ejected. |
| COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED | usual.event.data.VISIBLE_ACCOUNTS_UPDATED | ohos.permission.GET_APP_ACCOUNTS | Indicates the common event that the account visibility changed. |
| COMMON_EVENT_ACCOUNT_DELETED | usual.event.data.ACCOUNT_DELETED | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the account was deleted. |
| COMMON_EVENT_FOUNDATION_READY | usual.event.data.FOUNDATION_READY | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the foundation is ready. |
| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | - | Indicates the common event that the airplane mode of the device has changed. |
| COMMON_EVENT_SPLIT_SCREEN<sup>8+<sup> | usual.event.SPLIT_SCREEN | - | Indicates the common event of screen splitting. |
| COMMON_EVENT_SLOT_CHANGE<sup>9+<sup> | usual.event.SLOT_CHANGE | ohos.permission.NOTIFICATION_CONTROLLER | Indicates the common event that the notification slot has been updated. |
| COMMON_EVENT_SPN_INFO_CHANGED <sup>9+<sup> | usual.event.SPN_INFO_CHANGED | - | Indicates the common event that the SPN displayed has been updated. |
| COMMON_EVENT_QUICK_FIX_APPLY_RESULT <sup>9+<sup> | usual.event.QUICK_FIX_APPLY_RESULT | - | Indicates the common event that a quick fix is applied to the application. |
For details about the definitions of all system common events, see [System Common Events](./commonEvent-definitions.md).
## CommonEvent.publish ## CommonEvent.publish
...@@ -229,7 +75,7 @@ Publishes a common event with given attributes. This API uses an asynchronous ca ...@@ -229,7 +75,7 @@ Publishes a common event with given attributes. This API uses an asynchronous ca
// Attributes of a common event. // Attributes of a common event.
let options = { let options = {
code: 0, // Result code of the common event. code: 0, // Result code of the common event.
data: "initial data";// Result data of the common event. data: "initial data",// Result data of the common event.
isOrdered: true // The common event is an ordered one. isOrdered: true // The common event is an ordered one.
} }
...@@ -313,7 +159,7 @@ Publishes a common event with given attributes to a specific user. This API uses ...@@ -313,7 +159,7 @@ Publishes a common event with given attributes to a specific user. This API uses
// Attributes of a common event. // Attributes of a common event.
let options = { let options = {
code: 0, // Result code of the common event. code: 0, // Result code of the common event.
data: "initial data";// Result data of the common event. data: "initial data",// Result data of the common event.
} }
// Callback for common event publication // Callback for common event publication
......
# @ohos.commonEventManager # @ohos.commonEventManager (Common Event)
The **CommonEventManager** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data. The **CommonEventManager** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data.
...@@ -14,168 +14,9 @@ import CommonEventManager from '@ohos.commonEventManager'; ...@@ -14,168 +14,9 @@ import CommonEventManager from '@ohos.commonEventManager';
## Support ## Support
The table below lists the event types supported by the **CommonEventManager** module. The name and value indicate the macro and name of a common event, respectively. A system common event is an event that is published by a system service or system application and requires specific permissions to subscribe to. To publish or subscribe to this type of event, you must follow the event-specific definitions.
**System capability**: SystemCapability.Notification.CommonEvent
| Name | Value | Subscriber Permission | Description |
| ------------ | ------------------ | ---------------------- | -------------------- |
| COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the user has finished booting and the system has been loaded. |
| COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the user has finished booting and the system has been loaded but the screen is still locked. |
| COMMON_EVENT_SHUTDOWN | usual.event.SHUTDOWN | - | Indicates the common event that the device is being shut down and the final shutdown will proceed. |
| COMMON_EVENT_BATTERY_CHANGED | usual.event.BATTERY_CHANGED | - | Indicates the common event that the charging state, level, and other information about the battery have changed. |
| COMMON_EVENT_BATTERY_LOW | usual.event.BATTERY_LOW | - | Indicates the common event that the battery level is low. |
| COMMON_EVENT_BATTERY_OKAY | usual.event.BATTERY_OKAY | - | Indicates the common event that the battery exits the low state. |
| COMMON_EVENT_POWER_CONNECTED | usual.event.POWER_CONNECTED | - | Indicates the common event that the device is connected to an external power supply. |
| COMMON_EVENT_POWER_DISCONNECTED | usual.event.POWER_DISCONNECTED | - | Indicates the common event that the device is disconnected from the external power supply. |
| COMMON_EVENT_SCREEN_OFF | usual.event.SCREEN_OFF | - | Indicates the common event that the device screen is off and the device is sleeping. |
| COMMON_EVENT_SCREEN_ON | usual.event.SCREEN_ON | - | Indicates the common event that the device screen is on and the device is in interactive state. |
| COMMON_EVENT_THERMAL_LEVEL_CHANGED | usual.event.THERMAL_LEVEL_CHANGED | - | Indicates the common event that the device's thermal level has changed. |
| COMMON_EVENT_USER_PRESENT | usual.event.USER_PRESENT | - | Indicates the common event that the user unlocks the device. |
| COMMON_EVENT_TIME_TICK | usual.event.TIME_TICK | - | Indicates the common event that the system time has changed. |
| COMMON_EVENT_TIME_CHANGED | usual.event.TIME_CHANGED | - | Indicates the common event that the system time is set. |
| COMMON_EVENT_DATE_CHANGED | usual.event.DATE_CHANGED | - | Indicates the common event that the system time has changed. |
| COMMON_EVENT_TIMEZONE_CHANGED | usual.event.TIMEZONE_CHANGED | - | Indicates the common event that the system time zone has changed. |
| COMMON_EVENT_CLOSE_SYSTEM_DIALOGS | usual.event.CLOSE_SYSTEM_DIALOGS | - | Indicates the common event that a user closes a temporary system dialog box. |
| COMMON_EVENT_PACKAGE_ADDED | usual.event.PACKAGE_ADDED | - | Indicates the common event that a new application package has been installed on the device. |
| COMMON_EVENT_PACKAGE_REPLACED | usual.event.PACKAGE_REPLACED | - | Indicates the common event that a later version of an installed application package has replaced the previous one on the device. |
| COMMON_EVENT_MY_PACKAGE_REPLACED | usual.event.MY_PACKAGE_REPLACED | - | Indicates the common event that a later version of your application package has replaced the previous one.
| COMMON_EVENT_PACKAGE_REMOVED | usual.event.PACKAGE_REMOVED | - | Indicates the common event that an installed application has been uninstalled from the device with the application data retained. |
| COMMON_EVENT_BUNDLE_REMOVED | usual.event.BUNDLE_REMOVED | - | Indicates the common event that an installed bundle has been uninstalled from the device with the application data retained. |
| COMMON_EVENT_PACKAGE_FULLY_REMOVED | usual.event.PACKAGE_FULLY_REMOVED | - | Indicates the common event that an installed application, including both the application data and code, has been completely uninstalled from the device. |
| COMMON_EVENT_PACKAGE_CHANGED | usual.event.PACKAGE_CHANGED | - | Indicates the common event that an application package has been changed (for example, a component in the package has been enabled or disabled). |
| COMMON_EVENT_PACKAGE_RESTARTED | usual.event.PACKAGE_RESTARTED | - | Indicates the common event that the user has restarted the application package and killed all its processes. |
| COMMON_EVENT_PACKAGE_DATA_CLEARED | usual.event.PACKAGE_DATA_CLEARED | - | Indicates the common event that the user has cleared the application package data. |
| COMMON_EVENT_PACKAGE_CACHE_CLEARED<sup>9+</sup> | usual.event.PACKAGE_CACHE_CLEARED | - | Indicates the common event that the user has cleared the application package data. |
| COMMON_EVENT_PACKAGES_SUSPENDED | usual.event.PACKAGES_SUSPENDED | - | Indicates the common event that application packages have been suspended. |
| COMMON_EVENT_PACKAGES_UNSUSPENDED | usual.event.PACKAGES_UNSUSPENDED | - | Indicates the common event that application package has not been suspended. |
| COMMON_EVENT_MY_PACKAGE_SUSPENDED | usual.event.MY_PACKAGE_SUSPENDED | - | Indicates the common event that an application package has been suspended. |
| COMMON_EVENT_MY_PACKAGE_UNSUSPENDED | usual.event.MY_PACKAGE_UNSUSPENDED | - | Indicates the common event that application package has not been suspended. |
| COMMON_EVENT_UID_REMOVED | usual.event.UID_REMOVED | - | Indicates the common event that a user ID has been removed from the system. |
| COMMON_EVENT_PACKAGE_FIRST_LAUNCH | usual.event.PACKAGE_FIRST_LAUNCH | - | Indicates the common event that an installed application is started for the first time. |
| COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION | usual.event.PACKAGE_NEEDS_VERIFICATION | - | Indicates the common event that an application requires system verification. |
| COMMON_EVENT_PACKAGE_VERIFIED | usual.event.PACKAGE_VERIFIED | - | Indicates the common event that an application has been verified by the system. |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE | usual.event.EXTERNAL_APPLICATIONS_AVAILABLE | - | Indicates the common event that applications installed on the external storage become available for the system. |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE | usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE | - | Indicates the common event that applications installed on the external storage become unavailable for the system. |
| COMMON_EVENT_CONFIGURATION_CHANGED | usual.event.CONFIGURATION_CHANGED | - | Indicates the common event that the device state (for example, orientation and locale) has changed. |
| COMMON_EVENT_LOCALE_CHANGED | usual.event.LOCALE_CHANGED | - | Indicates the common event that the device locale has changed. |
| COMMON_EVENT_MANAGE_PACKAGE_STORAGE | usual.event.MANAGE_PACKAGE_STORAGE | - | Indicates the common event that the device storage is insufficient. |
| COMMON_EVENT_DRIVE_MODE | common.event.DRIVE_MODE | - | Indicates the common event that the system is in driving mode. |
| COMMON_EVENT_HOME_MODE | common.event.HOME_MODE | - | Indicates the common event that the system is in home mode. |
| COMMON_EVENT_OFFICE_MODE | common.event.OFFICE_MODE | - | Indicates the common event that the system is in office mode. |
| COMMON_EVENT_USER_STARTED | usual.event.USER_STARTED | - | Indicates the common event that the user has been started. |
| COMMON_EVENT_USER_BACKGROUND | usual.event.USER_BACKGROUND | - | Indicates the common event that the user has been brought to the background. |
| COMMON_EVENT_USER_FOREGROUND | usual.event.USER_FOREGROUND | - | Indicates the common event that the user has been brought to the foreground. |
| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that user switching is happening. |
| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the user is going to be started. |
| COMMON_EVENT_USER_UNLOCKED | usual.event.USER_UNLOCKED | - | Indicates the common event that the credential-encrypted storage has been unlocked for the current user when the device is unlocked after being restarted. |
| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the user is going to be stopped. |
| COMMON_EVENT_USER_STOPPED | usual.event.USER_STOPPED | - | Indicates the common event that the user has been stopped. |
| COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGIN | usual.event.DISTRIBUTED_ACCOUNT_LOGIN | - | Indicates the action of successful login using a distributed account. |
| COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT | usual.event.DISTRIBUTED_ACCOUNT_LOGOUT | - | Indicates the action of successful logout of a distributed account. |
| COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID | usual.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID | - | Indicates the action when the token of a distributed account is invalid. |
| COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF | usual.event.DISTRIBUTED_ACCOUNT_LOGOFF | - | Indicates the action of deregistering a distributed account. |
| COMMON_EVENT_WIFI_POWER_STATE | usual.event.wifi.POWER_STATE | - | Indicates the common event about the Wi-Fi network state, such as enabled and disabled. |
| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION | Indicates the common event that the Wi-Fi access point has been scanned and proven to be available. |
| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi signal strength (RSSI) has changed. |
| COMMON_EVENT_WIFI_CONN_STATE | usual.event.wifi.CONN_STATE | - | Indicates the common event that the Wi-Fi connection state has changed. |
| COMMON_EVENT_WIFI_HOTSPOT_STATE | usual.event.wifi.HOTSPOT_STATE | - | Indicates the common event about the Wi-Fi hotspot state, such as enabled or disabled. |
| COMMON_EVENT_WIFI_AP_STA_JOIN | usual.event.wifi.WIFI_HS_STA_JOIN | ohos.permission.GET_WIFI_INFO | Indicates the common event that a client has joined the Wi-Fi hotspot of the current device. |
| COMMON_EVENT_WIFI_AP_STA_LEAVE | usual.event.wifi.WIFI_HS_STA_LEAVE | ohos.permission.GET_WIFI_INFO |Indicates the common event that a client has disconnected from the Wi-Fi hotspot of the current device. |
| COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE | usual.event.wifi.mplink.STATE_CHANGE | ohos.permission.MPLINK_CHANGE_STATE | Indicates the common event that the state of MPLINK (an enhanced Wi-Fi feature) has changed. |
| COMMON_EVENT_WIFI_P2P_CONN_STATE | usual.event.wifi.p2p.CONN_STATE_CHANGE | ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION | Indicates the common event that the Wi-Fi P2P connection state has changed. |
| COMMON_EVENT_WIFI_P2P_STATE_CHANGED | usual.event.wifi.p2p.STATE_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the Wi-Fi P2P state, such as enabled and disabled. |
| COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED | usual.event.wifi.p2p.DEVICES_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the status change of Wi-Fi P2P peer devices. |
| COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED | usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the Wi-Fi P2P discovery status change. |
| COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED | usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE | ohos.permission.GET_WIFI_INFO | Indicates the common event about the status change of the Wi-Fi P2P local device. |
| COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED | usual.event.wifi.p2p.GROUP_STATE_CHANGED | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi P2P group information has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the connection state of Bluetooth handsfree communication. |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the device connected to the Bluetooth handsfree is active. |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the connection state of Bluetooth A2DP. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the device connected using Bluetooth A2DP is active. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the playing state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the AVRCP connection state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE | usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the audio codec state of Bluetooth A2DP has changed. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED | usual.event.bluetooth.remotedevice.DISCOVERED | ohos.permission.LOCATION and ohos.permission.USE_BLUETOOTH | Indicates the common event that a remote Bluetooth device is discovered. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE | usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth class of a remote Bluetooth device has changed. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED | usual.event.bluetooth.remotedevice.ACL_CONNECTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that a low-ACL connection has been established with a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED | usual.event.bluetooth.remotedevice.ACL_DISCONNECTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that a low-ACL connection has been disconnected from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE | usual.event.bluetooth.remotedevice.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the friendly name of a remote Bluetooth device is retrieved for the first time or is changed since the last retrieval. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE | usual.event.bluetooth.remotedevice.PAIR_STATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of a remote Bluetooth device has changed. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE | usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the battery level of a remote Bluetooth device is retrieved for the first time or is changed since the last retrieval. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT | usual.event.bluetooth.remotedevice.SDP_RESULT | - | Indicates the common event about the SDP state of a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE | usual.event.bluetooth.remotedevice.UUID_VALUE | ohos.permission.DISCOVER_BLUETOOTH | Indicates the common event about the UUID connection state of a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ | usual.event.bluetooth.remotedevice.PAIRING_REQ | ohos.permission.DISCOVER_BLUETOOTH | Indicates the common event about the pairing request from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL | usual.event.bluetooth.remotedevice.PAIRING_CANCEL | - | Indicates the common event that Bluetooth pairing is canceled. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ | usual.event.bluetooth.remotedevice.CONNECT_REQ | - | Indicates the common event about the connection request from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY | usual.event.bluetooth.remotedevice.CONNECT_REPLY | - | Indicates the common event about the response to the connection request from a remote Bluetooth device. |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL | usual.event.bluetooth.remotedevice.CONNECT_CANCEL | - | Indicates the common event that the connection to a remote Bluetooth device has been canceled. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE | - | Indicates the common event that the connection state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE | - | Indicates the common event that the audio state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT | usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT | - | Indicates the common event that the audio gateway state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE | - | Indicates the common event that the calling state of a Bluetooth handsfree has changed. |
| COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE | usual.event.bluetooth.host.STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the state of a Bluetooth adapter has been changed, for example, Bluetooth has been enabled or disabled. |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE | usual.event.bluetooth.host.REQ_DISCOVERABLE | - | Indicates the common event about the request for the user to allow Bluetooth device scanning. |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE | usual.event.bluetooth.host.REQ_ENABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to enable Bluetooth. |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE | usual.event.bluetooth.host.REQ_DISABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to disable Bluetooth. |
| COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE | usual.event.bluetooth.host.SCAN_MODE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning mode of a device has changed. |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED | usual.event.bluetooth.host.DISCOVERY_STARTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning has been started on the device. |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED | usual.event.bluetooth.host.DISCOVERY_FINISHED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning is finished on the device. |
| COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE | usual.event.bluetooth.host.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth adapter name of the device has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of Bluetooth A2DP Sink has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the playing state of Bluetooth A2DP Sink has changed. |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE | usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the audio state of Bluetooth A2DP Sink has changed. |
| COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED | usual.event.nfc.action.ADAPTER_STATE_CHANGED | - | Indicates the common event that the state of the device's NFC adapter has changed. |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED | usual.event.nfc.action.RF_FIELD_ON_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the action of a common event that the NFC RF field is detected to be in the enabled state. |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED | usual.event.nfc.action.RF_FIELD_OFF_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the disabled state. |
| COMMON_EVENT_DISCHARGING | usual.event.DISCHARGING | - | Indicates the common event that the system stops charging the battery. |
| COMMON_EVENT_CHARGING | usual.event.CHARGING | - | Indicates the common event that the system starts charging the battery. |
| COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED | usual.event.DEVICE_IDLE_MODE_CHANGED | - | Indicates the common event that the system idle mode has changed. |
| COMMON_EVENT_POWER_SAVE_MODE_CHANGED | usual.event.POWER_SAVE_MODE_CHANGED | - | Indicates the common event that the power saving mode of the system has changed. |
| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that a user has been added to the system. |
| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that a user has been removed from the system. |
| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been added. |
| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been removed. |
| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been updated. |
| COMMON_EVENT_LOCATION_MODE_STATE_CHANGED | usual.event.location.MODE_STATE_CHANGED | - | Indicates the common event that the location mode of the system has changed. |
| COMMON_EVENT_IVI_SLEEP | common.event.IVI_SLEEP | - | Indicates the common event that the in-vehicle infotainment (IVI) system of a vehicle is sleeping. |
| COMMON_EVENT_IVI_PAUSE | common.event.IVI_PAUSE | - | Indicates the common event that the IVI system of a vehicle has entered sleep mode and the playing application is instructed to stop playback. |
| COMMON_EVENT_IVI_STANDBY | common.event.IVI_STANDBY | - | Indicates the common event that a third-party application is instructed to pause the current work. |
| COMMON_EVENT_IVI_LASTMODE_SAVE | common.event.IVI_LASTMODE_SAVE | - | Indicates the common event that a third-party application is instructed to save its last mode. |
| COMMON_EVENT_IVI_VOLTAGE_ABNORMAL | common.event.IVI_VOLTAGE_ABNORMAL | - | Indicates the common event that the voltage of the vehicle's power system is abnormal. |
| COMMON_EVENT_IVI_HIGH_TEMPERATURE | common.event.IVI_HIGH_TEMPERATURE | - | Indicates the common event that the temperature of the IVI system is high. |
| COMMON_EVENT_IVI_EXTREME_TEMPERATURE | common.event.IVI_EXTREME_TEMPERATURE | - | Indicates the common event that the temperature of the IVI system is extremely high. |
| COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL | common.event.IVI_TEMPERATURE_ABNORMAL | - | Indicates the common event that the IVI system has an extreme temperature. |
| COMMON_EVENT_IVI_VOLTAGE_RECOVERY | common.event.IVI_VOLTAGE_RECOVERY | - | Indicates the common event that the voltage of the vehicle's power system is restored to normal. |
| COMMON_EVENT_IVI_TEMPERATURE_RECOVERY | common.event.IVI_TEMPERATURE_RECOVERY | - | Indicates the common event that the temperature of the IVI system is restored to normal. |
| COMMON_EVENT_IVI_ACTIVE | common.event.IVI_ACTIVE | - | Indicates the common event that the battery service is active. |
|COMMON_EVENT_USB_STATE<sup>9+</sup> | usual.event.hardware.usb.action.USB_STATE | - | Indicates a common event indicating that the USB device status changes. |
|COMMON_EVENT_USB_PORT_CHANGED<sup>9+</sup> | usual.event.hardware.usb.action.USB_PORT_CHANGED | - | Indicates the public event that the USB port status of the user device changes. |
| COMMON_EVENT_USB_DEVICE_ATTACHED | usual.event.hardware.usb.action.USB_DEVICE_ATTACHED | - | Indicates the common event that a USB device has been attached when the user device functions as a USB host. |
| COMMON_EVENT_USB_DEVICE_DETACHED | usual.event.hardware.usb.action.USB_DEVICE_DETACHED | - | Indicates the common event that a USB device has been detached when the user device functions as a USB host. |
| COMMON_EVENT_USB_ACCESSORY_ATTACHED | usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED | - | Indicates the common event that a USB accessory was attached. |
| COMMON_EVENT_USB_ACCESSORY_DETACHED | usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED | - | Indicates the common event that a USB accessory was detached. |
| COMMON_EVENT_DISK_REMOVED | usual.event.data.DISK_REMOVED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed. |
| COMMON_EVENT_DISK_UNMOUNTED | usual.event.data.DISK_UNMOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was unmounted. |
| COMMON_EVENT_DISK_MOUNTED | usual.event.data.DISK_MOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was mounted. |
| COMMON_EVENT_DISK_BAD_REMOVAL | usual.event.data.DISK_BAD_REMOVAL | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed without being unmounted. |
| COMMON_EVENT_DISK_UNMOUNTABLE | usual.event.data.DISK_UNMOUNTABLE | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device becomes unmountable. |
| COMMON_EVENT_DISK_EJECT | usual.event.data.DISK_EJECT | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was ejected. |
| COMMON_EVENT_VOLUME_REMOVED<sup>9+<sup> | usual.event.data.VOLUME_REMOVED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed. |
| COMMON_EVENT_VOLUME_UNMOUNTED<sup>9+<sup> | usual.event.data.VOLUME_UNMOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was unmounted. |
| COMMON_EVENT_VOLUME_MOUNTED<sup>9+<sup> | usual.event.data.VOLUME_MOUNTED | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was mounted. |
| COMMON_EVENT_VOLUME_BAD_REMOVAL<sup>9+<sup> | usual.event.data.VOLUME_BAD_REMOVAL | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was removed without being unmounted. |
| COMMON_EVENT_VOLUME_EJECT<sup>9+<sup> | usual.event.data.VOLUME_EJECT | ohos.permission.STORAGE_MANAGER | Indicates the common event that an external storage device was ejected. |
| COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED | usual.event.data.VISIBLE_ACCOUNTS_UPDATED | ohos.permission.GET_APP_ACCOUNTS | Indicates the common event that the account visibility changed. |
| COMMON_EVENT_ACCOUNT_DELETED | usual.event.data.ACCOUNT_DELETED | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the account was deleted. |
| COMMON_EVENT_FOUNDATION_READY | usual.event.data.FOUNDATION_READY | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the foundation is ready. |
| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | - | Indicates the common event that the airplane mode of the device has changed. |
| COMMON_EVENT_SPLIT_SCREEN | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN | Indicates the common event of screen splitting. |
| COMMON_EVENT_SLOT_CHANGE<sup>9+<sup> | usual.event.SLOT_CHANGE | ohos.permission.NOTIFICATION_CONTROLLER | Indicates the common event that the notification slot has been updated. |
| COMMON_EVENT_SPN_INFO_CHANGED <sup>9+<sup> | usual.event.SPN_INFO_CHANGED | - | Indicates the common event that the SPN displayed has been updated. |
| COMMON_EVENT_QUICK_FIX_APPLY_RESULT <sup>9+<sup> | usual.event.QUICK_FIX_APPLY_RESULT | - | Indicates the common event that a quick fix is applied to the application. |
For details about the definitions of all system common events, see [System Common Events](./commonEvent-definitions.md).
## CommonEventManager.publish ## CommonEventManager.publish
...@@ -254,7 +95,7 @@ Publishes a common event with given attributes. This API uses an asynchronous ca ...@@ -254,7 +95,7 @@ Publishes a common event with given attributes. This API uses an asynchronous ca
// Attributes of a common event. // Attributes of a common event.
var options = { var options = {
code: 0, // Result code of the common event. code: 0, // Result code of the common event.
data: "initial data";// Result data of the common event. data: "initial data",// Result data of the common event.
isOrdered: true // The common event is an ordered one. isOrdered: true // The common event is an ordered one.
} }
...@@ -362,7 +203,7 @@ Publishes a common event with given attributes to a specific user. This API uses ...@@ -362,7 +203,7 @@ Publishes a common event with given attributes to a specific user. This API uses
// Attributes of a common event. // Attributes of a common event.
var options = { var options = {
code: 0, // Result code of the common event. code: 0, // Result code of the common event.
data: "initial data";// Result data of the common event. data: "initial data",// Result data of the common event.
} }
// Callback for common event publication // Callback for common event publication
...@@ -506,7 +347,7 @@ var subscribeInfo = { ...@@ -506,7 +347,7 @@ var subscribeInfo = {
// Callback for common event subscription. // Callback for common event subscription.
function SubscribeCallBack(err, data) { function SubscribeCallBack(err, data) {
if (err.code) { if (err) {
console.error("subscribe failed " + JSON.stringify(err)); console.error("subscribe failed " + JSON.stringify(err));
} else { } else {
console.info("subscribe "); console.info("subscribe ");
...@@ -631,7 +472,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -631,7 +472,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for result code obtaining of an ordered common event. // Callback for result code obtaining of an ordered common event.
function getCodeCallback(err, Code) { function getCodeCallback(err, Code) {
if (err.code) { if (err) {
console.error("getCode failed " + JSON.stringify(err)); console.error("getCode failed " + JSON.stringify(err));
} else { } else {
console.info("getCode " + JSON.stringify(Code)); console.info("getCode " + JSON.stringify(Code));
...@@ -688,7 +529,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -688,7 +529,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for result code setting of an ordered common event. // Callback for result code setting of an ordered common event.
function setCodeCallback(err) { function setCodeCallback(err) {
if (err.code) { if (err) {
console.error("setCode failed " + JSON.stringify(err)); console.error("setCode failed " + JSON.stringify(err));
} else { } else {
console.info("setCode"); console.info("setCode");
...@@ -750,7 +591,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -750,7 +591,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for result data obtaining of an ordered common event. // Callback for result data obtaining of an ordered common event.
function getDataCallback(err, Data) { function getDataCallback(err, Data) {
if (err.code) { if (err) {
console.error("getData failed " + JSON.stringify(err)); console.error("getData failed " + JSON.stringify(err));
} else { } else {
console.info("getData " + JSON.stringify(Data)); console.info("getData " + JSON.stringify(Data));
...@@ -807,7 +648,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -807,7 +648,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for result data setting of an ordered common event // Callback for result data setting of an ordered common event
function setDataCallback(err) { function setDataCallback(err) {
if (err.code) { if (err) {
console.error("setData failed " + JSON.stringify(err)); console.error("setData failed " + JSON.stringify(err));
} else { } else {
console.info("setData"); console.info("setData");
...@@ -871,7 +712,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -871,7 +712,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for result code and result data setting of an ordered common event. // Callback for result code and result data setting of an ordered common event.
function setCodeDataCallback(err) { function setCodeDataCallback(err) {
if (err.code) { if (err) {
console.error("setCodeAndData failed " + JSON.stringify(err)); console.error("setCodeAndData failed " + JSON.stringify(err));
} else { } else {
console.info("setCodeDataCallback"); console.info("setCodeDataCallback");
...@@ -936,7 +777,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -936,7 +777,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is an ordered one. // Callback for checking whether the current common event is an ordered one.
function isOrderedCallback(err, isOrdered) { function isOrderedCallback(err, isOrdered) {
if (err.code) { if (err) {
console.error("isOrderedCommonEvent failed " + JSON.stringify(err)); console.error("isOrderedCommonEvent failed " + JSON.stringify(err));
} else { } else {
console.info("isOrdered " + JSON.stringify(isOrdered)); console.info("isOrdered " + JSON.stringify(isOrdered));
...@@ -996,7 +837,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -996,7 +837,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is a sticky one. // Callback for checking whether the current common event is a sticky one.
function isStickyCallback(err, isSticky) { function isStickyCallback(err, isSticky) {
if (err.code) { if (err) {
console.error("isStickyCommonEvent failed " + JSON.stringify(err)); console.error("isStickyCommonEvent failed " + JSON.stringify(err));
} else { } else {
console.info("isSticky " + JSON.stringify(isSticky)); console.info("isSticky " + JSON.stringify(isSticky));
...@@ -1054,7 +895,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -1054,7 +895,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for common event aborting. // Callback for common event aborting.
function abortCallback(err) { function abortCallback(err) {
if (err.code) { if (err) {
console.error("abortCommonEvent failed " + JSON.stringify(err)); console.error("abortCommonEvent failed " + JSON.stringify(err));
} else { } else {
console.info("abortCommonEvent"); console.info("abortCommonEvent");
...@@ -1110,7 +951,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -1110,7 +951,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for clearing the aborted state of the current common event. // Callback for clearing the aborted state of the current common event.
function clearAbortCallback(err) { function clearAbortCallback(err) {
if (err.code) { if (err) {
console.error("clearAbortCommonEvent failed " + JSON.stringify(err)); console.error("clearAbortCommonEvent failed " + JSON.stringify(err));
} else { } else {
console.info("clearAbortCommonEvent"); console.info("clearAbortCommonEvent");
...@@ -1166,7 +1007,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -1166,7 +1007,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is in the aborted state. // Callback for checking whether the current common event is in the aborted state.
function getAbortCallback(err, AbortCommonEvent) { function getAbortCallback(err, AbortCommonEvent) {
if (err.code) { if (err) {
console.error("getAbortCommonEvent failed " + JSON.stringify(err)); console.error("getAbortCommonEvent failed " + JSON.stringify(err));
} else { } else {
console.info("AbortCommonEvent " + AbortCommonEvent) console.info("AbortCommonEvent " + AbortCommonEvent)
...@@ -1222,7 +1063,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -1222,7 +1063,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for subscriber information obtaining. // Callback for subscriber information obtaining.
function getSubscribeInfoCallback(err, SubscribeInfo) { function getSubscribeInfoCallback(err, SubscribeInfo) {
if (err.code) { if (err) {
console.error("getSubscribeInfo failed " + JSON.stringify(err)); console.error("getSubscribeInfo failed " + JSON.stringify(err));
} else { } else {
console.info("SubscribeInfo " + JSON.stringify(SubscribeInfo)); console.info("SubscribeInfo " + JSON.stringify(SubscribeInfo));
...@@ -1278,7 +1119,7 @@ var subscriber; // Subscriber object successfully created. ...@@ -1278,7 +1119,7 @@ var subscriber; // Subscriber object successfully created.
// Callback for ordered common event finishing. // Callback for ordered common event finishing.
function finishCommonEventCallback(err) { function finishCommonEventCallback(err) {
if (err.code) { if (err) {
console.error("finishCommonEvent failed " + JSON.stringify(err)); console.error("finishCommonEvent failed " + JSON.stringify(err));
} else { } else {
console.info("FinishCommonEvent"); console.info("FinishCommonEvent");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册