From db9b7b8cdec41f4184b97bd545f7ee214113e397 Mon Sep 17 00:00:00 2001 From: caiminggang Date: Mon, 9 May 2022 09:54:41 +0800 Subject: [PATCH] =?UTF-8?q?EnterpriseDeviceManager=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=E7=94=A8=E6=88=B7=E6=8E=A5=E5=8F=A3=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=20https://gitee.com/openharmony/interface=5Fsdk-js/issues/I56E?= =?UTF-8?q?TI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caiminggang --- api/@ohos.enterpriseDeviceManager.d.ts | 39 ++++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index c005a48e6e..1683d8d0fa 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -46,7 +46,7 @@ declare namespace enterpriseDeviceManager { } /** - * Activates the given ability as a administrator of the device. + * Enables the given ability as a administrator of the device. * * Only apps with the ohos.permission.MANAGE_ADMIN permission or the shell uid can call this method. * @@ -55,49 +55,52 @@ declare namespace enterpriseDeviceManager { * @param admin Indicates the administrator ability information. * @param enterpriseInfo Indicates the enterprise information of the calling application. * @param type Indicates the type of administrator to set. - * @return {@code true} if activates administrator success. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if enables administrator success. * @permission ohos.permission.MANAGE_ADMIN */ - function activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; - function activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; /** - * Deactivates a current normal administrator ability. + * Disables a current normal administrator ability. * * Only apps with the ohos.permission.MANAGE_ADMIN permission or the shell uid can call this method. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param admin Indicates the administrator ability information. - * @return {@code true} if deactivates administrator success. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if disables administrator success. * @permission ohos.permission.MANAGE_ADMIN */ - function deactivateAdmin(admin: Want, callback: AsyncCallback): void; - function deactivateAdmin(admin: Want): Promise; + function disableAdmin(admin: Want, userId?: number, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId?: number): Promise; /** - * Deactivates a current super administrator ability. + * Disables a current super administrator ability. * * Only the administrator app or apps with the shell uid can call this method. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if deactivates super administrator success. + * @return {@code true} if disables super administrator success. */ - function deactivateSuperAdmin(bundleName: String, callback: AsyncCallback): void; - function deactivateSuperAdmin(bundleName: String): Promise; + function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; + function disableSuperAdmin(bundleName: String): Promise; /** - * Get whether the ability is activated as device administrator. + * Get whether the ability is enabled as device administrator. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param admin Indicates the administrator ability information. - * @return {@code true} if the administrator is active. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if the administrator is enabled. */ - function isAdminAppActive(admin: Want, callback: AsyncCallback): void; - function isAdminAppActive(admin: Want): Promise; + function isAdminEnabled(admin: Want, userId?: number, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, userId?: number): Promise; /** * Get information of the administrator's enterprise. @@ -125,12 +128,12 @@ declare namespace enterpriseDeviceManager { function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; /** - * Get whether the ability is activated as super device administrator. + * Get whether the ability is enabled as super device administrator. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if the administrator is activated as super device administrator. + * @return {@code true} if the administrator is enabled as super device administrator. */ function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; function isSuperAdmin(bundleName: String): Promise; -- Gitee