161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit MDMKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport type Want from './@ohos.app.ability.Want'; 2361847f8eSopenharmony_ci 2461847f8eSopenharmony_ci/** 2561847f8eSopenharmony_ci * This module provides the capability to manage the administrator of the enterprise devices. 2661847f8eSopenharmony_ci * 2761847f8eSopenharmony_ci * @namespace adminManager 2861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 2961847f8eSopenharmony_ci * @since 9 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace adminManager { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Provides the enterprise information. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @typedef EnterpriseInfo 3661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 3761847f8eSopenharmony_ci * @systemapi 3861847f8eSopenharmony_ci * @since 9 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci export interface EnterpriseInfo { 4161847f8eSopenharmony_ci /** 4261847f8eSopenharmony_ci * The name of enterprise. 4361847f8eSopenharmony_ci * 4461847f8eSopenharmony_ci * @type { string } 4561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 4661847f8eSopenharmony_ci * @systemapi 4761847f8eSopenharmony_ci * @since 9 4861847f8eSopenharmony_ci */ 4961847f8eSopenharmony_ci name: string; 5061847f8eSopenharmony_ci 5161847f8eSopenharmony_ci /** 5261847f8eSopenharmony_ci * The description of enterprise. 5361847f8eSopenharmony_ci * 5461847f8eSopenharmony_ci * @type { string } 5561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 5661847f8eSopenharmony_ci * @systemapi 5761847f8eSopenharmony_ci * @since 9 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_ci description: string; 6061847f8eSopenharmony_ci } 6161847f8eSopenharmony_ci 6261847f8eSopenharmony_ci /** 6361847f8eSopenharmony_ci * Enum for type of administrator. 6461847f8eSopenharmony_ci * 6561847f8eSopenharmony_ci * @enum { number } 6661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 6761847f8eSopenharmony_ci * @systemapi 6861847f8eSopenharmony_ci * @since 9 6961847f8eSopenharmony_ci */ 7061847f8eSopenharmony_ci export enum AdminType { 7161847f8eSopenharmony_ci /** 7261847f8eSopenharmony_ci * The value of normal administrator. 7361847f8eSopenharmony_ci * 7461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 7561847f8eSopenharmony_ci * @systemapi 7661847f8eSopenharmony_ci * @since 9 7761847f8eSopenharmony_ci */ 7861847f8eSopenharmony_ci ADMIN_TYPE_NORMAL = 0x00, 7961847f8eSopenharmony_ci 8061847f8eSopenharmony_ci /** 8161847f8eSopenharmony_ci * The value of super administrator. 8261847f8eSopenharmony_ci * 8361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 8461847f8eSopenharmony_ci * @systemapi 8561847f8eSopenharmony_ci * @since 9 8661847f8eSopenharmony_ci */ 8761847f8eSopenharmony_ci ADMIN_TYPE_SUPER = 0x01 8861847f8eSopenharmony_ci } 8961847f8eSopenharmony_ci 9061847f8eSopenharmony_ci /** 9161847f8eSopenharmony_ci * Enum for managed event 9261847f8eSopenharmony_ci * 9361847f8eSopenharmony_ci * @enum { number } 9461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 9561847f8eSopenharmony_ci * @since 12 9661847f8eSopenharmony_ci */ 9761847f8eSopenharmony_ci export enum ManagedEvent { 9861847f8eSopenharmony_ci /** 9961847f8eSopenharmony_ci * The event of bundle added. 10061847f8eSopenharmony_ci * 10161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 10261847f8eSopenharmony_ci * @since 12 10361847f8eSopenharmony_ci */ 10461847f8eSopenharmony_ci MANAGED_EVENT_BUNDLE_ADDED = 0, 10561847f8eSopenharmony_ci 10661847f8eSopenharmony_ci /** 10761847f8eSopenharmony_ci * The event of bundle removed. 10861847f8eSopenharmony_ci * 10961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 11061847f8eSopenharmony_ci * @since 12 11161847f8eSopenharmony_ci */ 11261847f8eSopenharmony_ci MANAGED_EVENT_BUNDLE_REMOVED = 1, 11361847f8eSopenharmony_ci 11461847f8eSopenharmony_ci /** 11561847f8eSopenharmony_ci * The event of app start. 11661847f8eSopenharmony_ci * 11761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 11861847f8eSopenharmony_ci * @since 12 11961847f8eSopenharmony_ci */ 12061847f8eSopenharmony_ci MANAGED_EVENT_APP_START = 2, 12161847f8eSopenharmony_ci 12261847f8eSopenharmony_ci /** 12361847f8eSopenharmony_ci * The event of app stop. 12461847f8eSopenharmony_ci * 12561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 12661847f8eSopenharmony_ci * @since 12 12761847f8eSopenharmony_ci */ 12861847f8eSopenharmony_ci MANAGED_EVENT_APP_STOP = 3, 12961847f8eSopenharmony_ci 13061847f8eSopenharmony_ci /** 13161847f8eSopenharmony_ci * The event of system update. 13261847f8eSopenharmony_ci * 13361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 13461847f8eSopenharmony_ci * @since 12 13561847f8eSopenharmony_ci */ 13661847f8eSopenharmony_ci MANAGED_EVENT_SYSTEM_UPDATE = 4, 13761847f8eSopenharmony_ci } 13861847f8eSopenharmony_ci 13961847f8eSopenharmony_ci /** 14061847f8eSopenharmony_ci * Enables the given ability as a administrator of the device. 14161847f8eSopenharmony_ci * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. 14261847f8eSopenharmony_ci * 14361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 14461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 14561847f8eSopenharmony_ci * The admin must have the corresponding permission. 14661847f8eSopenharmony_ci * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. 14761847f8eSopenharmony_ci * @param { AdminType } type - type indicates the type of administrator to set. 14861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of enableAdmin. 14961847f8eSopenharmony_ci * @throws { BusinessError } 9200003 - The administrator ability component is invalid. 15061847f8eSopenharmony_ci * @throws { BusinessError } 9200004 - Failed to activate the administrator application of the device. 15161847f8eSopenharmony_ci * @throws { BusinessError } 9200007 - The system ability works abnormally. 15261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 15361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 15461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 15561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 15661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 15761847f8eSopenharmony_ci * @systemapi 15861847f8eSopenharmony_ci * @StageModelOnly 15961847f8eSopenharmony_ci * @since 9 16061847f8eSopenharmony_ci */ 16161847f8eSopenharmony_ci function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<void>): void; 16261847f8eSopenharmony_ci 16361847f8eSopenharmony_ci /** 16461847f8eSopenharmony_ci * Enables the given ability as a administrator of the device. 16561847f8eSopenharmony_ci * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. 16661847f8eSopenharmony_ci * 16761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 16861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 16961847f8eSopenharmony_ci * The admin must have the corresponding permission. 17061847f8eSopenharmony_ci * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. 17161847f8eSopenharmony_ci * @param { AdminType } type - type indicates the type of administrator to set. 17261847f8eSopenharmony_ci * @param { number } userId - userId indicates the user ID. 17361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of enableAdmin. 17461847f8eSopenharmony_ci * @throws { BusinessError } 9200003 - The administrator ability component is invalid. 17561847f8eSopenharmony_ci * @throws { BusinessError } 9200004 - Failed to activate the administrator application of the device. 17661847f8eSopenharmony_ci * @throws { BusinessError } 9200007 - The system ability works abnormally. 17761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 17861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 17961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 18061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 18161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 18261847f8eSopenharmony_ci * @systemapi 18361847f8eSopenharmony_ci * @StageModelOnly 18461847f8eSopenharmony_ci * @since 9 18561847f8eSopenharmony_ci */ 18661847f8eSopenharmony_ci function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<void>): void; 18761847f8eSopenharmony_ci 18861847f8eSopenharmony_ci /** 18961847f8eSopenharmony_ci * Enables the given ability as a administrator of the device. 19061847f8eSopenharmony_ci * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. 19161847f8eSopenharmony_ci * 19261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 19361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 19461847f8eSopenharmony_ci * The admin must have the corresponding permission. 19561847f8eSopenharmony_ci * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. 19661847f8eSopenharmony_ci * @param { AdminType } type - type indicates the type of administrator to set. 19761847f8eSopenharmony_ci * @param { number } [userId] - userId indicates the user ID or do not pass user ID. 19861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the enableAdmin. 19961847f8eSopenharmony_ci * @throws { BusinessError } 9200003 - The administrator ability component is invalid. 20061847f8eSopenharmony_ci * @throws { BusinessError } 9200004 - Failed to activate the administrator application of the device. 20161847f8eSopenharmony_ci * @throws { BusinessError } 9200007 - The system ability works abnormally. 20261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 20361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 20461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 20561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 20661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 20761847f8eSopenharmony_ci * @systemapi 20861847f8eSopenharmony_ci * @StageModelOnly 20961847f8eSopenharmony_ci * @since 9 21061847f8eSopenharmony_ci */ 21161847f8eSopenharmony_ci function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<void>; 21261847f8eSopenharmony_ci 21361847f8eSopenharmony_ci /** 21461847f8eSopenharmony_ci * Disables a current normal administrator ability. 21561847f8eSopenharmony_ci * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. 21661847f8eSopenharmony_ci * 21761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 21861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 21961847f8eSopenharmony_ci * The admin must have the corresponding permission. 22061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of disableAdmin. 22161847f8eSopenharmony_ci * @throws { BusinessError } 9200005 - Failed to deactivate the administrator application of the device. 22261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 22361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 22461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 22561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 22661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 22761847f8eSopenharmony_ci * @systemapi 22861847f8eSopenharmony_ci * @StageModelOnly 22961847f8eSopenharmony_ci * @since 9 23061847f8eSopenharmony_ci */ 23161847f8eSopenharmony_ci function disableAdmin(admin: Want, callback: AsyncCallback<void>): void; 23261847f8eSopenharmony_ci 23361847f8eSopenharmony_ci /** 23461847f8eSopenharmony_ci * Disables a current normal administrator ability. 23561847f8eSopenharmony_ci * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. 23661847f8eSopenharmony_ci * 23761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 23861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 23961847f8eSopenharmony_ci * The admin must have the corresponding permission. 24061847f8eSopenharmony_ci * @param { number } userId - userId indicates the user ID. 24161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of disableAdmin. 24261847f8eSopenharmony_ci * @throws { BusinessError } 9200005 - Failed to deactivate the administrator application of the device. 24361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 24461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 24561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 24661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 24761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 24861847f8eSopenharmony_ci * @systemapi 24961847f8eSopenharmony_ci * @StageModelOnly 25061847f8eSopenharmony_ci * @since 9 25161847f8eSopenharmony_ci */ 25261847f8eSopenharmony_ci function disableAdmin(admin: Want, userId: number, callback: AsyncCallback<void>): void; 25361847f8eSopenharmony_ci 25461847f8eSopenharmony_ci /** 25561847f8eSopenharmony_ci * Disables a current administrator ability. 25661847f8eSopenharmony_ci * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. 25761847f8eSopenharmony_ci * 25861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 25961847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 26061847f8eSopenharmony_ci * The admin must have the corresponding permission. 26161847f8eSopenharmony_ci * @param { number } [userId] - userId indicates the user ID or do not pass user ID. 26261847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the disableAdmin. 26361847f8eSopenharmony_ci * @throws { BusinessError } 9200005 - Failed to deactivate the administrator application of the device. 26461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 26561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 26661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 26761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 26861847f8eSopenharmony_ci * @StageModelOnly 26961847f8eSopenharmony_ci * @since 12 27061847f8eSopenharmony_ci */ 27161847f8eSopenharmony_ci function disableAdmin(admin: Want, userId?: number): Promise<void>; 27261847f8eSopenharmony_ci 27361847f8eSopenharmony_ci /** 27461847f8eSopenharmony_ci * Disables a current super administrator ability. 27561847f8eSopenharmony_ci * Only the administrator app or apps with the shell uid can call this method. 27661847f8eSopenharmony_ci * 27761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 27861847f8eSopenharmony_ci * @param { String } bundleName - bundleName indicates the administrator bundle information. 27961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of disableSuperAdmin. 28061847f8eSopenharmony_ci * @throws { BusinessError } 9200005 - Failed to deactivate the administrator application of the device. 28161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 28261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 28361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 28461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 28561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 28661847f8eSopenharmony_ci * @systemapi 28761847f8eSopenharmony_ci * @StageModelOnly 28861847f8eSopenharmony_ci * @since 9 28961847f8eSopenharmony_ci */ 29061847f8eSopenharmony_ci function disableSuperAdmin(bundleName: String, callback: AsyncCallback<void>): void; 29161847f8eSopenharmony_ci 29261847f8eSopenharmony_ci /** 29361847f8eSopenharmony_ci * Disables a current super administrator ability. 29461847f8eSopenharmony_ci * Only the administrator app or apps with the shell uid can call this method. 29561847f8eSopenharmony_ci * 29661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 29761847f8eSopenharmony_ci * @param { String } bundleName - bundleName indicates the administrator bundle information. 29861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the disableSuperAdmin. 29961847f8eSopenharmony_ci * @throws { BusinessError } 9200005 - Failed to deactivate the administrator application of the device. 30061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 30161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 30261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 30361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 30461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 30561847f8eSopenharmony_ci * @systemapi 30661847f8eSopenharmony_ci * @StageModelOnly 30761847f8eSopenharmony_ci * @since 9 30861847f8eSopenharmony_ci */ 30961847f8eSopenharmony_ci function disableSuperAdmin(bundleName: String): Promise<void>; 31061847f8eSopenharmony_ci 31161847f8eSopenharmony_ci /** 31261847f8eSopenharmony_ci * Get whether the ability is enabled as device administrator. 31361847f8eSopenharmony_ci * 31461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 31561847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - callback contained true if the administrator is enabled. 31661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 31761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 31861847f8eSopenharmony_ci * 2. Incorrect parameter types. 31961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 32061847f8eSopenharmony_ci * @systemapi 32161847f8eSopenharmony_ci * @StageModelOnly 32261847f8eSopenharmony_ci * @since 9 32361847f8eSopenharmony_ci */ 32461847f8eSopenharmony_ci function isAdminEnabled(admin: Want, callback: AsyncCallback<boolean>): void; 32561847f8eSopenharmony_ci 32661847f8eSopenharmony_ci /** 32761847f8eSopenharmony_ci * Get whether the ability is enabled as device administrator. 32861847f8eSopenharmony_ci * 32961847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 33061847f8eSopenharmony_ci * @param { number } userId - userId indicates the user ID. 33161847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - callback contained true if the administrator is enabled. 33261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 33361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 33461847f8eSopenharmony_ci * 2. Incorrect parameter types. 33561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 33661847f8eSopenharmony_ci * @systemapi 33761847f8eSopenharmony_ci * @StageModelOnly 33861847f8eSopenharmony_ci * @since 9 33961847f8eSopenharmony_ci */ 34061847f8eSopenharmony_ci function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<boolean>): void; 34161847f8eSopenharmony_ci 34261847f8eSopenharmony_ci /** 34361847f8eSopenharmony_ci * Get whether the ability is enabled as device administrator. 34461847f8eSopenharmony_ci * 34561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 34661847f8eSopenharmony_ci * @param { number } [userId] - userId indicates the user ID or do not pass user ID. 34761847f8eSopenharmony_ci * @returns { Promise<boolean> } promise contained true if the administrator is enabled. 34861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 34961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 35061847f8eSopenharmony_ci * 2. Incorrect parameter types. 35161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 35261847f8eSopenharmony_ci * @systemapi 35361847f8eSopenharmony_ci * @StageModelOnly 35461847f8eSopenharmony_ci * @since 9 35561847f8eSopenharmony_ci */ 35661847f8eSopenharmony_ci function isAdminEnabled(admin: Want, userId?: number): Promise<boolean>; 35761847f8eSopenharmony_ci 35861847f8eSopenharmony_ci /** 35961847f8eSopenharmony_ci * Get information of the administrator's enterprise. 36061847f8eSopenharmony_ci * 36161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 36261847f8eSopenharmony_ci * @param { AsyncCallback<EnterpriseInfo> } callback - callback contained the enterprise info of administrator. 36361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 36461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 36561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 36661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 36761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 36861847f8eSopenharmony_ci * @systemapi 36961847f8eSopenharmony_ci * @StageModelOnly 37061847f8eSopenharmony_ci * @since 9 37161847f8eSopenharmony_ci */ 37261847f8eSopenharmony_ci function getEnterpriseInfo(admin: Want, callback: AsyncCallback<EnterpriseInfo>): void; 37361847f8eSopenharmony_ci 37461847f8eSopenharmony_ci /** 37561847f8eSopenharmony_ci * Get information of the administrator's enterprise. 37661847f8eSopenharmony_ci * 37761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 37861847f8eSopenharmony_ci * @returns { Promise<EnterpriseInfo> } promise contained the enterprise info of administrator. 37961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 38061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 38161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 38261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 38361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 38461847f8eSopenharmony_ci * @systemapi 38561847f8eSopenharmony_ci * @StageModelOnly 38661847f8eSopenharmony_ci * @since 9 38761847f8eSopenharmony_ci */ 38861847f8eSopenharmony_ci function getEnterpriseInfo(admin: Want): Promise<EnterpriseInfo>; 38961847f8eSopenharmony_ci 39061847f8eSopenharmony_ci /** 39161847f8eSopenharmony_ci * Set the information of the administrator's enterprise. 39261847f8eSopenharmony_ci * Only the administrator app can call this method. 39361847f8eSopenharmony_ci * 39461847f8eSopenharmony_ci * @permission ohos.permission.SET_ENTERPRISE_INFO 39561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 39661847f8eSopenharmony_ci * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. 39761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setEnterpriseInfo. 39861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 39961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 40061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 40161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 40261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 40361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 40461847f8eSopenharmony_ci * @systemapi 40561847f8eSopenharmony_ci * @StageModelOnly 40661847f8eSopenharmony_ci * @since 9 40761847f8eSopenharmony_ci */ 40861847f8eSopenharmony_ci function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<void>): void; 40961847f8eSopenharmony_ci 41061847f8eSopenharmony_ci /** 41161847f8eSopenharmony_ci * Set the information of the administrator's enterprise. 41261847f8eSopenharmony_ci * Only the administrator app can call this method. 41361847f8eSopenharmony_ci * 41461847f8eSopenharmony_ci * @permission ohos.permission.SET_ENTERPRISE_INFO 41561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 41661847f8eSopenharmony_ci * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. 41761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the setEnterpriseInfo. 41861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 41961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 42061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 42161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 42261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 42361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 42461847f8eSopenharmony_ci * @systemapi 42561847f8eSopenharmony_ci * @StageModelOnly 42661847f8eSopenharmony_ci * @since 9 42761847f8eSopenharmony_ci */ 42861847f8eSopenharmony_ci function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<void>; 42961847f8eSopenharmony_ci 43061847f8eSopenharmony_ci /** 43161847f8eSopenharmony_ci * Get whether the ability is enabled as super device administrator. 43261847f8eSopenharmony_ci * 43361847f8eSopenharmony_ci * @param { String } bundleName - bundleName indicates the administrator bundle information. 43461847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - callback contained true if the administrator is super administrator. 43561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 43661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 43761847f8eSopenharmony_ci * 2. Incorrect parameter types. 43861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 43961847f8eSopenharmony_ci * @systemapi 44061847f8eSopenharmony_ci * @StageModelOnly 44161847f8eSopenharmony_ci * @since 9 44261847f8eSopenharmony_ci */ 44361847f8eSopenharmony_ci function isSuperAdmin(bundleName: String, callback: AsyncCallback<boolean>): void; 44461847f8eSopenharmony_ci 44561847f8eSopenharmony_ci /** 44661847f8eSopenharmony_ci * Get whether the ability is enabled as super device administrator. 44761847f8eSopenharmony_ci * 44861847f8eSopenharmony_ci * @param { String } bundleName - bundleName indicates the administrator bundle information. 44961847f8eSopenharmony_ci * @returns { Promise<boolean> } promise contained true if the administrator is super administrator. 45061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 45161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 45261847f8eSopenharmony_ci * 2. Incorrect parameter types. 45361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 45461847f8eSopenharmony_ci * @systemapi 45561847f8eSopenharmony_ci * @StageModelOnly 45661847f8eSopenharmony_ci * @since 9 45761847f8eSopenharmony_ci */ 45861847f8eSopenharmony_ci function isSuperAdmin(bundleName: String): Promise<boolean>; 45961847f8eSopenharmony_ci 46061847f8eSopenharmony_ci /** 46161847f8eSopenharmony_ci * Subscribes the managed event of admin. 46261847f8eSopenharmony_ci * 46361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 46461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 46561847f8eSopenharmony_ci * @param { Array<ManagedEvent> } managedEvents - managedEvents indicates the managed events to subscribe. 46661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of subscribeManagedEvent. 46761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 46861847f8eSopenharmony_ci * @throws { BusinessError } 9200008 - The specified system event is invalid. 46961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 47061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 47161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 47261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 47361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 47461847f8eSopenharmony_ci * @systemapi 47561847f8eSopenharmony_ci * @StageModelOnly 47661847f8eSopenharmony_ci * @since 9 47761847f8eSopenharmony_ci */ 47861847f8eSopenharmony_ci function subscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>, callback: AsyncCallback<void>): void; 47961847f8eSopenharmony_ci 48061847f8eSopenharmony_ci /** 48161847f8eSopenharmony_ci * Subscribes the managed event of admin. 48261847f8eSopenharmony_ci * 48361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 48461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 48561847f8eSopenharmony_ci * @param { Array<ManagedEvent> } managedEvents - managedEvents indicates the managed events to subscribe. 48661847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the subscribeManagedEvent. 48761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 48861847f8eSopenharmony_ci * @throws { BusinessError } 9200008 - The specified system event is invalid. 48961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 49061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 49161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 49261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 49361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 49461847f8eSopenharmony_ci * @systemapi 49561847f8eSopenharmony_ci * @StageModelOnly 49661847f8eSopenharmony_ci * @since 9 49761847f8eSopenharmony_ci */ 49861847f8eSopenharmony_ci function subscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>): Promise<void>; 49961847f8eSopenharmony_ci 50061847f8eSopenharmony_ci /** 50161847f8eSopenharmony_ci * Unsubscribes the managed event of admin. 50261847f8eSopenharmony_ci * 50361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 50461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 50561847f8eSopenharmony_ci * @param { Array<ManagedEvent> } managedEvents - managedEvents indicates the managed events to subscribe. 50661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of unsubscribeManagedEvent. 50761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 50861847f8eSopenharmony_ci * @throws { BusinessError } 9200008 - The specified system event is invalid. 50961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 51061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 51161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 51261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 51361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 51461847f8eSopenharmony_ci * @systemapi 51561847f8eSopenharmony_ci * @StageModelOnly 51661847f8eSopenharmony_ci * @since 9 51761847f8eSopenharmony_ci */ 51861847f8eSopenharmony_ci function unsubscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>, callback: AsyncCallback<void>): void; 51961847f8eSopenharmony_ci 52061847f8eSopenharmony_ci /** 52161847f8eSopenharmony_ci * Unsubscribes the managed event of admin. 52261847f8eSopenharmony_ci * 52361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 52461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 52561847f8eSopenharmony_ci * @param { Array<ManagedEvent> } managedEvents - managedEvents indicates the managed events to subscribe. 52661847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the unsubscribeManagedEvent. 52761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 52861847f8eSopenharmony_ci * @throws { BusinessError } 9200008 - The specified system event is invalid. 52961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 53061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 53161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 53261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 53361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 53461847f8eSopenharmony_ci * @systemapi 53561847f8eSopenharmony_ci * @StageModelOnly 53661847f8eSopenharmony_ci * @since 9 53761847f8eSopenharmony_ci */ 53861847f8eSopenharmony_ci function unsubscribeManagedEvent(admin: Want, managedEvents: Array<ManagedEvent>): Promise<void>; 53961847f8eSopenharmony_ci 54061847f8eSopenharmony_ci /** 54161847f8eSopenharmony_ci * Administrator authorize permissions to other applications. 54261847f8eSopenharmony_ci * 54361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 54461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 54561847f8eSopenharmony_ci * @param { string } bundleName - bundleName indicates the administrator bundle information. 54661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of authorizeAdmin. 54761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 54861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 54961847f8eSopenharmony_ci * @throws { BusinessError } 9200009 - Failed to grant the permission to the application. 55061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 55161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 55261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 55361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 55461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 55561847f8eSopenharmony_ci * @systemapi 55661847f8eSopenharmony_ci * @StageModelOnly 55761847f8eSopenharmony_ci * @since 10 55861847f8eSopenharmony_ci */ 55961847f8eSopenharmony_ci function authorizeAdmin(admin: Want, bundleName: string, callback: AsyncCallback<void>): void; 56061847f8eSopenharmony_ci 56161847f8eSopenharmony_ci /** 56261847f8eSopenharmony_ci * Administrator authorize permissions to other applications. 56361847f8eSopenharmony_ci * 56461847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 56561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 56661847f8eSopenharmony_ci * @param { string } bundleName - bundleName indicates the administrator bundle information. 56761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the authorizeAdmin. 56861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 56961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 57061847f8eSopenharmony_ci * @throws { BusinessError } 9200009 - Failed to grant the permission to the application. 57161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 57261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 57361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 57461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 57561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 57661847f8eSopenharmony_ci * @systemapi 57761847f8eSopenharmony_ci * @StageModelOnly 57861847f8eSopenharmony_ci * @since 10 57961847f8eSopenharmony_ci */ 58061847f8eSopenharmony_ci function authorizeAdmin(admin: Want, bundleName: string): Promise<void>; 58161847f8eSopenharmony_ci 58261847f8eSopenharmony_ci /** 58361847f8eSopenharmony_ci * Get the super administrator of device. 58461847f8eSopenharmony_ci * 58561847f8eSopenharmony_ci * @returns { Promise<Want> } promise contained the want indicates the super administrator of the device. 58661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 58761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 58861847f8eSopenharmony_ci * @systemapi 58961847f8eSopenharmony_ci * @StageModelOnly 59061847f8eSopenharmony_ci * @since 12 59161847f8eSopenharmony_ci */ 59261847f8eSopenharmony_ci function getSuperAdmin(): Promise<Want>; 59361847f8eSopenharmony_ci 59461847f8eSopenharmony_ci /** 59561847f8eSopenharmony_ci * Subscribes the managed event of admin. 59661847f8eSopenharmony_ci * 59761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 59861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 59961847f8eSopenharmony_ci * @param { Array<ManagedEvent> } managedEvents - managedEvents indicates the managed events to subscribe. 60061847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 60161847f8eSopenharmony_ci * @throws { BusinessError } 9200008 - The specified system event is invalid. 60261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 60361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 60461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 60561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 60661847f8eSopenharmony_ci * @StageModelOnly 60761847f8eSopenharmony_ci * @since 12 60861847f8eSopenharmony_ci */ 60961847f8eSopenharmony_ci function subscribeManagedEventSync(admin: Want, managedEvents: Array<ManagedEvent>): void; 61061847f8eSopenharmony_ci 61161847f8eSopenharmony_ci /** 61261847f8eSopenharmony_ci * Unsubscribes the managed event of admin. 61361847f8eSopenharmony_ci * 61461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 61561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 61661847f8eSopenharmony_ci * @param { Array<ManagedEvent> } managedEvents - managedEvents indicates the managed events to subscribe. 61761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 61861847f8eSopenharmony_ci * @throws { BusinessError } 9200008 - The specified system event is invalid. 61961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 62061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 62161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 62261847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 62361847f8eSopenharmony_ci * @StageModelOnly 62461847f8eSopenharmony_ci * @since 12 62561847f8eSopenharmony_ci */ 62661847f8eSopenharmony_ci function unsubscribeManagedEventSync(admin: Want, managedEvents: Array<ManagedEvent>): void; 62761847f8eSopenharmony_ci} 62861847f8eSopenharmony_ci 62961847f8eSopenharmony_ciexport default adminManager; 630