Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
f20de4cd
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f20de4cd
编写于
6月 30, 2022
作者:
X
xuzhihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix issue of Notification
Signed-off-by:
N
xuzhihao
<
xuzhihao16@huawei.com
>
上级
c134e861
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
373 addition
and
335 deletion
+373
-335
zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
+162
-154
zh-cn/application-dev/reference/apis/js-apis-emitter.md
zh-cn/application-dev/reference/apis/js-apis-emitter.md
+13
-7
zh-cn/application-dev/reference/apis/js-apis-notification.md
zh-cn/application-dev/reference/apis/js-apis-notification.md
+196
-174
zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md
...n/application-dev/reference/apis/js-apis-reminderAgent.md
+2
-0
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
浏览文件 @
f20de4cd
...
@@ -6,166 +6,170 @@
...
@@ -6,166 +6,170 @@
>
>
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 权限列表
| 系统公共事件宏 | 系统公共事件名称 | 订阅者所需权限 |
| ------------ | ------------------ | ---------------------- |
| COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED |
| COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED |
| COMMON_EVENT_SHUTDOWN | usual.event.SHUTDOWN | 无 |
| COMMON_EVENT_BATTERY_CHANGED | usual.event.BATTERY_CHANGED | 无 |
| COMMON_EVENT_BATTERY_LOW | usual.event.BATTERY_LOW | 无 |
| COMMON_EVENT_BATTERY_OKAY | usual.event.BATTERY_OKAY | 无 |
| COMMON_EVENT_POWER_CONNECTED | usual.event.POWER_CONNECTED | 无 |
| COMMON_EVENT_POWER_DISCONNECTED | usual.event.POWER_DISCONNECTED | 无 |
| COMMON_EVENT_SCREEN_OFF | usual.event.SCREEN_OFF | 无 |
| COMMON_EVENT_SCREEN_ON | usual.event.SCREEN_ON | 无 |
| COMMON_EVENT_THERMAL_LEVEL_CHANGED | usual.event.THERMAL_LEVEL_CHANGED | 无 |
| COMMON_EVENT_USER_PRESENT | usual.event.USER_PRESENT | 无 |
| COMMON_EVENT_TIME_TICK | usual.event.TIME_TICK | 无 |
| COMMON_EVENT_TIME_CHANGED | usual.event.TIME_CHANGED | 无 |
| COMMON_EVENT_DATE_CHANGED | usual.event.DATE_CHANGED | 无 |
| COMMON_EVENT_TIMEZONE_CHANGED | usual.event.TIMEZONE_CHANGED | 无 |
| COMMON_EVENT_CLOSE_SYSTEM_DIALOGS | usual.event.CLOSE_SYSTEM_DIALOGS | 无 |
| COMMON_EVENT_PACKAGE_ADDED | usual.event.PACKAGE_ADDED | 无 |
| COMMON_EVENT_PACKAGE_REPLACED | usual.event.PACKAGE_REPLACED | 无 |
| COMMON_EVENT_MY_PACKAGE_REPLACED | usual.event.MY_PACKAGE_REPLACED | 无 |
| COMMON_EVENT_PACKAGE_REMOVED | usual.event.PACKAGE_REMOVED | 无 |
| COMMON_EVENT_BUNDLE_REMOVED | usual.event.BUNDLE_REMOVED | 无 |
| COMMON_EVENT_PACKAGE_FULLY_REMOVED | usual.event.PACKAGE_FULLY_REMOVED | 无 |
| COMMON_EVENT_PACKAGE_CHANGED | usual.event.PACKAGE_CHANGED | 无 |
| COMMON_EVENT_PACKAGE_RESTARTED | usual.event.PACKAGE_RESTARTED | 无 |
| COMMON_EVENT_PACKAGE_DATA_CLEARED | usual.event.PACKAGE_DATA_CLEARED | 无 |
| COMMON_EVENT_PACKAGES_SUSPENDED | usual.event.PACKAGES_SUSPENDED | 无 |
| COMMON_EVENT_PACKAGES_UNSUSPENDED | usual.event.PACKAGES_UNSUSPENDED | 无 |
| COMMON_EVENT_MY_PACKAGE_SUSPENDED | usual.event.MY_PACKAGE_SUSPENDED | 无 |
| COMMON_EVENT_MY_PACKAGE_UNSUSPENDED | usual.event.MY_PACKAGE_UNSUSPENDED | 无 |
| COMMON_EVENT_UID_REMOVED | usual.event.UID_REMOVED | 无 |
| COMMON_EVENT_PACKAGE_FIRST_LAUNCH | usual.event.PACKAGE_FIRST_LAUNCH | 无 |
| COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION | usual.event.PACKAGE_NEEDS_VERIFICATION | 无 |
| COMMON_EVENT_PACKAGE_VERIFIED | usual.event.PACKAGE_VERIFIED | 无 |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE | usual.event.EXTERNAL_APPLICATIONS_AVAILABLE | 无 |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE | usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE | 无 |
| COMMON_EVENT_CONFIGURATION_CHANGED | usual.event.CONFIGURATION_CHANGED | 无 |
| COMMON_EVENT_LOCALE_CHANGED | usual.event.LOCALE_CHANGED | 无 |
| COMMON_EVENT_MANAGE_PACKAGE_STORAGE | usual.event.MANAGE_PACKAGE_STORAGE | 无 |
| COMMON_EVENT_DRIVE_MODE | common.event.DRIVE_MODE | 无 |
| COMMON_EVENT_HOME_MODE | common.event.HOME_MODE | 无 |
| COMMON_EVENT_OFFICE_MODE | common.event.OFFICE_MODE | 无 |
| COMMON_EVENT_USER_STARTED | usual.event.USER_STARTED | 无 |
| COMMON_EVENT_USER_BACKGROUND | usual.event.USER_BACKGROUND | 无 |
| COMMON_EVENT_USER_FOREGROUND | usual.event.USER_FOREGROUND | 无 |
| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_USERS |
| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_USERS |
| COMMON_EVENT_USER_UNLOCKED | usual.event.USER_UNLOCKED | 无 |
| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_USERS |
| COMMON_EVENT_USER_STOPPED | usual.event.USER_STOPPED | 无 |
| COMMON_EVENT_HWID_LOGIN | common.event.HWID_LOGIN | 无 |
| COMMON_EVENT_HWID_LOGOUT | common.event.HWID_LOGOUT | 无 |
| COMMON_EVENT_HWID_TOKEN_INVALID | common.event.HWID_TOKEN_INVALID | 无 |
| COMMON_EVENT_HWID_LOGOFF | common.event.HWID_LOGOFF | 无 |
| COMMON_EVENT_WIFI_POWER_STATE | usual.event.wifi.POWER_STATE | 无 |
| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION |
| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_CONN_STATE | usual.event.wifi.CONN_STATE | 无 |
| COMMON_EVENT_WIFI_HOTSPOT_STATE | usual.event.wifi.HOTSPOT_STATE | 无 |
| COMMON_EVENT_WIFI_AP_STA_JOIN | usual.event.wifi.WIFI_HS_STA_JOIN | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_AP_STA_LEAVE | usual.event.wifi.WIFI_HS_STA_LEAVE | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE | usual.event.wifi.mplink.STATE_CHANGE | ohos.permission.MPLINK_CHANGE_STATE |
| COMMON_EVENT_WIFI_P2P_CONN_STATE | usual.event.wifi.p2p.CONN_STATE_CHANGE | ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION |
| COMMON_EVENT_WIFI_P2P_STATE_CHANGED | usual.event.wifi.p2p.STATE_CHANGE | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED | usual.event.wifi.p2p.DEVICES_CHANGE | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED | usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED | usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED | usual.event.wifi.p2p.GROUP_STATE_CHANGED | ohos.permission.GET_WIFI_INFO |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE | usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED | usual.event.bluetooth.remotedevice.DISCOVERED | ohos.permission.LOCATION and ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE | usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED | usual.event.bluetooth.remotedevice.ACL_CONNECTED | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED | usual.event.bluetooth.remotedevice.ACL_DISCONNECTED | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE | usual.event.bluetooth.remotedevice.NAME_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE | usual.event.bluetooth.remotedevice.PAIR_STATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE | usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT | usual.event.bluetooth.remotedevice.SDP_RESULT | 无 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE | usual.event.bluetooth.remotedevice.UUID_VALUE | ohos.permission.DISCOVER_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ | usual.event.bluetooth.remotedevice.PAIRING_REQ | ohos.permission.DISCOVER_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL | usual.event.bluetooth.remotedevice.PAIRING_CANCEL | 无 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ | usual.event.bluetooth.remotedevice.CONNECT_REQ | 无 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY | usual.event.bluetooth.remotedevice.CONNECT_REPLY | 无 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL | usual.event.bluetooth.remotedevice.CONNECT_CANCEL | 无 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE | 无 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE | 无 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT | usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT | 无 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE | 无 |
| COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE | usual.event.bluetooth.host.STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE | usual.event.bluetooth.host.REQ_DISCOVERABLE | 无 |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE | usual.event.bluetooth.host.REQ_ENABLE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE | usual.event.bluetooth.host.REQ_DISABLE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE | usual.event.bluetooth.host.SCAN_MODE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED | usual.event.bluetooth.host.DISCOVERY_STARTED | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED | usual.event.bluetooth.host.DISCOVERY_FINISHED | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE | usual.event.bluetooth.host.NAME_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE | usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH |
| COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED | usual.event.nfc.action.ADAPTER_STATE_CHANGED | 无 |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED | usual.event.nfc.action.RF_FIELD_ON_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED | usual.event.nfc.action.RF_FIELD_OFF_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS |
| COMMON_EVENT_DISCHARGING | usual.event.DISCHARGING | 无 |
| COMMON_EVENT_CHARGING | usual.event.CHARGING | 无 |
| COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED | usual.event.DEVICE_IDLE_MODE_CHANGED | 无 |
| COMMON_EVENT_POWER_SAVE_MODE_CHANGED | usual.event.POWER_SAVE_MODE_CHANGED | 无 |
| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_USERS |
| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_USERS |
| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE |
| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE |
| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE |
| COMMON_EVENT_LOCATION_MODE_STATE_CHANGED | usual.event.location.MODE_STATE_CHANGED | 无 |
| COMMON_EVENT_IVI_SLEEP | common.event.IVI_SLEEP | 无 |
| COMMON_EVENT_IVI_PAUSE | common.event.IVI_PAUSE | 无 |
| COMMON_EVENT_IVI_STANDBY | common.event.IVI_STANDBY | 无 |
| COMMON_EVENT_IVI_LASTMODE_SAVE | common.event.IVI_LASTMODE_SAVE | 无 |
| COMMON_EVENT_IVI_VOLTAGE_ABNORMAL | common.event.IVI_VOLTAGE_ABNORMAL | 无 |
| COMMON_EVENT_IVI_HIGH_TEMPERATURE | common.event.IVI_HIGH_TEMPERATURE | 无 |
| COMMON_EVENT_IVI_EXTREME_TEMPERATURE | common.event.IVI_EXTREME_TEMPERATURE | 无 |
| COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL | common.event.IVI_TEMPERATURE_ABNORMAL | 无 |
| COMMON_EVENT_IVI_VOLTAGE_RECOVERY | common.event.IVI_VOLTAGE_RECOVERY | 无 |
| COMMON_EVENT_IVI_TEMPERATURE_RECOVERY | common.event.IVI_TEMPERATURE_RECOVERY | 无 |
| COMMON_EVENT_IVI_ACTIVE | common.event.IVI_ACTIVE | 无 |
| COMMON_EVENT_USB_DEVICE_ATTACHED | usual.event.hardware.usb.action.USB_DEVICE_ATTACHED | 无 |
| COMMON_EVENT_USB_DEVICE_DETACHED | usual.event.hardware.usb.action.USB_DEVICE_DETACHED | 无 |
| COMMON_EVENT_USB_ACCESSORY_ATTACHED | usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED | 无 |
| COMMON_EVENT_USB_ACCESSORY_DETACHED | usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED | 无 |
| COMMON_EVENT_DISK_REMOVED | usual.event.data.DISK_REMOVED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_DISK_UNMOUNTED | usual.event.data.DISK_UNMOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_DISK_MOUNTED | usual.event.data.DISK_MOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_DISK_BAD_REMOVAL | usual.event.data.DISK_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_DISK_UNMOUNTABLE | usual.event.data.DISK_UNMOUNTABLE | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_DISK_EJECT | usual.event.data.DISK_EJECT | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_VOLUME_REMOVED | usual.event.data.VOLUME_REMOVED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_VOLUME_UNMOUNTED | usual.event.data.VOLUME_UNMOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_VOLUME_MOUNTED | usual.event.data.VOLUME_MOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_VOLUME_BAD_REMOVAL | usual.event.data.VOLUME_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_VOLUME_EJECT | usual.event.data.VOLUME_EJECT | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE |
| COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED | usual.event.data.VISIBLE_ACCOUNTS_UPDATED | ohos.permission.GET_APP_ACCOUNTS |
| COMMON_EVENT_ACCOUNT_DELETED | usual.event.data.ACCOUNT_DELETED | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS |
| COMMON_EVENT_FOUNDATION_READY | usual.event.data.FOUNDATION_READY | ohos.permission.RECEIVER_STARTUP_COMPLETED |
| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | 无 |
| COMMON_EVENT_SPLIT_SCREEN | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN |
## 导入模块
## 导入模块
```
js
```
js
import
CommonEvent
from
'
@ohos.commonEvent
'
;
import
CommonEvent
from
'
@ohos.commonEvent
'
;
```
```
## Support
CommonEvent模块支持的事件类型。名称指的是系统公共事件宏;值指的是系统公共事件。
| 名称 | 值 | 订阅者所需权限 | 说明 |
| ------------ | ------------------ | ---------------------- | -------------------- |
| COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | 指示用户已完成引导并加载系统的公共事件的操作。 |
| COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | 表示用户已完成引导,系统已加载,但屏幕仍锁定的公共事件的操作。 |
| COMMON_EVENT_SHUTDOWN | usual.event.SHUTDOWN | 无 | 指示设备正在关闭并将继续最终关闭的公共事件的操作。 |
| COMMON_EVENT_BATTERY_CHANGED | usual.event.BATTERY_CHANGED | 无 | 表示电池充电状态、电平和其他信息发生变化的公共事件的动作。 |
| COMMON_EVENT_BATTERY_LOW | usual.event.BATTERY_LOW | 无 |
表示电池电量低的普通事件的动作。 |
| COMMON_EVENT_BATTERY_OKAY | usual.event.BATTERY_OKAY | 无 | 表示电池退出低电平状态的公共事件的动作。 |
| COMMON_EVENT_POWER_CONNECTED | usual.event.POWER_CONNECTED | 无 | 设备连接到外部电源的公共事件的动作。 |
| COMMON_EVENT_POWER_DISCONNECTED | usual.event.POWER_DISCONNECTED | 无 | 设备与外部电源断开的公共事件的动作。 |
| COMMON_EVENT_SCREEN_OFF | usual.event.SCREEN_OFF | 无 | 指示设备屏幕关闭且设备处于睡眠状态的普通事件的动作。 |
| COMMON_EVENT_SCREEN_ON | usual.event.SCREEN_ON | 无 | 指示设备屏幕打开且设备处于交互状态的公共事件的操作。 |
| COMMON_EVENT_THERMAL_LEVEL_CHANGED | usual.event.THERMAL_LEVEL_CHANGED | 无 | 指示设备热状态的公共事件的动作。 |
| COMMON_EVENT_USER_PRESENT | usual.event.USER_PRESENT | 无 | 用户解锁设备的公共事件的动作。 |
| COMMON_EVENT_TIME_TICK | usual.event.TIME_TICK | 无 | 表示系统时间更改的公共事件的动作。 |
| COMMON_EVENT_TIME_CHANGED | usual.event.TIME_CHANGED | 无 | 设置系统时间的公共事件的动作。 |
| COMMON_EVENT_DATE_CHANGED | usual.event.DATE_CHANGED | 无 | 表示系统日期已更改的公共事件的动作。 |
| COMMON_EVENT_TIMEZONE_CHANGED | usual.event.TIMEZONE_CHANGED | 无 | 表示系统时区更改的公共事件的动作。 |
| COMMON_EVENT_CLOSE_SYSTEM_DIALOGS | usual.event.CLOSE_SYSTEM_DIALOGS | 无 | 表示用户关闭临时系统对话框的公共事件的动作。 |
| COMMON_EVENT_PACKAGE_ADDED | usual.event.PACKAGE_ADDED | 无 | 设备上已安装新应用包的公共事件的动作。 |
| COMMON_EVENT_PACKAGE_REPLACED | usual.event.PACKAGE_REPLACED | 无 | 指示已安装的应用程序包的新版本已替换设备上的旧版本的公共事件的操作。 |
| COMMON_EVENT_MY_PACKAGE_REPLACED | usual.event.MY_PACKAGE_REPLACED | 无 | 指示应用程序包的新版本已取代前一个版本的公共事件的操作。
| COMMON_EVENT_PACKAGE_REMOVED | usual.event.PACKAGE_REMOVED | 无 | 指示已从设备卸载已安装的应用程序,但应用程序数据保留的公共事件的操作。 |
| COMMON_EVENT_BUNDLE_REMOVED | usual.event.BUNDLE_REMOVED | 无 | 指示已从设备中卸载已安装的捆绑包,但应用程序数据仍保留的公共事件的操作。 |
| COMMON_EVENT_PACKAGE_FULLY_REMOVED | usual.event.PACKAGE_FULLY_REMOVED | 无 | 指示已从设备中完全卸载已安装的应用程序(包括应用程序数据和代码)的公共事件的操作。 |
| COMMON_EVENT_PACKAGE_CHANGED | usual.event.PACKAGE_CHANGED | 无 | 指示应用包已更改的公共事件的动作(例如,包中的组件已启用或禁用)。 |
| COMMON_EVENT_PACKAGE_RESTARTED | usual.event.PACKAGE_RESTARTED | 无 | 表示用户重启应用包并杀死其所有进程的普通事件的动作。 |
| COMMON_EVENT_PACKAGE_DATA_CLEARED | usual.event.PACKAGE_DATA_CLEARED | 无 | 用户清除应用包数据的公共事件的动作。 |
| COMMON_EVENT_PACKAGES_SUSPENDED | usual.event.PACKAGES_SUSPENDED | 无 | 表示应用包已挂起的公共事件的动作。 |
| COMMON_EVENT_PACKAGES_UNSUSPENDED | usual.event.PACKAGES_UNSUSPENDED | 无 | 表示应用包未挂起的公共事件的动作。 |
| COMMON_EVENT_MY_PACKAGE_SUSPENDED | usual.event.MY_PACKAGE_SUSPENDED | 无 | 应用包被挂起的公共事件的动作。 |
| COMMON_EVENT_MY_PACKAGE_UNSUSPENDED | usual.event.MY_PACKAGE_UNSUSPENDED | 无 | 表示应用包未挂起的公共事件的动作。 |
| COMMON_EVENT_UID_REMOVED | usual.event.UID_REMOVED | 无 | 表示用户ID已从系统中删除的公共事件的动作。 |
| COMMON_EVENT_PACKAGE_FIRST_LAUNCH | usual.event.PACKAGE_FIRST_LAUNCH | 无 | 表示首次启动已安装应用程序的公共事件的动作。 |
| COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION | usual.event.PACKAGE_NEEDS_VERIFICATION | 无 | 表示应用需要系统校验的公共事件的动作。 |
| COMMON_EVENT_PACKAGE_VERIFIED | usual.event.PACKAGE_VERIFIED | 无 | 表示应用已被系统校验的公共事件的动作。 |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE | usual.event.EXTERNAL_APPLICATIONS_AVAILABLE | 无 | 指示安装在外部存储上的应用程序对系统可用的公共事件的操作。 |
| COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE | usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE | 无 | 指示安装在外部存储上的应用程序对系统不可用的公共事件的操作。 |
| COMMON_EVENT_CONFIGURATION_CHANGED | usual.event.CONFIGURATION_CHANGED | 无 | 指示设备状态(例如,方向和区域设置)已更改的公共事件的操作。 |
| COMMON_EVENT_LOCALE_CHANGED | usual.event.LOCALE_CHANGED | 无 | 指示设备区域设置已更改的公共事件的操作。 |
| COMMON_EVENT_MANAGE_PACKAGE_STORAGE | usual.event.MANAGE_PACKAGE_STORAGE | 无 | 设备存储空间不足的公共事件的动作。 |
| COMMON_EVENT_DRIVE_MODE | common.event.DRIVE_MODE | 无 | 指示系统处于驾驶模式的公共事件的动作。 |
| COMMON_EVENT_HOME_MODE | common.event.HOME_MODE | 无 | 表示系统处于HOME模式的公共事件的动作。 |
| COMMON_EVENT_OFFICE_MODE | common.event.OFFICE_MODE | 无 | 表示系统处于办公模式的公共事件的动作。 |
| COMMON_EVENT_USER_STARTED | usual.event.USER_STARTED | 无 | 表示用户已启动的公共事件的动作。 |
| COMMON_EVENT_USER_BACKGROUND | usual.event.USER_BACKGROUND | 无 | 表示用户已被带到后台的公共事件的动作。 |
| COMMON_EVENT_USER_FOREGROUND | usual.event.USER_FOREGROUND | 无 | 表示用户已被带到前台的公共事件的动作。 |
| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_USERS | 表示用户切换正在发生的公共事件的动作。 |
| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_USERS | 表示要启动用户的公共事件的动作。 |
| COMMON_EVENT_USER_UNLOCKED | usual.event.USER_UNLOCKED | 无 | 设备重启后解锁时,当前用户的凭据加密存储已解锁的公共事件的动作。 |
| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_USERS | 表示要停止用户的公共事件的动作。 |
| COMMON_EVENT_USER_STOPPED | usual.event.USER_STOPPED | 无 | 表示用户已停止的公共事件的动作。 |
| COMMON_EVENT_HWID_LOGIN | common.event.HWID_LOGIN | 无 | 华为账号ID用户登录公共事件的动作。 |
| COMMON_EVENT_HWID_LOGOUT | common.event.HWID_LOGOUT | 无 | 华为帐号ID用户下线的公共事件动作。 |
| COMMON_EVENT_HWID_TOKEN_INVALID | common.event.HWID_TOKEN_INVALID | 无 | 华为帐号ID无效的公共事件的动作。 |
| COMMON_EVENT_HWID_LOGOFF | common.event.HWID_LOGOFF | 无 | 华为账号ID注销公共事件的动作。 |
| COMMON_EVENT_WIFI_POWER_STATE | usual.event.wifi.POWER_STATE | 无 | Wi-Fi状态公共事件的动作,如启用和禁用。 |
| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION | 表示Wi-Fi接入点已被扫描并证明可用的公共事件的操作。 |
| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO | 表示Wi-Fi信号强度(RSSI)改变的公共事件的动作。 |
| COMMON_EVENT_WIFI_CONN_STATE | usual.event.wifi.CONN_STATE | 无 | Wi-Fi连接状态发生改变的公共事件的动作。 |
| COMMON_EVENT_WIFI_HOTSPOT_STATE | usual.event.wifi.HOTSPOT_STATE | 无 | Wi-Fi热点状态的公共事件的动作,如启用或禁用。 |
| COMMON_EVENT_WIFI_AP_STA_JOIN | usual.event.wifi.WIFI_HS_STA_JOIN | ohos.permission.GET_WIFI_INFO | 客户端加入当前设备Wi-Fi热点的普通事件的动作。 |
| COMMON_EVENT_WIFI_AP_STA_LEAVE | usual.event.wifi.WIFI_HS_STA_LEAVE | ohos.permission.GET_WIFI_INFO |客户端已断开与当前设备Wi-Fi热点的连接的公共事件的动作。 |
| COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE | usual.event.wifi.mplink.STATE_CHANGE | ohos.permission.MPLINK_CHANGE_STATE | 表示MPLink(增强Wi-Fi功能)状态已更改的公共事件的动作。 |
| COMMON_EVENT_WIFI_P2P_CONN_STATE | usual.event.wifi.p2p.CONN_STATE_CHANGE | ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION | Wi-Fi P2P连接状态改变的公共事件的动作。 |
| COMMON_EVENT_WIFI_P2P_STATE_CHANGED | usual.event.wifi.p2p.STATE_CHANGE | ohos.permission.GET_WIFI_INFO | Wi-Fi P2P状态公共事件的动作,如启用和禁用。 |
| COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED | usual.event.wifi.p2p.DEVICES_CHANGE | ohos.permission.GET_WIFI_INFO | Wi-Fi P2P对等体状态变化。 |
| COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED | usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE | ohos.permission.GET_WIFI_INFO | Wi-Fi P2P发现状态变化。 |
| COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED | usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE | ohos.permission.GET_WIFI_INFO | Wi-Fi P2P当前设备状态变化。 |
| COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED | usual.event.wifi.p2p.GROUP_STATE_CHANGED | ohos.permission.GET_WIFI_INFO | Wi-Fi P2P群组信息已更改。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 蓝牙免提通信连接状态公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示连接到蓝牙免提的设备处于活动状态的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示蓝牙A2DP连接状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 蓝牙A2DP连接状态公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE | usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示使用蓝牙A2DP连接的设备处于活动状态的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 蓝牙A2DP播放状态改变的普通事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示蓝牙A2DP的AVRCP连接状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE | usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示蓝牙A2DP音频编解码状态更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED | usual.event.bluetooth.remotedevice.DISCOVERED | ohos.permission.LOCATION and ohos.permission.USE_BLUETOOTH | 表示发现远程蓝牙设备的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE | usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示远程蓝牙设备的蓝牙类别已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED | usual.event.bluetooth.remotedevice.ACL_CONNECTED | ohos.permission.USE_BLUETOOTH | 指示已与远程蓝牙设备建立低级别(ACL)连接的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED | usual.event.bluetooth.remotedevice.ACL_DISCONNECTED | ohos.permission.USE_BLUETOOTH | 表示低电平(ACL)连接已从远程蓝牙设备断开的普通事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE | usual.event.bluetooth.remotedevice.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | 表示远程蓝牙设备的友好名称首次被检索或自上次检索以来被更改的公共事件的操作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE | usual.event.bluetooth.remotedevice.PAIR_STATE | ohos.permission.USE_BLUETOOTH | 远程蓝牙设备连接状态更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE | usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示远程蓝牙设备的电池电量首次被检索或自上次检索以来被更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT | usual.event.bluetooth.remotedevice.SDP_RESULT | 无 | 远程蓝牙设备SDP状态公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE | usual.event.bluetooth.remotedevice.UUID_VALUE | ohos.permission.DISCOVER_BLUETOOTH | 远程蓝牙设备UUID连接状态公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ | usual.event.bluetooth.remotedevice.PAIRING_REQ | ohos.permission.DISCOVER_BLUETOOTH | 表示远程蓝牙设备配对请求的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL | usual.event.bluetooth.remotedevice.PAIRING_CANCEL | 无 | 取消蓝牙配对的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ | usual.event.bluetooth.remotedevice.CONNECT_REQ | 无 | 表示远程蓝牙设备连接请求的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY | usual.event.bluetooth.remotedevice.CONNECT_REPLY | 无 | 表示远程蓝牙设备连接请求响应的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL | usual.event.bluetooth.remotedevice.CONNECT_CANCEL | 无 | 表示取消与远程蓝牙设备的连接的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE | 无 | 表示蓝牙免提连接状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE | 无 | 表示蓝牙免提音频状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT | usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT | 无 | 表示蓝牙免提音频网关状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE | 无 | 表示蓝牙免提呼叫状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE | usual.event.bluetooth.host.STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示蓝牙适配器状态已更改的公共事件的操作,例如蓝牙已打开或关闭。 |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE | usual.event.bluetooth.host.REQ_DISCOVERABLE | 无 | 表示用户允许扫描蓝牙请求的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE | usual.event.bluetooth.host.REQ_ENABLE | ohos.permission.USE_BLUETOOTH | 表示用户打开蓝牙请求的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE | usual.event.bluetooth.host.REQ_DISABLE | ohos.permission.USE_BLUETOOTH | 表示用户关闭蓝牙请求的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE | usual.event.bluetooth.host.SCAN_MODE_UPDATE | ohos.permission.USE_BLUETOOTH | 设备蓝牙扫描模式更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED | usual.event.bluetooth.host.DISCOVERY_STARTED | ohos.permission.USE_BLUETOOTH | 设备上已启动蓝牙扫描的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED | usual.event.bluetooth.host.DISCOVERY_FINISHED | ohos.permission.USE_BLUETOOTH | 设备上蓝牙扫描完成的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE | usual.event.bluetooth.host.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | 指示设备蓝牙适配器名称已更改的公共事件的操作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示蓝牙A2DP宿连接状态已更改的公共事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 蓝牙A2DP宿播放状态改变的普通事件的动作。 |
| COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE | usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | 表示蓝牙A2DP宿的音频状态已更改的公共事件的动作。 |
| COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED | usual.event.nfc.action.ADAPTER_STATE_CHANGED | 无 | 指示设备NFC适配器状态已更改的公共事件的操作。 |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED | usual.event.nfc.action.RF_FIELD_ON_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | 检测到NFC RF字段处于使能状态的公共事件的动作。 |
| COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED | usual.event.nfc.action.RF_FIELD_OFF_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | 检测到NFC RF字段处于关闭状态的公共事件的动作。 |
| COMMON_EVENT_DISCHARGING | usual.event.DISCHARGING | 无 | 表示系统停止为电池充电的公共事件的动作。 |
| COMMON_EVENT_CHARGING | usual.event.CHARGING | 无 | 表示系统开始为电池充电的公共事件的动作。 |
| COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED | usual.event.DEVICE_IDLE_MODE_CHANGED | 无 | 表示系统空闲模式已更改的公共事件的动作。 |
| COMMON_EVENT_POWER_SAVE_MODE_CHANGED | usual.event.POWER_SAVE_MODE_CHANGED | 无 | 表示系统节能模式更改的公共事件的动作。 |
| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_USERS | 表示用户已添加到系统中的公共事件的动作。 |
| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_USERS | 表示用户已从系统中删除的公共事件的动作。 |
| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE | 表示已添加能力的公共事件的动作。 |
| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE | 表示已删除能力的公共事件的动作。 |
| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE | 表示能力已更新的公共事件的动作。 |
| COMMON_EVENT_LOCATION_MODE_STATE_CHANGED | usual.event.location.MODE_STATE_CHANGED | 无 | 表示系统定位模式已更改的公共事件的动作。 |
| COMMON_EVENT_IVI_SLEEP | common.event.IVI_SLEEP | 无 | 表示指示车辆的车载信息娱乐(IVI)系统正在休眠的常见事件的动作。 |
| COMMON_EVENT_IVI_PAUSE | common.event.IVI_PAUSE | 无 | 表示IVI已休眠,并通知应用程序停止播放。 |
| COMMON_EVENT_IVI_STANDBY | common.event.IVI_STANDBY | 无 | 指示第三方应用暂停当前工作的公共事件的动作。 |
| COMMON_EVENT_IVI_LASTMODE_SAVE | common.event.IVI_LASTMODE_SAVE | 无 | 指示第三方应用保存其最后一个模式的公共事件的动作。 |
| COMMON_EVENT_IVI_VOLTAGE_ABNORMAL | common.event.IVI_VOLTAGE_ABNORMAL | 无 | 表示车辆电源系统电压异常的公共事件的动作。 |
| COMMON_EVENT_IVI_HIGH_TEMPERATURE | common.event.IVI_HIGH_TEMPERATURE | 无 | 表示IVI温度过高。 |
| COMMON_EVENT_IVI_EXTREME_TEMPERATURE | common.event.IVI_EXTREME_TEMPERATURE | 无 | 表示IVI温度极高。 |
| COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL | common.event.IVI_TEMPERATURE_ABNORMAL | 无 | 表示车载系统具有极端温度的常见事件的动作。 |
| COMMON_EVENT_IVI_VOLTAGE_RECOVERY | common.event.IVI_VOLTAGE_RECOVERY | 无 | 表示车辆电源系统电压恢复正常的公共事件的动作。 |
| COMMON_EVENT_IVI_TEMPERATURE_RECOVERY | common.event.IVI_TEMPERATURE_RECOVERY | 无 | 表示车载系统温度恢复正常的公共事件的动作。 |
| COMMON_EVENT_IVI_ACTIVE | common.event.IVI_ACTIVE | 无 | 表示电池服务处于活动状态的公共事件的动作。 |
| COMMON_EVENT_USB_DEVICE_ATTACHED | usual.event.hardware.usb.action.USB_DEVICE_ATTACHED | 无 | 当用户设备作为USB主机时,USB设备已挂载的公共事件的动作。 |
| COMMON_EVENT_USB_DEVICE_DETACHED | usual.event.hardware.usb.action.USB_DEVICE_DETACHED | 无 | 当用户设备作为USB主机时,USB设备被卸载的公共事件的动作。 |
| COMMON_EVENT_USB_ACCESSORY_ATTACHED | usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED | 无 | 表示已连接USB附件的公共事件的动作。 |
| COMMON_EVENT_USB_ACCESSORY_DETACHED | usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED | 无 | 表示USB附件被卸载的公共事件的动作。 |
| COMMON_EVENT_DISK_REMOVED | usual.event.data.DISK_REMOVED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为移除时发送此公共事件。 |
| COMMON_EVENT_DISK_UNMOUNTED | usual.event.data.DISK_UNMOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为卸载时发送此公共事件。 |
| COMMON_EVENT_DISK_MOUNTED | usual.event.data.DISK_MOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为挂载时发送此公共事件。 |
| COMMON_EVENT_DISK_BAD_REMOVAL | usual.event.data.DISK_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为挂载状态下移除时发送此公共事件。 |
| COMMON_EVENT_DISK_UNMOUNTABLE | usual.event.data.DISK_UNMOUNTABLE | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为插卡情况下无法挂载时发送此公共事件。 |
| COMMON_EVENT_DISK_EJECT | usual.event.data.DISK_EJECT | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 用户已表示希望删除外部存储介质时发送此公共事件。 |
| COMMON_EVENT_VOLUME_REMOVED | usual.event.data.VOLUME_REMOVED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为移除时发送此公共事件。 |
| COMMON_EVENT_VOLUME_UNMOUNTED | usual.event.data.VOLUME_UNMOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为卸载时发送此公共事件。 |
| COMMON_EVENT_VOLUME_MOUNTED | usual.event.data.VOLUME_MOUNTED | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为挂载时发送此公共事件。 |
| COMMON_EVENT_VOLUME_BAD_REMOVAL | usual.event.data.VOLUME_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 外部存储设备状态变更为挂载状态下移除时发送此公共事件。 |
| COMMON_EVENT_VOLUME_EJECT | usual.event.data.VOLUME_EJECT | ohos.permission.WRITE_USER_STORAGE 或 ohos.permission.READ_USER_STORAGE | 用户已表示希望删除外部存储介质时发送此公共事件。 |
| COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED | usual.event.data.VISIBLE_ACCOUNTS_UPDATED | ohos.permission.GET_APP_ACCOUNTS | 表示帐户可见更改的公共事件的动作。 |
| COMMON_EVENT_ACCOUNT_DELETED | usual.event.data.ACCOUNT_DELETED | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | 删除帐户的公共事件的动作。 |
| COMMON_EVENT_FOUNDATION_READY | usual.event.data.FOUNDATION_READY | ohos.permission.RECEIVER_STARTUP_COMPLETED | 表示foundation已准备好的公共事件的动作。 |
| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | 无 | 表示设备飞行模式已更改的公共事件的动作。 |
| COMMON_EVENT_SPLIT_SCREEN | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN | 表示分屏的公共事件的动作。 |
## CommonEvent.publish
## CommonEvent.publish
publish(event: string, callback: AsyncCallback
\<
void>): void
publish(event: string, callback: AsyncCallback
\<
void>): void
...
@@ -174,6 +178,8 @@ publish(event: string, callback: AsyncCallback\<void>): void
...
@@ -174,6 +178,8 @@ publish(event: string, callback: AsyncCallback\<void>): void
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
...
@@ -207,6 +213,8 @@ publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\
...
@@ -207,6 +213,8 @@ publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
...
...
zh-cn/application-dev/reference/apis/js-apis-emitter.md
浏览文件 @
f20de4cd
...
@@ -20,12 +20,14 @@ import emitter from '@ohos.events.emitter'
...
@@ -20,12 +20,14 @@ import emitter from '@ohos.events.emitter'
用于表示事件被投递的优先级。
用于表示事件被投递的优先级。
**系统能力**
: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 值 | 说明 |
| 名称 | 值 | 说明 |
| --------- | ---- | ------------------------------------------------- |
| --------- | ---- | ------------------------------------------------- |
| IMMEDIATE | 0 | 表示事件被立即投递。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| IMMEDIATE | 0 | 表示事件被立即投递。 |
| HIGH | 1 | 表示事件先于LOW优先级投递。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| HIGH | 1 | 表示事件先于LOW优先级投递。 |
| LOW | 2 | 表示事件优于IDLE优先级投递,事件的默认优先级是LOW。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| LOW | 2 | 表示事件优于IDLE优先级投递,事件的默认优先级是LOW。
|
| IDLE | 3 | 表示在没有其他事件的情况下,才投递该事件。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| IDLE | 3 | 表示在没有其他事件的情况下,才投递该事件。
|
## emitter.on
## emitter.on
...
@@ -135,15 +137,19 @@ emitter.emit(innerEvent, eventData);
...
@@ -135,15 +137,19 @@ emitter.emit(innerEvent, eventData);
进程内的事件。
进程内的事件。
**系统能力**
: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| eventId | number | 是 | 是 | 事件的ID,由开发者定义用来辨别事件。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| eventId | number | 是 | 是 | 事件的ID,由开发者定义用来辨别事件。 |
| priority |
[
EventPriority
](
#eventpriority
)
| 是 | 是 | 事件被投递的优先级。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| priority |
[
EventPriority
](
#eventpriority
)
| 是 | 是 | 事件被投递的优先级。 |
## EventData
## EventData
发送事件时传递的数据。
发送事件时传递的数据。
**系统能力**
: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ---- | ------------------ | ---- | ---- | -------------- |
| ---- | ------------------ | ---- | ---- | -------------- |
| data | [key: string]: any | 是 | 是 | 发送事件时传递的数据,数据类型支持字符串、整型和布尔型。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| data | [key: string]: any | 是 | 是 | 发送事件时传递的数据,数据类型支持字符串、整型和布尔型。 |
zh-cn/application-dev/reference/apis/js-apis-notification.md
浏览文件 @
f20de4cd
...
@@ -90,7 +90,9 @@ publish(request: NotificationRequest, userId: number, callback: AsyncCallback\<v
...
@@ -90,7 +90,9 @@ publish(request: NotificationRequest, userId: number, callback: AsyncCallback\<v
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -132,7 +134,9 @@ publish(request: NotificationRequest, userId: number): Promise\<void\>
...
@@ -132,7 +134,9 @@ publish(request: NotificationRequest, userId: number): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -296,7 +300,9 @@ addSlot(slot: NotificationSlot, callback: AsyncCallback\<void\>): void
...
@@ -296,7 +300,9 @@ addSlot(slot: NotificationSlot, callback: AsyncCallback\<void\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -329,7 +335,9 @@ addSlot(slot: NotificationSlot): Promise\<void\>
...
@@ -329,7 +335,9 @@ addSlot(slot: NotificationSlot): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -410,7 +418,9 @@ addSlots(slots: Array\<NotificationSlot\>, callback: AsyncCallback\<void\>): voi
...
@@ -410,7 +418,9 @@ addSlots(slots: Array\<NotificationSlot\>, callback: AsyncCallback\<void\>): voi
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -447,7 +457,9 @@ addSlots(slots: Array\<NotificationSlot\>): Promise\<void\>
...
@@ -447,7 +457,9 @@ addSlots(slots: Array\<NotificationSlot\>): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -686,7 +698,9 @@ subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, c
...
@@ -686,7 +698,9 @@ subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, c
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -725,7 +739,9 @@ subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>):
...
@@ -725,7 +739,9 @@ subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>):
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -759,7 +775,9 @@ subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo):
...
@@ -759,7 +775,9 @@ subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo):
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -792,7 +810,9 @@ unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>)
...
@@ -792,7 +810,9 @@ unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>)
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -826,7 +846,9 @@ unsubscribe(subscriber: NotificationSubscriber): Promise\<void\>
...
@@ -826,7 +846,9 @@ unsubscribe(subscriber: NotificationSubscriber): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -858,7 +880,9 @@ enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallbac
...
@@ -858,7 +880,9 @@ enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallbac
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -890,7 +914,9 @@ enableNotification(bundle: BundleOption, enable: boolean): Promise\<void\>
...
@@ -890,7 +914,9 @@ enableNotification(bundle: BundleOption, enable: boolean): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -922,6 +948,8 @@ isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\<boolean\>):
...
@@ -922,6 +948,8 @@ isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\<boolean\>):
**系统API**
:此接口为系统接口,三方应用不支持调用。
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**参数:**
**参数:**
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
...
@@ -951,7 +979,9 @@ isNotificationEnabled(bundle: BundleOption): Promise\<boolean\>
...
@@ -951,7 +979,9 @@ isNotificationEnabled(bundle: BundleOption): Promise\<boolean\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -986,7 +1016,9 @@ isNotificationEnabled(callback: AsyncCallback\<boolean\>): void
...
@@ -986,7 +1016,9 @@ isNotificationEnabled(callback: AsyncCallback\<boolean\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1014,7 +1046,9 @@ isNotificationEnabled(): Promise\<boolean\>
...
@@ -1014,7 +1046,9 @@ isNotificationEnabled(): Promise\<boolean\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1046,7 +1080,9 @@ displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<voi
...
@@ -1046,7 +1080,9 @@ displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<voi
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1078,7 +1114,9 @@ displayBadge(bundle: BundleOption, enable: boolean): Promise\<void\>
...
@@ -1078,7 +1114,9 @@ displayBadge(bundle: BundleOption, enable: boolean): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1108,7 +1146,9 @@ isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void
...
@@ -1108,7 +1146,9 @@ isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1139,7 +1179,9 @@ isBadgeDisplayed(bundle: BundleOption): Promise\<boolean\>
...
@@ -1139,7 +1179,9 @@ isBadgeDisplayed(bundle: BundleOption): Promise\<boolean\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1174,7 +1216,9 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCal
...
@@ -1174,7 +1216,9 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCal
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1209,7 +1253,9 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\<void\>
...
@@ -1209,7 +1253,9 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1242,7 +1288,9 @@ getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array\<Notificati
...
@@ -1242,7 +1288,9 @@ getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array\<Notificati
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1273,7 +1321,9 @@ getSlotsByBundle(bundle: BundleOption): Promise<Array\<NotificationSlot\>>
...
@@ -1273,7 +1321,9 @@ getSlotsByBundle(bundle: BundleOption): Promise<Array\<NotificationSlot\>>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1308,7 +1358,9 @@ getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\<number\>): voi
...
@@ -1308,7 +1358,9 @@ getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\<number\>): voi
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1339,7 +1391,9 @@ getSlotNumByBundle(bundle: BundleOption): Promise\<number\>
...
@@ -1339,7 +1391,9 @@ getSlotNumByBundle(bundle: BundleOption): Promise\<number\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1374,7 +1428,9 @@ remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCa
...
@@ -1374,7 +1428,9 @@ remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCa
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1410,7 +1466,9 @@ remove(bundle: BundleOption, notificationKey: NotificationKey): Promise\<void\>
...
@@ -1410,7 +1466,9 @@ remove(bundle: BundleOption, notificationKey: NotificationKey): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1444,7 +1502,9 @@ remove(hashCode: string, callback: AsyncCallback\<void\>): void
...
@@ -1444,7 +1502,9 @@ remove(hashCode: string, callback: AsyncCallback\<void\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1475,7 +1535,9 @@ remove(hashCode: string): Promise\<void\>
...
@@ -1475,7 +1535,9 @@ remove(hashCode: string): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1505,6 +1567,8 @@ removeAll(bundle: BundleOption, callback: AsyncCallback\<void\>): void
...
@@ -1505,6 +1567,8 @@ removeAll(bundle: BundleOption, callback: AsyncCallback\<void\>): void
**系统API**
:此接口为系统接口,三方应用不支持调用。
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**参数:**
**参数:**
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
...
@@ -1534,7 +1598,9 @@ removeAll(callback: AsyncCallback\<void\>): void
...
@@ -1534,7 +1598,9 @@ removeAll(callback: AsyncCallback\<void\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1562,7 +1628,9 @@ removeAll(bundle?: BundleOption): Promise\<void\>
...
@@ -1562,7 +1628,9 @@ removeAll(bundle?: BundleOption): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1586,7 +1654,9 @@ removeAll(userId: number, callback: AsyncCallback\<void>): void
...
@@ -1586,7 +1654,9 @@ removeAll(userId: number, callback: AsyncCallback\<void>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1615,7 +1685,9 @@ removeAll(userId: number): Promise\<void>
...
@@ -1615,7 +1685,9 @@ removeAll(userId: number): Promise\<void>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1644,7 +1716,9 @@ getAllActiveNotifications(callback: AsyncCallback<Array\<NotificationRequest\>>)
...
@@ -1644,7 +1716,9 @@ getAllActiveNotifications(callback: AsyncCallback<Array\<NotificationRequest\>>)
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1672,7 +1746,9 @@ getAllActiveNotifications(): Promise\<Array\<[NotificationRequest](#notification
...
@@ -1672,7 +1746,9 @@ getAllActiveNotifications(): Promise\<Array\<[NotificationRequest](#notification
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。removeGroupByBundle
**返回值:**
**返回值:**
...
@@ -1852,7 +1928,9 @@ removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCall
...
@@ -1852,7 +1928,9 @@ removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCall
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1885,7 +1963,9 @@ removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\<void\>
...
@@ -1885,7 +1963,9 @@ removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1914,7 +1994,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback\<void\>): vo
...
@@ -1914,7 +1994,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback\<void\>): vo
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1949,7 +2031,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate): Promise\<void\>
...
@@ -1949,7 +2031,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -1979,7 +2063,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallb
...
@@ -1979,7 +2063,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallb
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2017,7 +2103,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise\<void\>
...
@@ -2017,7 +2103,9 @@ setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise\<void\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2051,7 +2139,9 @@ getDoNotDisturbDate(callback: AsyncCallback\<DoNotDisturbDate\>): void
...
@@ -2051,7 +2139,9 @@ getDoNotDisturbDate(callback: AsyncCallback\<DoNotDisturbDate\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2079,7 +2169,9 @@ getDoNotDisturbDate(): Promise\<DoNotDisturbDate\>
...
@@ -2079,7 +2169,9 @@ getDoNotDisturbDate(): Promise\<DoNotDisturbDate\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**返回值:**
**返回值:**
...
@@ -2104,6 +2196,10 @@ getDoNotDisturbDate(userId: number, callback: AsyncCallback\<DoNotDisturbDate\>)
...
@@ -2104,6 +2196,10 @@ getDoNotDisturbDate(userId: number, callback: AsyncCallback\<DoNotDisturbDate\>)
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
...
@@ -2133,6 +2229,10 @@ getDoNotDisturbDate(userId: number): Promise\<DoNotDisturbDate\>
...
@@ -2133,6 +2229,10 @@ getDoNotDisturbDate(userId: number): Promise\<DoNotDisturbDate\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
...
@@ -2164,7 +2264,9 @@ supportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void
...
@@ -2164,7 +2264,9 @@ supportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2192,7 +2294,9 @@ supportDoNotDisturbMode(): Promise\<boolean\>
...
@@ -2192,7 +2294,9 @@ supportDoNotDisturbMode(): Promise\<boolean\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**返回值:**
**返回值:**
...
@@ -2322,7 +2426,9 @@ enableDistributed(enable: boolean, callback: AsyncCallback\<void\>): void
...
@@ -2322,7 +2426,9 @@ enableDistributed(enable: boolean, callback: AsyncCallback\<void\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2353,7 +2459,9 @@ enableDistributed(enable: boolean): Promise\<void>
...
@@ -2353,7 +2459,9 @@ enableDistributed(enable: boolean): Promise\<void>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2431,7 +2539,9 @@ enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: Async
...
@@ -2431,7 +2539,9 @@ enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: Async
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2467,7 +2577,9 @@ bundleenableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise\
...
@@ -2467,7 +2577,9 @@ bundleenableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise\
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2499,7 +2611,9 @@ isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback\<bool
...
@@ -2499,7 +2611,9 @@ isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback\<bool
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2532,7 +2646,9 @@ isDistributedEnabledByBundle(bundle: BundleOption): Promise\<boolean>
...
@@ -2532,7 +2646,9 @@ isDistributedEnabledByBundle(bundle: BundleOption): Promise\<boolean>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2568,7 +2684,9 @@ getDeviceRemindType(callback: AsyncCallback\<DeviceRemindType\>): void
...
@@ -2568,7 +2684,9 @@ getDeviceRemindType(callback: AsyncCallback\<DeviceRemindType\>): void
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2596,7 +2714,9 @@ getDeviceRemindType(): Promise\<DeviceRemindType\>
...
@@ -2596,7 +2714,9 @@ getDeviceRemindType(): Promise\<DeviceRemindType\>
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**返回值:**
**返回值:**
...
@@ -2613,6 +2733,7 @@ Notification.getDeviceRemindType()
...
@@ -2613,6 +2733,7 @@ Notification.getDeviceRemindType()
});
});
```
```
## Notification.publishAsBundle<sup>9+</sup>
## Notification.publishAsBundle<sup>9+</sup>
publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback
\<
void
\>
): void
publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback
\<
void
\>
): void
...
@@ -2621,10 +2742,11 @@ publishAsBundle(request: NotificationRequest, representativeBundle: string, user
...
@@ -2621,10 +2742,11 @@ publishAsBundle(request: NotificationRequest, representativeBundle: string, user
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**
系统API**
:此接口为系统接口,三方应用不支持调用。
**
需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER,ohos.permission.NOTIFICATION_AGENT_CONTROLLER
**
参数:**
**
系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------------- | ------------------------------------------- | ---- | --------------------------------------------- |
| -------------------- | ------------------------------------------- | ---- | --------------------------------------------- |
...
@@ -2668,7 +2790,9 @@ publishAsBundle(request: NotificationRequest, representativeBundle: string, user
...
@@ -2668,7 +2790,9 @@ publishAsBundle(request: NotificationRequest, representativeBundle: string, user
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**系统API**
:此接口为系统接口,三方应用不支持调用。
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER,ohos.permission.NOTIFICATION_AGENT_CONTROLLER
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
...
@@ -2712,6 +2836,8 @@ cancelAsBundle(id: number, representativeBundle: string, userId: number, callbac
...
@@ -2712,6 +2836,8 @@ cancelAsBundle(id: number, representativeBundle: string, userId: number, callbac
**系统能力**
:SystemCapability.Notification.Notification
**系统能力**
:SystemCapability.Notification.Notification
**需要权限**
: ohos.permission.NOTIFICATION_CONTROLLER,ohos.permission.NOTIFICATION_AGENT_CONTROLLER
**参数:**
**参数:**
...
@@ -2847,7 +2973,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC
...
@@ -2847,7 +2973,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC
| -------- | ----------------------------- | ---- | ---------------------- |
| -------- | ----------------------------- | ---- | ---------------------- |
| bundle |
[
BundleOption
](
#bundleoption
)
| 是 | 指定包信息。 |
| bundle |
[
BundleOption
](
#bundleoption
)
| 是 | 指定包信息。 |
| type |
[
SlotType
](
#slottype
)
| 是 | 指定渠道类型。 |
| type |
[
SlotType
](
#slottype
)
| 是 | 指定渠道类型。 |
| callback | AsyncCallback
\<
void
\>
| 是 |
获取
渠道使能回调函数。 |
| callback | AsyncCallback
\<
void
\>
| 是 |
设定
渠道使能回调函数。 |
**示例:**
**示例:**
...
@@ -2892,119 +3018,6 @@ Notification.isNotificationSlotEnabled(
...
@@ -2892,119 +3018,6 @@ Notification.isNotificationSlotEnabled(
});
});
```
```
## Notification.setSyncNotificationEnabledForUninstallApp <sup>9+</sup>
setSyncNotificationEnabledForUninstallApp(userId: number, enable: boolean, callback: AsyncCallback
<void>
): void
设定分布式设备未安装应用时是否同步通知的使能状态;使能开启时,分布式设备即使未安装应用,也可以同步收到通知;反之,则不能。(Callback形式)。
**系统能力**
:SystemCapability.Notification.Notification
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | ---------------------- |
| userId | number | 是 | 指定用户的Id。 |
| enable | boolean | 是 | 使能状态。 |
| callback | AsyncCallback
\<
void
\>
| 是 | 设定使能状态回调函数。 |
**示例:**
```
js
//setSyncNotificationEnabledForUninstallApp
function
setEnabledCallback
(
err
)
{
console
.
log
(
'
===================>setSyncNotificationEnabledForUninstallApp==================>
'
);
};
let
userId
=
100
Notification
.
setSyncNotificationEnabledForUninstallApp
(
userId
,
true
,
setEnabledCallback
);
```
## Notification.setSyncNotificationEnabledForUninstallApp <sup>9+</sup>
function setSyncNotificationEnabledForUninstallApp(userId: number, enable: boolean): Promise
<void>
设定分布式设备未安装应用时是否同步通知的使能状态;使能开启时,分布式设备即使未安装应用,也可以同步收到通知;反之,则不能。(Promise形式)。
**系统能力**
:SystemCapability.Notification.Notification
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------- | ---- | -------------- |
| userId | number | 是 | 指定用户的Id。 |
| enable | boolean | 是 | 使能状态。 |
**示例:**
```
js
//setSyncNotificationEnabledForUninstallApp
let
userId
=
100
Notification
.
setSyncNotificationEnabledForUninstallApp
(
userId
,
true
).
then
(()
=>
{
console
.
log
(
'
====================>setSyncNotificationEnabledForUninstallApp====================>
'
);
});
```
## Notification.getSyncNotificationEnabledForUninstallApp <sup>9+</sup>
getSyncNotificationEnabledForUninstallApp(userId: number, callback: AsyncCallback
<boolean>
): void
获取分布式设备未安装应用时是否同步通知的使能状态(Callback形式)。
**系统能力**
:SystemCapability.Notification.Notification
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | ---------------------- |
| userId | number | 是 | 指定用户的Id。 |
| callback | AsyncCallback
\<
void
\>
| 是 | 获取使能状态回调函数。 |
**示例:**
```
js
//getSyncNotificationEnabledForUninstallApp
function
getEnabledCallback
(
err
)
{
console
.
log
(
'
===================>getSyncNotificationEnabledForUninstallApp==================>
'
);
};
let
userId
=
100
Notification
.
getSyncNotificationEnabledForUninstallApp
(
userId
,
getEnabledCallback
);
```
## Notification.getSyncNotificationEnabledForUninstallApp <sup>9+</sup>
getSyncNotificationEnabledForUninstallApp(userId: number): Promise
<boolean>
获取分布式设备未安装应用时是否同步通知的使能状态(Promise形式)。
**系统能力**
:SystemCapability.Notification.Notification
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------- |
| userId | number | 是 | 指定用户的Id。 |
**示例:**
```
js
//getSyncNotificationEnabledForUninstallApp
let
userId
=
100
Notification
.
getSyncNotificationEnabledForUninstallApp
(
userId
,
true
).
then
(()
=>
{
console
.
log
(
'
====================>getSyncNotificationEnabledForUninstallApp====================>
'
);
});
```
## NotificationSubscriber
## NotificationSubscriber
**系统API**
:此接口为系统接口,三方应用不支持调用。
**系统API**
:此接口为系统接口,三方应用不支持调用。
...
@@ -3418,7 +3431,7 @@ Notification.subscribe(subscriber, subscribeCallback);
...
@@ -3418,7 +3431,7 @@ Notification.subscribe(subscriber, subscribeCallback);
| title | 是 | 是 | string | 是 | 按钮标题。 |
| title | 是 | 是 | string | 是 | 按钮标题。 |
| wantAgent | 是 | 是 | WantAgent | 是 | 点击按钮时触发的WantAgent。 |
| wantAgent | 是 | 是 | WantAgent | 是 | 点击按钮时触发的WantAgent。 |
| extras | 是 | 是 | { [key: string]: any } | 否 | 按钮扩展信息。 |
| extras | 是 | 是 | { [key: string]: any } | 否 | 按钮扩展信息。 |
| userInput
<sup>
9
+
</sup>
| 是 | 是 |
[
NotificationUserInput
](
#notificationuserinput8
)
| 否 | 用户输入对象实例。 |
| userInput
<sup>
8
+
</sup>
| 是 | 是 |
[
NotificationUserInput
](
#notificationuserinput8
)
| 否 | 用户输入对象实例。 |
## NotificationBasicContent
## NotificationBasicContent
...
@@ -3551,8 +3564,6 @@ Notification.subscribe(subscriber, subscribeCallback);
...
@@ -3551,8 +3564,6 @@ Notification.subscribe(subscriber, subscribeCallback);
| distributedOption
<sup>
8+
</sup>
| 是 | 是 |
[
DistributedOptions
](
#distributedoptions8
)
| 否 | 分布式通知的选项。 |
| distributedOption
<sup>
8+
</sup>
| 是 | 是 |
[
DistributedOptions
](
#distributedoptions8
)
| 否 | 分布式通知的选项。 |
| deviceId
<sup>
8+
</sup>
| 是 | 否 | string | 否 | 通知源的deviceId。 |
| deviceId
<sup>
8+
</sup>
| 是 | 否 | string | 否 | 通知源的deviceId。 |
| notificationFlags
<sup>
8+
</sup>
| 是 | 否 |
[
NotificationFlags
](
#notificationflags8
)
| 否 | 获取NotificationFlags。 |
| notificationFlags
<sup>
8+
</sup>
| 是 | 否 |
[
NotificationFlags
](
#notificationflags8
)
| 否 | 获取NotificationFlags。 |
| badgeNumber
<sup>
9+
</sup>
| 是 | 是 | number | 否 | 角标显示的未读通知数 |
| removalWantAgent
<sup>
9+
</sup>
| 是 | 是 | WantAgent | 否 | 删除通知后跳转的WantAgent |
## DistributedOptions<sup>8+</sup>
## DistributedOptions<sup>8+</sup>
...
@@ -3655,3 +3666,14 @@ Notification.subscribe(subscriber, subscribeCallback);
...
@@ -3655,3 +3666,14 @@ Notification.subscribe(subscriber, subscribeCallback);
| IDLE_REMIND | 1 | 提醒设备未被使用。 |
| IDLE_REMIND | 1 | 提醒设备未被使用。 |
| ACTIVE_DONOT_REMIND | 2 | 设备正在使用,无需提醒。 |
| ACTIVE_DONOT_REMIND | 2 | 设备正在使用,无需提醒。 |
| ACTIVE_REMIND | 3 | 提醒设备正在使用。 |
| ACTIVE_REMIND | 3 | 提醒设备正在使用。 |
## SourceType<sup>8+</sup>
**系统能力**
:SystemCapability.Notification.Notification
| 名称 | 值 | 描述 |
| -------------------- | --- | -------------------- |
| TYPE_NORMAL | 0 | 一般通知。 |
| TYPE_CONTINUOUS | 1 | 连续通知。 |
| TYPE_TIMER | 2 | 计划通知。 |
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md
浏览文件 @
f20de4cd
...
@@ -50,6 +50,8 @@ publishReminder(reminderReq: ReminderRequest): Promise<number>
...
@@ -50,6 +50,8 @@ publishReminder(reminderReq: ReminderRequest): Promise<number>
发布一个后台代理提醒,使用Promise方式实现异步调用。
发布一个后台代理提醒,使用Promise方式实现异步调用。
**需要权限**
: ohos.permission.PUBLISH_AGENT_REMINDER
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
**参数**
:
**参数**
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录