From 964d75b4bc0559cfdb86416fe12e9be8a308c6b2 Mon Sep 17 00:00:00 2001 From: fanyouming Date: Mon, 30 Jun 2025 14:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2byod=20admin=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fanyouming Signed-off-by: fanyouming <497899782@qq.com> --- api/@ohos.enterprise.adminManager.d.ts | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts index 3919e784a8..bc324bb7ea 100644 --- a/api/@ohos.enterprise.adminManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -328,6 +328,23 @@ declare namespace adminManager { * @stagemodelonly * @since 12 */ + /** + * Disables a current administrator ability. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission, + * ohos.permission.START_PROVISIONING_MESSAGE or the shell uid can call this method. + * + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN or ohos.permission.START_PROVISIONING_MESSAGE + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the disableAdmin. + * @throws { BusinessError } 9200005 - Failed to deactivate the administrator application of the device. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 20 + */ function disableAdmin(admin: Want, userId?: number): Promise; /** @@ -740,6 +757,21 @@ declare namespace adminManager { function getDelegatedPolicies(admin: Want, bundleName: string): Array; /** + * Query wether self is a BYOD administrater. + * + * @permission ohos.permission.START_PROVISIONING_MESSAGE + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { boolean } true if byod admin is active, otherwise false. + * @throws { BusinessError } 9200012 - Parameter verification failed. + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 20 + */ + function isByodAdmin(admin: Want): boolean; + +/** * Administrator gets the delegated applications which access to the policy. * * @permission ohos.permission.ENTERPRISE_MANAGE_DELEGATED_POLICY -- Gitee