1# Device Management Changelog 2## cl.device_manager.1 API Permission Change 3 4Added permission verification for some APIs. 5 6**Change Impact** 7 8The apps developed using OpenHarmony 4.0.8.2 or later must have the corresponding permissions. Otherwise, the related APIs cannot be called. 9 10**Key API/Component Changes** 11 12| Module | Class | Method/Attribute/Enum/Constant | Added Permission| 13| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | 14| @ohos.distributedHardware.deviceManager | deviceManager | **function** release(): void | ohos.permission.ACCESS_SERVICE_DM | 15| @ohos.distributedHardware.deviceManager | deviceManager | **function** getTrustedDeviceListSync(): Array<DeviceInfo> | ohos.permission.ACCESS_SERVICE_DM | 16| @ohos.distributedHardware.deviceManager | deviceManager | **function** getTrustedDeviceListSync(isRefresh: boolean): Array<DeviceInfo>; | ohos.permission.ACCESS_SERVICE_DM | 17| @ohos.distributedHardware.deviceManager | deviceManager | **function** getTrustedDeviceList(callback:AsyncCallback<Array<DeviceInfo>>): void | ohos.permission.ACCESS_SERVICE_DM | 18| @ohos.distributedHardware.deviceManager | deviceManager | **function** getTrustedDeviceList(): Promise<Array<DeviceInfo>> | ohos.permission.ACCESS_SERVICE_DM | 19| @ohos.distributedHardware.deviceManager | deviceManager | **function** getLocalDeviceInfoSync(): DeviceInfo | ohos.permission.ACCESS_SERVICE_DM | 20| @ohos.distributedHardware.deviceManager | deviceManager | **function** getLocalDeviceInfo(callback:AsyncCallback<DeviceInfo>): void | ohos.permission.ACCESS_SERVICE_DM | 21| @ohos.distributedHardware.deviceManager | deviceManager | **function** getLocalDeviceInfo(): Promise<DeviceInfo> | ohos.permission.ACCESS_SERVICE_DM | 22| @ohos.distributedHardware.deviceManager | deviceManager | **function** getDeviceInfo(networkId: string, callback:AsyncCallback<DeviceInfo>): void | ohos.permission.ACCESS_SERVICE_DM | 23| @ohos.distributedHardware.deviceManager | deviceManager | **function** getDeviceInfo(networkId: string): Promise<DeviceInfo> | ohos.permission.ACCESS_SERVICE_DM | 24| @ohos.distributedHardware.deviceManager | deviceManager | **function** startDeviceDiscovery(subscribeInfo: SubscribeInfo): void | ohos.permission.ACCESS_SERVICE_DM | 25| @ohos.distributedHardware.deviceManager | deviceManager | **function** startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void | ohos.permission.ACCESS_SERVICE_DM | 26| @ohos.distributedHardware.deviceManager | deviceManager | **function** stopDeviceDiscovery(subscribeId: number): void | ohos.permission.ACCESS_SERVICE_DM | 27| @ohos.distributedHardware.deviceManager | deviceManager | **function** publishDeviceDiscovery(publishInfo: PublishInfo): void | ohos.permission.ACCESS_SERVICE_DM | 28| @ohos.distributedHardware.deviceManager | deviceManager | **function** unPublishDeviceDiscovery(publishId: number): void | ohos.permission.ACCESS_SERVICE_DM | 29| @ohos.distributedHardware.deviceManager | deviceManager | **function** authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void | ohos.permission.ACCESS_SERVICE_DM | 30| @ohos.distributedHardware.deviceManager | deviceManager | **function** unAuthenticateDevice(deviceInfo: DeviceInfo): void | ohos.permission.ACCESS_SERVICE_DM | 31| @ohos.distributedHardware.deviceManager | deviceManager | **function** verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void | ohos.permission.ACCESS_SERVICE_DM | 32| @ohos.distributedHardware.deviceManager | deviceManager | **function** setUserOperation(operateAction: number, params: string): void | ohos.permission.ACCESS_SERVICE_DM | 33| @ohos.distributedHardware.deviceManager | deviceManager | **function** requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{registerInfo: string}>): void; | ohos.permission.ACCESS_SERVICE_DM | 34| @ohos.distributedHardware.deviceManager | deviceManager | **function** importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: string}>): void; | ohos.permission.ACCESS_SERVICE_DM | 35| @ohos.distributedHardware.deviceManager | deviceManager | **function** deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string}>): void; | ohos.permission.ACCESS_SERVICE_DM | 36| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'uiStateChange', callback: Callback<{ param: string}>): void; | ohos.permission.ACCESS_SERVICE_DM | 37| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'uiStateChange', callback?: Callback<{ param: string}>): void; | ohos.permission.ACCESS_SERVICE_DM | 38| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | ohos.permission.ACCESS_SERVICE_DM | 39| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | ohos.permission.ACCESS_SERVICE_DM | 40| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void | ohos.permission.ACCESS_SERVICE_DM | 41| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void | ohos.permission.ACCESS_SERVICE_DM | 42| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void | ohos.permission.ACCESS_SERVICE_DM | 43| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void | ohos.permission.ACCESS_SERVICE_DM | 44| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void | ohos.permission.ACCESS_SERVICE_DM | 45| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void | ohos.permission.ACCESS_SERVICE_DM | 46| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void | ohos.permission.ACCESS_SERVICE_DM | 47| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void | ohos.permission.ACCESS_SERVICE_DM | 48| @ohos.distributedHardware.deviceManager | deviceManager | **function** on(type: 'serviceDie', callback: () => void): void | ohos.permission.ACCESS_SERVICE_DM | 49| @ohos.distributedHardware.deviceManager | deviceManager | **function** off(type: 'serviceDie', callback?: () => void): void | ohos.permission.ACCESS_SERVICE_DM | 50 51**Adaptation Guide** 52 53Apply for the corresponding permissions for your application before these APIs are called. 54 55 56## cl.device_manager.2 Permission Verification for All System APIs 57 58Added permission verification for all system APIs. 59 60**Change Impact** 61 62Non-system applications and applications without system API permission cannot call system APIs. 63 64**Key API/Component Changes** 65 66System API permission verification is performed on all APIs. The table below describes the APIs. 67 68| API/Enum/Variable| Type| System API| 69| -------- | -------- | ------- | 70| createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager>): void; | interface | Yes| 71| release(): void | interface | Yes| 72| getTrustedDeviceListSync(): Array<DeviceInfo> | interface | Yes| 73| getTrustedDeviceListSync(isRefresh: boolean): Array<DeviceInfo>; | interface | Yes| 74| getTrustedDeviceList(callback:AsyncCallback<Array<DeviceInfo>>): void | interface | Yes| 75| getTrustedDeviceList(): Promise<Array<DeviceInfo>> | interface | Yes| 76| getLocalDeviceInfoSync(): DeviceInfo | interface | Yes| 77| getLocalDeviceInfo(callback:AsyncCallback<DeviceInfo>): void | interface | Yes| 78| getLocalDeviceInfo(): Promise<DeviceInfo> | interface | Yes| 79| getDeviceInfo(networkId: string, callback:AsyncCallback<DeviceInfo>): void | interface | Yes| 80| getDeviceInfo(networkId: string): Promise<DeviceInfo> | interface | Yes| 81| startDeviceDiscovery(subscribeInfo: SubscribeInfo): void | interface | Yes| 82| startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void | interface | Yes| 83| stopDeviceDiscovery(subscribeId: number): void | interface | Yes| 84| publishDeviceDiscovery(publishInfo: PublishInfo): void | interface | Yes| 85| unPublishDeviceDiscovery(publishId: number): void | interface | Yes| 86| authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void |interface | Yes| 87| unAuthenticateDevice(deviceInfo: DeviceInfo): void | interface | Yes| 88| verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void | interface | Yes| 89| setUserOperation(operateAction: number, params: string): void | interface | Yes| 90| requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{registerInfo: string}>): void; | interface | Yes| 91| importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: string}>): void; | interface | Yes| 92| deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string}>): void; | interface | Yes| 93| on(type: 'uiStateChange', callback: Callback<{ param: string}>): void; | interface | Yes| 94| off(type: 'uiStateChange', callback?: Callback<{ param: string}>): void; | interface | Yes| 95| on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | interface | Yes| 96| off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | interface | Yes| 97| on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void | interface | Yes| 98| off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void | interface | Yes| 99| on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void | interface | Yes| 100| off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void | interface | Yes| 101| on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void | interface | Yes| 102| off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void | interface | Yes| 103| on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void | interface | Yes| 104| off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void | interface | Yes| 105| on(type: 'serviceDie', callback: () => void): void | interface | Yes| 106| off(type: 'serviceDie', callback?: () => void): void | interface | Yes| 107 108**Adaptation Guide** 109 110The caller must be a system application or an application with the system API permission. 111