harmony 鸿蒙Device Management JS API Changelog

  • 2023-10-30
  • 浏览 (337)

Device Management JS API Changelog

From OpenHarmony 4.1.2.3, all the APIs of the deviceManager module are deprecated. You are advised to use @ohos.distributedDeviceManager.

Key API/Component Changes

|Class|Interface Type|Declaration|Change Type| |–|–|–|–| |deviceManager|method|function createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager>): void|Deprecated| |DeviceManager|method|function release(): void|Deprecated| |DeviceManager|method|function getTrustedDeviceListSync(): Array<DeviceInfo>|Deprecated| |DeviceManager|method|function getTrustedDeviceListSync(isRefresh: boolean): Array<DeviceInfo>;|Deprecated| |DeviceManager|method|function getTrustedDeviceList(callback:AsyncCallback<Array<DeviceInfo>>): void|Deprecated| |DeviceManager|method|function getTrustedDeviceList(): Promise<Array<DeviceInfo>>|Deprecated| |DeviceManager|method|function getLocalDeviceInfoSync(): DeviceInfo|Deprecated| |DeviceManager|method|function getLocalDeviceInfo(callback:AsyncCallback<DeviceInfo>): void|Deprecated| |DeviceManager|method|function getLocalDeviceInfo(): Promise<DeviceInfo>|Deprecated| |DeviceManager|method|function getDeviceInfo(networkId: string, callback:AsyncCallback<DeviceInfo>): void|Deprecated| |DeviceManager|method|function getDeviceInfo(networkId: string): Promise<DeviceInfo>|Deprecated| |DeviceManager|method|function startDeviceDiscovery(subscribeInfo: SubscribeInfo): void|Deprecated| |DeviceManager|method|function startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void|Deprecated| |DeviceManager|method|function stopDeviceDiscovery(subscribeId: number): void|Deprecated| |DeviceManager|method|function publishDeviceDiscovery(publishInfo: PublishInfo): void|Deprecated| |DeviceManager|method|function unPublishDeviceDiscovery(publishId: number): void|Deprecated| |DeviceManager|method|function authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void|Deprecated| |DeviceManager|method|function unAuthenticateDevice(deviceInfo: DeviceInfo): void|Deprecated| |DeviceManager|method|function verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void|Deprecated| |DeviceManager|method|function setUserOperation(operateAction: number, params: string): void|Deprecated| |DeviceManager|method|function requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{registerInfo: string}>): void;|Deprecated| |DeviceManager|method|function importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: string}>): void;|Deprecated| |DeviceManager|method|function deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string}>): void;|Deprecated| |DeviceManager|method|function on(type: ‘uiStateChange’, callback: Callback<{ param: string}>): void;|Deprecated| |DeviceManager|method|function off(type: ‘uiStateChange’, callback?: Callback<{ param: string}>): void;|Deprecated| |DeviceManager|method|function on(type: ‘deviceStateChange’, callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void|Deprecated| |DeviceManager|method|function off(type: ‘deviceStateChange’, callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void|Deprecated| |DeviceManager|method|function on(type: ‘deviceFound’, callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void|Deprecated| |DeviceManager|method|function off(type: ‘deviceFound’, callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void|Deprecated| |DeviceManager|method|function on(type: ‘discoverFail’, callback: Callback<{ subscribeId: number, reason: number }>): void|Deprecated| |DeviceManager|method|function off(type: ‘discoverFail’, callback?: Callback<{ subscribeId: number, reason: number }>): void|Deprecated| |DeviceManager|method|function on(type: ‘publishSuccess’, callback: Callback<{ publishId: number }>): void|Deprecated| |DeviceManager|method|function off(type: ‘publishSuccess’, callback?: Callback<{ publishId: number }>): void|Deprecated| |DeviceManager|method|function on(type: ‘publishFail’, callback: Callback<{ publishId: number, reason: number }>): void|Deprecated| |DeviceManager|method|function off(type: ‘publishFail’, callback?: Callback<{ publishId: number, reason: number }>): void|Deprecated| |DeviceManager|method|function on(type: ‘serviceDie’, callback: () => void): void|Deprecated| |DeviceManager|method|function off(type: ‘serviceDie’, callback?: () => void): void|Deprecated| |deviceManager|interface|DeviceInfo|Deprecated| |deviceManager|interface|SubscribeInfo|Deprecated| |deviceManager|interface|AuthParam|Deprecated| |deviceManager|interface|AuthInfo|Deprecated| |deviceManager|interface|PublishInfo|Deprecated| |deviceManager|enum|DeviceType|Deprecated| |deviceManager|enum|AuthForm|Deprecated| |deviceManager|enum|DeviceStateChangeAction|Deprecated| |deviceManager|enum|DiscoverMode|Deprecated| |deviceManager|enum|ExchangeMedium|Deprecated| |deviceManager|enum|ExchangeFreq|Deprecated| |deviceManager|enum|SubscribeCap|Deprecated|

Adaptation Guide

You need to adapt the changed interfaces.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Multimedia Subsystem Changelog

0  赞