diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index 646861dc96449ab663281565dc6864835c0ce093..7e219e3760c909780ddb320bcde1e9cf97364380 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;