From 9b9b49e9c9ba3627d538fb377787b870a0895a75 Mon Sep 17 00:00:00 2001 From: puhui Date: Fri, 14 Jan 2022 20:05:59 +0800 Subject: [PATCH] =?UTF-8?q?DM=20=E6=96=B0=E5=A2=9EAPI=E4=B8=8E=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: puhui --- ...hos.distributedHardware.deviceManager.d.ts | 78 ++++++++++++++++--- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index 646861dc96..7e219e3760 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -18,6 +18,8 @@ import { AsyncCallback, Callback } from './basic'; declare namespace deviceManager { /** * DeviceInfo + * + * @systemapi this method can be used only by system applications. */ interface DeviceInfo { /** @@ -34,6 +36,11 @@ declare namespace deviceManager { * Device type of the device. */ deviceType: DeviceType; + + /** + * NetworkId of the device. + */ + networkId: string; } /** @@ -78,6 +85,8 @@ declare namespace deviceManager { /** * Device state change event definition + * + * @systemapi this method can be used only by system applications. */ enum DeviceStateChangeAction { /** @@ -242,16 +251,6 @@ declare namespace deviceManager { */ authType: number; - /** - * App application Icon. - */ - appIcon?: Uint8Array; - - /** - * App application thumbnail. - */ - appThumbnail?: Uint8Array; - /** * Authentication extra infos. */ @@ -288,6 +287,7 @@ declare namespace deviceManager { * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the callback to be invoked upon {@code DeviceManager} instance creation. + * @systemapi this method can be used only by system applications. */ function createDeviceManager(bundleName: string, callback: AsyncCallback): void; @@ -297,6 +297,8 @@ declare namespace deviceManager { interface DeviceManager { /** * Releases the {@code DeviceManager} instance after the methods for device management are no longer used. + * + * @systemapi this method can be used only by system applications. */ release(): void; @@ -307,9 +309,52 @@ declare namespace deviceManager { * This parameter can be null. For details about available values, see {@link #TARGET_PACKAGE_NAME} and * {@link #SORT_TYPE}. * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. */ getTrustedDeviceListSync(): Array; + /** + * Obtains a list of trusted devices. + * + * @param callback Indicates the callback to be invoked upon getTrustedDeviceList + * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. + */ + getTrustedDeviceList(callback:AsyncCallback>): void; + + /** + * Obtains a list of trusted devices. + * + * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. + */ + getTrustedDeviceList(): Promise>; + + /** + * Obtains local device info + * + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfoSync(): DeviceInfo; + + /** + * Obtains local device info + * + * @param callback Indicates the callback to be invoked upon getLocalDeviceInfo + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfo(callback:AsyncCallback): void; + + /** + * Obtains local device info + * + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfo(): Promise; + /** * Start to discover device. * @@ -330,12 +375,20 @@ declare namespace deviceManager { * Authenticate the specified device. * * @param deviceInfo deviceInfo of device to authenticate - * @param authparam authparam of device to authenticate + * @param authParam authParam of device to authenticate * @param callback Indicates the callback to be invoked upon authenticateDevice * @systemapi this method can be used only by system applications. */ authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinTone ?: number}>): void; + /** + * unAuthenticate the specified device. + * + * @param deviceInfo deviceInfo of device to unAuthenticate + * @systemapi this method can be used only by system applications. + */ + unAuthenticateDevice(deviceInfo: DeviceInfo): void + /** * verify auth info, such as pin code. * @@ -345,13 +398,13 @@ declare namespace deviceManager { */ verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void; - /** * Register a device state callback so that the application can be notified upon device state changes based on * the application bundle name. * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. + * @systemapi this method can be used only by system applications. */ on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -360,6 +413,7 @@ declare namespace deviceManager { * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. + * @systemapi this method can be used only by system applications. */ off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; -- Gitee