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