diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index dae24964f1dc80fcb1831dcdd1e76c334cb95384..2e3775498ccaa11f057b9e03ce609c2ed01b9935 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -356,6 +356,8 @@ declare namespace deviceManager { /** * Obtains a list of trusted devices. * + * @permission ohos.permission.ACCESS_SERVICE_DM + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600101 - Failed to execute the function. * @returns Returns a list of trusted devices. * @systemapi this method can be used only by system applications. @@ -366,6 +368,7 @@ declare namespace deviceManager { * Obtains a list of trusted devices. * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the callback to be invoked upon getTrustedDeviceList * @throws {BusinessError} 401 - Input parameter error. * @returns Returns a list of trusted devices. @@ -377,6 +380,7 @@ declare namespace deviceManager { * Obtains a list of trusted devices. * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM * @returns Returns a list of trusted devices. * @systemapi this method can be used only by system applications. */ @@ -386,6 +390,8 @@ declare namespace deviceManager { * Obtains local device info * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600101 - Failed to execute the function. * @returns Returns local device info. * @systemapi this method can be used only by system applications. @@ -396,6 +402,7 @@ declare namespace deviceManager { * Obtains local device info * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the callback to be invoked upon getLocalDeviceInfo * @throws {BusinessError} 401 - Input parameter error. * @returns Returns local device info. @@ -407,6 +414,7 @@ declare namespace deviceManager { * Obtains local device info * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM * @returns Returns local device info. * @systemapi this method can be used only by system applications. */ @@ -416,9 +424,10 @@ declare namespace deviceManager { * Start to discover device. * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param subscribeInfo subscribe info to discovery device * @throws {BusinessError} 401 - Input parameter error. - * @throws {BusinessError} 201 - Permission verify failed. + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600104 - Discovery invalid. * @throws {BusinessError} 11600101 - Failed to execute the function. * @systemapi this method can be used only by system applications. @@ -429,10 +438,11 @@ declare namespace deviceManager { * Start to discover device. * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param subscribeInfo subscribe info to discovery device * @param filterOptions filterOptions to filter discovery device * @throws {BusinessError} 401 - Input parameter error. - * @throws {BusinessError} 201 - Permission verify failed. + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600104 - Discovery invalid. * @throws {BusinessError} 11600101 - Failed to execute the function. * @systemapi this method can be used only by system applications. @@ -442,9 +452,10 @@ declare namespace deviceManager { /** * Stop to discover device. * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param subscribeId Service subscribe ID * @throws {BusinessError} 401 - Input parameter error. - * @throws {BusinessError} 201 - Permission verify failed. + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600101 - Failed to execute the function. * @systemapi this method can be used only by system applications. */ @@ -453,9 +464,10 @@ declare namespace deviceManager { /** * Publish discover device. * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param publishInfo publish info to Publish discovery device * @throws {BusinessError} 401 - Input parameter error. - * @throws {BusinessError} 201 - Permission verify failed. + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600105 - Publish invalid. * @throws {BusinessError} 11600101 - Failed to execute the function. * @systemapi this method can be used only by system applications. @@ -465,9 +477,10 @@ declare namespace deviceManager { /** * UnPublish discover device. * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param publishId Service publish ID, identify a publish operation, should be a unique id in package range * @throws {BusinessError} 401 - Input parameter error. - * @throws {BusinessError} 201 - Permission verify failed. + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600101 - Failed to execute the function. * @systemapi this method can be used only by system applications. */ @@ -476,6 +489,7 @@ declare namespace deviceManager { /** * Authenticate the specified device. * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param deviceInfo deviceInfo of device to authenticate * @param authParam authParam of device to authenticate * @param callback Indicates the callback to be invoked upon authenticateDevice @@ -488,9 +502,10 @@ declare namespace deviceManager { * unAuthenticate the specified device. * * @since 8 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param deviceInfo deviceInfo of device to unAuthenticate * @throws {BusinessError} 401 - Input parameter error. - * @throws {BusinessError} 201 - Permission verify failed. + * @throws {BusinessError} 202 - Permission verify failed. * @throws {BusinessError} 11600101 - Failed to execute the function. * @systemapi this method can be used only by system applications. */ @@ -499,6 +514,7 @@ declare namespace deviceManager { /** * verify auth info, such as pin code. * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param authInfo device auth info o verify * @param callback Indicates the callback to be invoked upon verifyAuthInfo * @throws {BusinessError} 401 - Input parameter error. @@ -510,9 +526,11 @@ declare namespace deviceManager { * Set user Operation from devicemanager Sea, this interface can only be used by devicemanager Sea. * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param operateAction User Operation Actions. * @param params Indicates the input param of the user. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ setUserOperation(operateAction: number, params: string): void; @@ -522,8 +540,10 @@ declare namespace deviceManager { * changes. * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the devicemanager ui state to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'uiStateChange', callback: Callback<{ param: string}>): void; @@ -532,8 +552,10 @@ declare namespace deviceManager { * Unregister uiStatueChange, this interface can only be used by devicemanager ui. * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the devicemanager ui state to unregister. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'uiStateChange', callback?: Callback<{ param: string}>): void; @@ -542,9 +564,11 @@ declare namespace deviceManager { * Register a device state callback so that the application can be notified upon device state changes based on * the application bundle name. * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -552,9 +576,11 @@ declare namespace deviceManager { /** * UnRegister device state callback based on the application bundle name. * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -562,8 +588,10 @@ declare namespace deviceManager { /** * Register a device found callback so that the application can be notified when the device was found * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device found callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void; @@ -571,8 +599,10 @@ declare namespace deviceManager { /** * UnRegister a device found callback so that the application can be notified when the device was found * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device found callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void; @@ -580,8 +610,10 @@ declare namespace deviceManager { /** * Register a device found result callback so that the application can be notified when the device discover was failed * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device found result callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void; @@ -589,8 +621,10 @@ declare namespace deviceManager { /** * UnRegister a device found result callback so that the application can be notified when the device discover was failed * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device found result callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void; @@ -599,8 +633,10 @@ declare namespace deviceManager { * Register a device publish result callback so that the application can be notified when the device publish success * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device publish result callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void; @@ -609,8 +645,10 @@ declare namespace deviceManager { * UnRegister a device publish result callback so that the application can be notified when the device publish was failed * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device publish result callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void; @@ -619,8 +657,10 @@ declare namespace deviceManager { * Register a device publish result callback so that the application can be notified when the device publish was failed * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device publish result callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void; @@ -629,8 +669,10 @@ declare namespace deviceManager { * UnRegister a device publish result callback so that the application can be notified when the device publish was failed * * @since 9 + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the device publish result callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void; @@ -638,8 +680,10 @@ declare namespace deviceManager { /** * Register a serviceError callback so that the application can be notified when devicemanager service died * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the service error callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ on(type: 'serviceDie', callback: () => void): void; @@ -647,8 +691,10 @@ declare namespace deviceManager { /** * UnRegister a serviceError callback so that the application can be notified when devicemanager service died * + * @permission ohos.permission.ACCESS_SERVICE_DM * @param callback Indicates the service error callback to register. * @throws {BusinessError} 401 - Input parameter error. + * @throws {BusinessError} 202 - Permission verify failed. * @systemapi this method can be used only by system applications. */ off(type: 'serviceDie', callback?: () => void): void;