harmony 鸿蒙Common Events of the USB Subsystem
Common Events of the USB Subsystem
This document lists the common system events provided by the USB subsystem to applications. Applications can use APIs to subscribe to common system events.
COMMON_EVENT_USB_STATE
Indicates that the USB device state has changed.
- Constant value: “usual.event.hardware.usb.action.USB_STATE”
- Required subscriber permissions: none
When a USB device is connected to or disconnected from the device, the event notification service is triggered to publish this event.
COMMON_EVENT_USB_PORT_CHANGED
Indicates that the USB port state of the device has changed.
- Constant value: “usual.event.hardware.usb.action.USB_PORT_CHANGED”
- Required subscriber permissions: none
When the USB port status changes, the event notification service is triggered to publish this event.
APIs related to this event: dataRole parameter in setPortRoles.
COMMON_EVENT_USB_DEVICE_ATTACHED
Indicates that a USB device has been attached to the device functioning as a USB host.
- Constant value: “usual.event.hardware.usb.action.USB_DEVICE_ATTACHED”
- Required subscriber permissions: none
When a USB device is attached, the event notification service is triggered to publish this event.
APIs related to this event: USBDevice.
COMMON_EVENT_USB_DEVICE_DETACHED
Indicates that a USB device has been detached from the device functioning as a USB host.
- Constant value: “usual.event.hardware.usb.action.USB_DEVICE_DETACHED”
- Required subscriber permissions: none
When a USB device is deattached, the event notification service is triggered to publish this event.
APIs related to this event: USBDevice.
COMMON_EVENT_USB_ACCESSORY_ATTACHED
(Reserved, not supported yet) Indicates that a USB accessory was attached.
- Constant value: “usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED”
- Required subscriber permissions: none
COMMON_EVENT_USB_ACCESSORY_DETACHED
(Reserved, not supported yet) Indicates that a USB accessory was detached.
- Constant value: “usual.event.data.DISK_MOUNTED”
- Required subscriber permissions: none
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Common Events of the Ability Subsystem
harmony 鸿蒙Common Events of the Account Subsystem
harmony 鸿蒙Common Events of the Notification Service
harmony 鸿蒙Common Events of the Bundle Management Subsystem
harmony 鸿蒙Common Events of the File Management Subsystem
harmony 鸿蒙Common Events of the Language Subsystem
harmony 鸿蒙Common Events of the SMS Application
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦