diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index f918e3e45bee0d56953117797b608b100b87601b..646861dc96449ab663281565dc6864835c0ce093 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -221,9 +221,63 @@ declare namespace deviceManager { */ enum SubscribeCap { /** - * ddmpCapability + * ddmpCapability, will be discarded later. Currently, it will be converted to OSD capability inner. */ - SUBSCRIBE_CAPABILITY_DDMP = 0 + SUBSCRIBE_CAPABILITY_DDMP = 0, + + /** + * One Super Device Capability + */ + SUBSCRIBE_CAPABILITY_OSD = 1 + } + + /** + * Device Authentication param + * + * @systemapi this method can be used only by system applications + */ + interface AuthParam { + /** + * Authentication type, 1 for pin code. + */ + authType: number; + + /** + * App application Icon. + */ + appIcon?: Uint8Array; + + /** + * App application thumbnail. + */ + appThumbnail?: Uint8Array; + + /** + * Authentication extra infos. + */ + extraInfo: {[key:string] : any}; + } + + /** + * Device auth info. + * + * @systemapi this method can be used only by system applications + */ + interface AuthInfo { + /** + * Authentication type, 1 for pin code. + */ + authType: number; + + /** + * the token used for this authentication. + */ + token: number; + + /** + * Authentication extra infos. + */ + extraInfo: {[key:string] : any}; } /** @@ -259,7 +313,6 @@ declare namespace deviceManager { /** * Start to discover device. * - * @param bundleName Indicates the bundle name of the application. * @param subscribeInfo subscribe info to discovery device * @systemapi this method can be used only by system applications. */ @@ -268,20 +321,30 @@ declare namespace deviceManager { /** * Stop to discover device. * - * @param bundleName Indicates the bundle name of the application. * @param subscribeId Service subscribe ID * @systemapi this method can be used only by system applications. */ stopDeviceDiscovery(subscribeId: number): void; /** - * authenticate the specified device. + * Authenticate the specified device. * - * @param bundleName Indicates the bundle name of the application. * @param deviceInfo deviceInfo 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; + + /** + * verify auth info, such as pin code. + * + * @param authInfo device auth info o verify + * @param callback Indicates the callback to be invoked upon verifyAuthInfo * @systemapi this method can be used only by system applications. */ - authenticateDevice(deviceInfo: DeviceInfo): void; + 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 @@ -332,22 +395,6 @@ declare namespace deviceManager { */ off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void; - /** - * Register a device auth result callback so that the application can be notified when the device was found - * - * @param callback Indicates the device auth result callback to register. - * @systemapi this method can be used only by system applications. - */ - on(type: 'authResult', callback: Callback<{ deviceId: string, status: number, reason: number }>): void; - - /** - * UnRegister a device auth result callback so that the application can be notified when the device was found - * - * @param callback Indicates the device auth result callback to register. - * @systemapi this method can be used only by system applications. - */ - off(type: 'authResult', callback?: Callback<{ deviceId: string, status: number, reason: number }>): void; - /** * Register a serviceError callback so that the application can be notified when devicemanager service died *