harmony 鸿蒙USB Subsystem Changelog
USB Subsystem Changelog
cl.usb.1 Security Permission Change of the USB Driver API
In version 4.0x or later, the ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER permission needs to be declared for the bindDevice, unbindDevice, and queryDevices APIs in @ohos.driver.deviceManager.
function unbindDevice(deviceId: number): Promise<number>;
function unbindDevice(deviceId: number, callback: AsyncCallback
function bindDevice(deviceId: number, onDisconnect: AsyncCallback
function bindDevice(deviceId: number, onDisconnect: AsyncCallback
function queryDevices(busType?: number): Array
Change Impact
Before the change, the APIs can be called without declaring the required permission, which poses security risks.
After the change, the APIs can be called only if the ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER permission is declared.
Involved APIs
The ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER permission is required for calling the following APIs: bindDevice unbindDevice queryDevices
Adaptation Guide
Apply for the ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER permission when calling the related APIs.
你可能感兴趣的鸿蒙文章
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦