1 Star 0 Fork 214

blackleon / notification_ces_standard

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

事件通知子系统

简介

OpenHarmony通过CES(Common Event Service,公共事件服务)为应用程序提供订阅、发布、退订公共事件的能力。

公共事件可分为系统公共事件和自定义公共事件。

  • 系统公共事件:系统将收集到的事件信息,根据系统策略发送给订阅该事件的用户程序。 例如:系统关键服务发布的系统事件(例如:hap安装,更新,卸载等)。

  • 自定义公共事件:应用自定义一些公共事件用来实现跨应用的事件通信能力。

每个应用都可以按需订阅公共事件,订阅成功且公共事件发布,系统会把其发送给应用。这些公共事件可能来自系统、其他应用和应用自身。

架构图

目录

/base/notification/ces_standard/
│── frameworks      # 组件目录
│   |── common/log  # 日志组件目录
│   |── core        # 组件native接口内部实现
│   ├── native      # 组件native接口实现
│── interface       # 对外接口目录
|   |── innerkits   # 组件native接口定义
|   |── kits/napi   # 组件napi实现
├── sa_profile      # 组件服务配置
├── services        # 组件服务实现
├── tools           # 组件工具实现
│── ohos.build      # 组件编译脚本

使用说明

概述

CommonEvent提供发布公共事件、创建订阅者、订阅、取消订阅等的接口。

公共事件的由string类型的event和CommonEventPublishData类型的options两部分组成,event表示公共事件的名称,options表示公共事件的属性信息。

CommonEventSubscribeInfo类型为订阅信息,用于创建公共事件订阅者,可以指定订阅者要订阅的公共事件,要求发布者需要具备的权限,订阅者的优先级等等。

CommonEventSubscriber类型为公共事件订阅者,用于获取所接受公共事件的相关信息,及设定公共事件的处理信息。

使用功能接口前,需要导入相关模块。

import CommonEvent from '@ohos.commonevent';

发布公共事件

CommonEvent.publish(event: string, callback: AsyncCallback)

  • 接口说明

    发布公共事件(callback形式)

  • publish参数描述

    名称 读写属性 类型 必填 描述
    event 只读 string 表示要发布的公共事件的名称
    callback 只读 AsyncCallback 表示发布公共事件方法的回调方法

返回值为void

  • 示例
import CommonEvent from '@ohos.commonevent'

function PublishCallBack(err) {
    console.info("==========================>PublishCallBack=======================>");
}

CommonEvent.publish("publish_event", PublishCallBack);

CommonEvent.publish(event: string, options: CommonEventPublishData, callback: AsyncCallback)

  • 接口说明

    发布公共事件指定发布信息(callback形式)

  • publish参数描述

    名称 读写属性 类型 必填 描述
    event 只读 string 表示要发布的公共事件的名称
    options 只读 CommonEventPublishData 表示要发布的公共事件的属性信息
    callback 只读 AsyncCallback 表示发布公共事件方法的回调方法
  • CommonEventPublishData类型说明

    名称 读写属性 类型 必填 描述
    bundleName 只读 string 表示包名称
    code 只读 int 表示公共事件的结果代码
    data 只读 string 表示公共事件的自定义结果数据
    subscriberPermissions 只读 Array 表示订阅者所需的权限
    isOrdered 只读 bool 表示是否是有序公共事件

返回值为void

  • 示例
import CommonEvent from '@ohos.commonevent'

var CommonEventPublishData = {
    code: 1,
    data: "information_data",
    isOrdered: false
}

function PublishCallBack(err) {
    console.info("==========================>PublishCallBack=======================>");
}

CommonEvent.publish("publish_event", CommonEventPublishData, PublishCallBack);

创建订阅者对象

CommonEvent.createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback)

  • 接口说明

    创建订阅者对象(callback形式)

  • createSubscriber参数描述

    名称 读写属性 类型 必填 描述
    subscribeInfo 只读 CommonEventSubscribeInfo 表示订阅信息
    callback 只读 AsyncCallback 表示创建订阅者的回调方法
  • CommonEventSubscriber 类说明

    名称 参数 返回值 描述
    getCode callback: AsyncCallback void 获取公共事件的结果代码(callback形式)
    getCode void Promise 获取公共事件的结果代码(Promise形式)
    setCode code: number, callback: AsyncCallback void 设置公共事件的结果代码(callback形式)
    setCode code: number Promise 设置公共事件的结果代码(Promise形式)
    getData callback: AsyncCallback void 获取公共事件的结果数据(callback形式)
    getData void Promise 获取公共事件的结果数据(Promise形式)
    setData data: string, callback: AsyncCallback void 设置公共事件的结果数据(callback形式)
    setData data: string Promise 设置公共事件的结果数据(Promise形式)
    setCodeAndData code: number, data: string, callback: AsyncCallback void 设置公共事件的结果代码和结果数据(callback形式)
    setCodeAndData code: number, data: string Promise 设置公共事件的结果代码和结果数据(Promise形式)
    isOrderedCommonEvent callback: AsyncCallback void 查询当前公共事件的是否为有序公共事件,返回true代表是有序公共事件,false代表不是有序公共事件(callback形式)
    isOrderedCommonEvent void Promise 查询当前公共事件的是否为有序公共事件,返回true代表是有序公共事件,false代表不是有序公共事件(Promise形式)
    abortCommonEvent callback: AsyncCallback void 取消当前的公共事件,仅对有序公共事件有效,取消后,公共事件不再向下一个订阅者传递(callback形式)
    abortCommonEvent void Promise 取消当前的公共事件,仅对有序公共事件有效,取消后,公共事件不再向下一个订阅者传递(Promise形式)
    clearAbortCommonEvent callback: AsyncCallback void 清除当前有序公共事件abort状态(callback形式)
    clearAbortCommonEvent void Promise 清除当前有序公共事件abort状态(Promise形式)
    getAbortCommonEvent callback: AsyncCallback void 获取当前有序公共事件是否取消的状态(callback形式)
    getAbortCommonEvent void Promise 获取当前有序公共事件是否取消的状态Promise形式)
    getSubscribeInfo callback: AsyncCallback void 获取订阅者的订阅信息(callback形式)
    getSubscribeInfo void Promise 获取订阅者的订阅信息(Promise形式)
  • CommonEventSubscribeInfo类型说明

    名称 读写属性 类型 必填 描述
    events 只读 Array 表示要订阅的公共事件
    publisherPermission 只读 string 表示发布者的权限
    publisherDeviceId 只读 int 表示设备ID,该值必须是同一ohos网络上的现有设备ID
    userId 只读 int 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。
    priority 只读 int 表示订阅者的优先级,范围为-100~1000。

返回值为void

  • 示例
import CommonEvent from '@ohos.commonevent'

var CommonEventSubscribeInfo = {
	events: ["event"]
};

function CreateSubscriberCallBack(err, data) {
    console.info("==========================>CreateSubscriberCallBack=======================>");
}

CommonEvent.createSubscriber(CommonEventSubscribeInfo, CreateSubscriberCallBack);

CommonEvent.createSubscriber(subscribeInfo: CommonEventSubscribeInfo)

  • 接口说明

    创建订阅者(Promise形式)

  • createSubscriber参数描述

    名称 读写属性 类型 必填 描述
    subscribeInfo 只读 CommonEventSubscribeInfo 表示订阅信息
  • CommonEventSubscribeInfo类型说明

    名称 读写属性 类型 必填 描述
    events 只读 Array 表示要发送的公共事件
    publisherPermission 只读 string 表示发布者的权限
    publisherDeviceId 只读 int 表示设备ID,该值必须是同一ohos网络上的现有设备ID
    userId 只读 int 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。
    priority 只读 int 表示订阅者的优先级。值的范围是-100到1000

返回值为Promise

  • 示例
import CommonEvent from '@ohos.commonevent'

var CommonEventSubscribeInfo = {
	events: ["event"]
};

CommonEvent.createSubscriber(CommonEventSubscribeInfo).then((data) => {
	console.info("==========================>createSubscriberPromise=======================>");
});

订阅公共事件

CommonEvent.subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback)

  • 接口说明

    订阅公共事件(callback形式)

  • subscribe参数描述

    名称 读写属性 类型 必填 描述
    subscriber 只读 CommonEventSubscriber 表示订阅者对象
    callback 只读 AsyncCallback 表示接收公共事件数据的回调函数
  • CommonEventData类型说明

    名称 读写属性 类型 必填 描述
    event 只读 string 表示当前接收的公共事件名称
    bundleName 只读 string 表示包名称
    code 只读 int 表示公共事件的结果代码,用于传递int类型的数据
    data 只读 string 表示公共事件的自定义结果数据,用于传递string 类型的数据

返回值为void

  • 示例

    • 无序事件:

      import CommonEvent from '@ohos.commonevent'
      
      var CommonEventSubscriber;
      //订阅者信息
      var CommonEventSubscribeInfo = {
      	events: ["event"]
      };
      //订阅回调
      function SubscriberCallBack(err, data) {
          console.info("==========================>SubscriberCallBack=======================>");
      }
      //创建订阅者回调
      function CreateSubscriberCallBack(err, data) {
      	console.info("==========================>CreateSubscriberCallBack=======================>");
      	CommonEventSubscriber = data;
      	//订阅事件
      	CommonEvent.subscribe(CommonEventSubscriber, SubscriberCallBack);
      }
      //创建订阅者
      CommonEvent.createSubscriber(CommonEventSubscribeInfo, CreateSubscriberCallBack);
    • 有序事件

      
      

    import CommonEvent from '@ohos.commonevent'

    var CommonEventSubscriber1; var CommonEventSubscriber2; //订阅者信息 var CommonEventSubscribeInfo1 = { events: ["event"] }; var CommonEventSubscribeInfo2 = { events: ["event"] }; //发布回调 function PublishCallback(err) { console.info("==========================>PublishCallback=======================>"); } //setCode回调 function setCodeCallBack(err) { console.info("==========================>setCodeCallBack=======================>"); } //setData回调 function setDataCallBack(err) { console.info("==========================>setDataCallBack=======================>"); } //finish回调 function finishCommonEventCallBack(err) { console.info("==========================>finishCommonEventCallBack=======================>"); } //订阅者1回调 function SubscriberCallBack1(err, data) { console.info("==========================>SubscriberCallBack1=======================>"); data.setCode(0, setCodeCallBack); data.setData("publish_event_change", setDataCallBack); data.finishCommonEvent(finishCommonEventCallBack) } //订阅者2回调 function SubscriberCallBack2(err, data) { console.info("==========================>SubscriberCallBack2=======================>"); data.finishCommonEvent(finishCommonEventCallBack) }

    //创建订阅者1回调 function CreateSubscriberCallBack1(err, data) { console.info("==========================>CreateSubscriberCallBack1=======================>"); CommonEventSubscriber1 = data; await CommonEvent.subscribe(CommonEventSubscriber1, SubscriberCallBack1); } //创建订阅者2回调 function CreateSubscriberCallBack2(err, data) { console.info("==========================>CreateSubscriberCallBack2=======================>"); CommonEventSubscriber2 = data; await CommonEvent.subscribe(CommonEventSubscriber2, SubscriberCallBack2); }

    //创建订阅者1 CommonEvent.createSubscriber(CommonEventSubscribeInfo1, CreateSubscriberCallBack1); //创建订阅者2 CommonEvent.createSubscriber(CommonEventSubscribeInfo2, CreateSubscriberCallBack2);

    //发布信息 var CommonEventPublishData = { bundleName: "publish_event_bundleName", code: 1, data: "publish_event_init", isOrdered: true } //发布 await CommonEvent.publish("event", CommonEventPublishData, PublishCallback);

取消订阅公共事件

CommonEvent.unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback)

  • 接口说明

    创建订阅者(callback形式)

  • unsubscribe参数描述

    名称 读写属性 类型 必填 描述
    subscriber 只读 CommonEventSubscriber 表示订阅者对象
    callback 只读 AsyncCallback 表示取消订阅的回调方法

返回值为void

  • 示例
import CommonEvent from '@ohos.commonevent'

var CommonEventSubscriber;
//订阅者信息
var CommonEventSubscribeInfo = {
	events: ["event"]
};
//订阅回调
function SubscriberCallBack(err, data) {
    console.info("==========================>SubscriberCallBack=======================>");
}
//创建订阅者回调
function CreateSubscriberCallBack(err, data) {
	console.info("==========================>CreateSubscriberCallBack=======================>");
	CommonEventSubscriber = data;
	//订阅事件
	CommonEvent.subscribe(CommonEventSubscriber, SubscriberCallBack);
}
//取消订阅回调
function UnsubscriberCallBack(err) {
    console.info("==========================>UnsubscriberCallBack=======================>");
}

//创建订阅者
CommonEvent.createSubscriber(CommonEventSubscribeInfo, CreateSubscriberCallBack);
//取消订阅
CommonEvent.unsubscriber(CommonEventSubscriber, UnsubscriberCallBack);

系统公共事件定义

系统公共事件宏 系统公共事件名称 订阅者所需权限
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_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
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.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
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 common.event.ABILITY_ADDED ohos.permission.LISTEN_BUNDLE_CHANGE
COMMON_EVENT_ABILITY_REMOVED common.event.ABILITY_REMOVED ohos.permission.LISTEN_BUNDLE_CHANGE
COMMON_EVENT_ABILITY_UPDATED common.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
COMMON_EVENT_DISK_UNMOUNTED usual.event.data.DISK_UNMOUNTED ohos.permission.WRITE_USER_STORAGE
COMMON_EVENT_DISK_MOUNTED usual.event.data.DISK_MOUNTED ohos.permission.WRITE_USER_STORAGE
COMMON_EVENT_DISK_BAD_REMOVAL usual.event.data.DISK_BAD_REMOVAL ohos.permission.WRITE_USER_STORAGE
COMMON_EVENT_DISK_UNMOUNTABLE usual.event.data.DISK_UNMOUNTABLE ohos.permission.WRITE_USER_STORAGE
COMMON_EVENT_DISK_EJECT usual.event.data.DISK_EJECT ohos.permission.WRITE_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 common.event.FOUNDATION_READY ohos.permission.RECEIVER_STARTUP_COMPLETED
COMMON_EVENT_AIRPLANE_MODE_CHANGED usual.event.AIRPLANE_MODE

相关仓

事件通知子系统

notification_ces_standard

ans部件仓

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS

简介

Common event and notification management framework | 通知和公共事件管理框架 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/skyblackleon/notification_ces_standard.git
git@gitee.com:skyblackleon/notification_ces_standard.git
skyblackleon
notification_ces_standard
notification_ces_standard
master

搜索帮助