161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2023-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 restriction policy of the enterprise devices. 2661847f8eSopenharmony_ci * 2761847f8eSopenharmony_ci * @namespace restrictions 2861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 2961847f8eSopenharmony_ci * @since 10 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace restrictions { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Disable or enable the printing function of the device 3461847f8eSopenharmony_ci * This function can be called by a super administrator. 3561847f8eSopenharmony_ci * 3661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 3761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 3861847f8eSopenharmony_ci * The admin must have the corresponding permission. 3961847f8eSopenharmony_ci * @param { boolean } disabled - true if the user disables the printing function. 4061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setPrinterDisabled. 4161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 4261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 4361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 4461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 4561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 4661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 4761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 4861847f8eSopenharmony_ci * @systemapi 4961847f8eSopenharmony_ci * @StageModelOnly 5061847f8eSopenharmony_ci * @since 10 5161847f8eSopenharmony_ci */ 5261847f8eSopenharmony_ci function setPrinterDisabled(admin: Want, disabled: boolean, callback: AsyncCallback<void>): void; 5361847f8eSopenharmony_ci 5461847f8eSopenharmony_ci /** 5561847f8eSopenharmony_ci * Disable or enable the printing function of the device 5661847f8eSopenharmony_ci * This function can be called by a super administrator. 5761847f8eSopenharmony_ci * 5861847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 5961847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 6061847f8eSopenharmony_ci * The admin must have the corresponding permission. 6161847f8eSopenharmony_ci * @param { boolean } disabled - true if the user disables the printing function. 6261847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the setPrinterDisabled. 6361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 6461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 6561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 6661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 6761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 6861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 6961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 7061847f8eSopenharmony_ci * @systemapi 7161847f8eSopenharmony_ci * @StageModelOnly 7261847f8eSopenharmony_ci * @since 10 7361847f8eSopenharmony_ci */ 7461847f8eSopenharmony_ci function setPrinterDisabled(admin: Want, disabled: boolean): Promise<void>; 7561847f8eSopenharmony_ci 7661847f8eSopenharmony_ci /** 7761847f8eSopenharmony_ci * Is the printing function of the device disabled 7861847f8eSopenharmony_ci * This function can be called by a super administrator. 7961847f8eSopenharmony_ci * 8061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 8161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 8261847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 8361847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of isPrinterDisabled. 8461847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 8561847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 8661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 8761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 8861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 8961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 9061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 9161847f8eSopenharmony_ci * @systemapi 9261847f8eSopenharmony_ci * @stagemodelonly 9361847f8eSopenharmony_ci * @since 10 9461847f8eSopenharmony_ci */ 9561847f8eSopenharmony_ci function isPrinterDisabled(admin: Want, callback: AsyncCallback<boolean>): void; 9661847f8eSopenharmony_ci 9761847f8eSopenharmony_ci /** 9861847f8eSopenharmony_ci * Is the printing function of the device disabled 9961847f8eSopenharmony_ci * This function can be called by a super administrator. 10061847f8eSopenharmony_ci * 10161847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 10261847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 10361847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 10461847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the isPrinterDisabled. 10561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 10661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 10761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 10861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 10961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 11061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 11161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 11261847f8eSopenharmony_ci * @systemapi 11361847f8eSopenharmony_ci * @stagemodelonly 11461847f8eSopenharmony_ci * @since 10 11561847f8eSopenharmony_ci */ 11661847f8eSopenharmony_ci function isPrinterDisabled(admin: Want): Promise<boolean>; 11761847f8eSopenharmony_ci 11861847f8eSopenharmony_ci /** 11961847f8eSopenharmony_ci * Disable or enable the HDC function of the device 12061847f8eSopenharmony_ci * This function can be called by a super administrator. 12161847f8eSopenharmony_ci * 12261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 12361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 12461847f8eSopenharmony_ci * The admin must have the corresponding permission. 12561847f8eSopenharmony_ci * @param { boolean } disabled - true if the user disables the HDC function. 12661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of setHdcDisabled. 12761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 12861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 12961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 13061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 13161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 13261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 13361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 13461847f8eSopenharmony_ci * @systemapi 13561847f8eSopenharmony_ci * @StageModelOnly 13661847f8eSopenharmony_ci * @since 10 13761847f8eSopenharmony_ci */ 13861847f8eSopenharmony_ci function setHdcDisabled(admin: Want, disabled: boolean, callback: AsyncCallback<void>): void; 13961847f8eSopenharmony_ci 14061847f8eSopenharmony_ci /** 14161847f8eSopenharmony_ci * Disable or enable the HDC function of the device 14261847f8eSopenharmony_ci * This function can be called by a super administrator. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 14561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 14661847f8eSopenharmony_ci * The admin must have the corresponding permission. 14761847f8eSopenharmony_ci * @param { boolean } disabled - true if the user disables the HDC function. 14861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the setHdcDisabled. 14961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 15061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 15161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 15261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 15361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 15461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 15561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 15661847f8eSopenharmony_ci * @systemapi 15761847f8eSopenharmony_ci * @StageModelOnly 15861847f8eSopenharmony_ci * @since 10 15961847f8eSopenharmony_ci */ 16061847f8eSopenharmony_ci function setHdcDisabled(admin: Want, disabled: boolean): Promise<void>; 16161847f8eSopenharmony_ci 16261847f8eSopenharmony_ci /** 16361847f8eSopenharmony_ci * Is the HDC function of the device disabled 16461847f8eSopenharmony_ci * This function can be called by a super administrator. 16561847f8eSopenharmony_ci * 16661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 16761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 16861847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 16961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - the callback of isHdcDisabled. 17061847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 17161847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 17261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 17361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 17461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 17561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 17661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 17761847f8eSopenharmony_ci * @systemapi 17861847f8eSopenharmony_ci * @stagemodelonly 17961847f8eSopenharmony_ci * @since 10 18061847f8eSopenharmony_ci */ 18161847f8eSopenharmony_ci function isHdcDisabled(admin: Want, callback: AsyncCallback<boolean>): void; 18261847f8eSopenharmony_ci 18361847f8eSopenharmony_ci /** 18461847f8eSopenharmony_ci * Is the HDC function of the device disabled 18561847f8eSopenharmony_ci * This function can be called by a super administrator. 18661847f8eSopenharmony_ci * 18761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_RESTRICT_POLICY 18861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 18961847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 19061847f8eSopenharmony_ci * @returns { Promise<boolean> } the promise returned by the isHdcDisabled. 19161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 19261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 19361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 19461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 19561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 19661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 19761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 19861847f8eSopenharmony_ci * @systemapi 19961847f8eSopenharmony_ci * @stagemodelonly 20061847f8eSopenharmony_ci * @since 10 20161847f8eSopenharmony_ci */ 20261847f8eSopenharmony_ci function isHdcDisabled(admin: Want): Promise<boolean>; 20361847f8eSopenharmony_ci 20461847f8eSopenharmony_ci /** 20561847f8eSopenharmony_ci * Disables the microphone of device. 20661847f8eSopenharmony_ci * 20761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 20861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 20961847f8eSopenharmony_ci * The admin must have the corresponding permission. 21061847f8eSopenharmony_ci * @param { boolean } disable - true if disable the microphone of device, otherwise false. 21161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 21261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 21361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 21461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 21561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 21661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 21761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 21861847f8eSopenharmony_ci * @systemapi 21961847f8eSopenharmony_ci * @stagemodelonly 22061847f8eSopenharmony_ci * @since 11 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci function disableMicrophone(admin: Want, disable: boolean): void; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * Queries whether the microphone of device is disabled. 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 22861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 22961847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 23061847f8eSopenharmony_ci * @returns { boolean } true if the microphone of device is disabled, otherwise false. 23161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 23261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 23361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 23461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 23561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 23661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 23761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 23861847f8eSopenharmony_ci * @systemapi 23961847f8eSopenharmony_ci * @stagemodelonly 24061847f8eSopenharmony_ci * @since 11 24161847f8eSopenharmony_ci */ 24261847f8eSopenharmony_ci function isMicrophoneDisabled(admin: Want): boolean; 24361847f8eSopenharmony_ci 24461847f8eSopenharmony_ci /** 24561847f8eSopenharmony_ci * Sets the device fingerprint authorization capability disabled. 24661847f8eSopenharmony_ci * 24761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 24861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 24961847f8eSopenharmony_ci * The admin must have the corresponding permission. 25061847f8eSopenharmony_ci * @param { boolean } disabled - true if set the fingerprint authorization capability disabled. 25161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 25261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 25361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 25461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 25561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 25661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 25761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 25861847f8eSopenharmony_ci * @systemapi 25961847f8eSopenharmony_ci * @stagemodelonly 26061847f8eSopenharmony_ci * @since 11 26161847f8eSopenharmony_ci */ 26261847f8eSopenharmony_ci function setFingerprintAuthDisabled(admin: Want, disabled: boolean): void; 26361847f8eSopenharmony_ci 26461847f8eSopenharmony_ci /** 26561847f8eSopenharmony_ci * Queries device fingerprint authorization capability is disabled or enabled. 26661847f8eSopenharmony_ci * 26761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 26861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 26961847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 27061847f8eSopenharmony_ci * @returns { boolean } true if the fingerprint authorization capability is disabled. 27161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 27261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 27361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 27461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 27561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 27661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 27761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 27861847f8eSopenharmony_ci * @systemapi 27961847f8eSopenharmony_ci * @stagemodelonly 28061847f8eSopenharmony_ci * @since 11 28161847f8eSopenharmony_ci */ 28261847f8eSopenharmony_ci function isFingerprintAuthDisabled(admin: Want): boolean; 28361847f8eSopenharmony_ci 28461847f8eSopenharmony_ci /** 28561847f8eSopenharmony_ci * Disallows the specific feature of the device. 28661847f8eSopenharmony_ci * 28761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 28861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 28961847f8eSopenharmony_ci * The admin must have the corresponding permission. 29061847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be disallowed or allowed, 29161847f8eSopenharmony_ci * the supported device features include modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb and wifi. 29261847f8eSopenharmony_ci * @param { boolean } disallow - true if disallow the specific feature of device, otherwise false. 29361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 29461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 29561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 29661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 29761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 29861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 29961847f8eSopenharmony_ci * @stagemodelonly 30061847f8eSopenharmony_ci * @since 12 30161847f8eSopenharmony_ci */ 30261847f8eSopenharmony_ci function setDisallowedPolicy(admin: Want, feature: string, disallow: boolean): void; 30361847f8eSopenharmony_ci 30461847f8eSopenharmony_ci /** 30561847f8eSopenharmony_ci * Queries whether the specific feature of the device is disallowed. 30661847f8eSopenharmony_ci * 30761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 30861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 30961847f8eSopenharmony_ci * If the admin is not empty, it must have the corresponding permission. 31061847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be queried, 31161847f8eSopenharmony_ci * the supported device features include modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb and wifi. 31261847f8eSopenharmony_ci * @returns { boolean } true if the specific feature of device is disallowed, otherwise false. 31361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 31461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 31561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 31661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 31761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 31861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 31961847f8eSopenharmony_ci * @stagemodelonly 32061847f8eSopenharmony_ci * @since 12 32161847f8eSopenharmony_ci */ 32261847f8eSopenharmony_ci function getDisallowedPolicy(admin: Want, feature: string): boolean; 32361847f8eSopenharmony_ci 32461847f8eSopenharmony_ci /** 32561847f8eSopenharmony_ci * Disallows the specific feature of the device for the specified account. 32661847f8eSopenharmony_ci * 32761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 32861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 32961847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be disallowed or allowed. 33061847f8eSopenharmony_ci * @param { boolean } disallow - true if disallow the specific feature of device, otherwise false. 33161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 33261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. 33361847f8eSopenharmony_ci * @throws { BusinessError } 9200010 - A conflict policy has been configured. 33461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 33561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 33661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 33761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 33861847f8eSopenharmony_ci * @stagemodelonly 33961847f8eSopenharmony_ci * @since 14 34061847f8eSopenharmony_ci */ 34161847f8eSopenharmony_ci function setDisallowedPolicyForAccount(admin: Want, feature: string, disallow: boolean, accountId: number): void; 34261847f8eSopenharmony_ci 34361847f8eSopenharmony_ci /** 34461847f8eSopenharmony_ci * Queries whether the specific feature of the device is disallowed for the specified account. 34561847f8eSopenharmony_ci * 34661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 34761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 34861847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be queried. 34961847f8eSopenharmony_ci * @param { number } accountId - accountId indicates the account ID to be queried. 35061847f8eSopenharmony_ci * @returns { boolean } true if the specific feature of device is disallowed, otherwise false. 35161847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 35261847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. 35361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 35461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 35561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 35661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 35761847f8eSopenharmony_ci * @stagemodelonly 35861847f8eSopenharmony_ci * @since 14 35961847f8eSopenharmony_ci */ 36061847f8eSopenharmony_ci function getDisallowedPolicyForAccount(admin: Want, feature: string, accountId: number): boolean; 36161847f8eSopenharmony_ci 36261847f8eSopenharmony_ci /** 36361847f8eSopenharmony_ci * Adds applications or bundles or other contents to the list to restrict them from using a specific feature. 36461847f8eSopenharmony_ci * 36561847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 36661847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 36761847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be disallowed. 36861847f8eSopenharmony_ci * @param { Array<string> } list - list of restricted applications or bundles or other contents. 36961847f8eSopenharmony_ci * @param { number } accountId - indicates the account ID. 37061847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 37161847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 37261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 37361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 37461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 37561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 37661847f8eSopenharmony_ci * @stagemodelonly 37761847f8eSopenharmony_ci * @since 14 37861847f8eSopenharmony_ci */ 37961847f8eSopenharmony_ci function addDisallowedListForAccount(admin: Want, feature: string, list: Array<string>, accountId: number): void; 38061847f8eSopenharmony_ci 38161847f8eSopenharmony_ci /** 38261847f8eSopenharmony_ci * Removes applications or bundles or other contents from the list to unblock them from using a specific feature. 38361847f8eSopenharmony_ci * 38461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 38561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 38661847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be disallowed. 38761847f8eSopenharmony_ci * @param { Array<string> } list - list of unblock applications or bundles or other contents. 38861847f8eSopenharmony_ci * @param { number } accountId - indicates the account ID. 38961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 39061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 39161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 39261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 39361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 39461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 39561847f8eSopenharmony_ci * @stagemodelonly 39661847f8eSopenharmony_ci * @since 14 39761847f8eSopenharmony_ci */ 39861847f8eSopenharmony_ci function removeDisallowedListForAccount(admin: Want, feature: string, list: Array<string>, accountId: number): void; 39961847f8eSopenharmony_ci 40061847f8eSopenharmony_ci /** 40161847f8eSopenharmony_ci * Gets the list of applications or bundles or other contents that are restrict from using a specific feature. 40261847f8eSopenharmony_ci * 40361847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS 40461847f8eSopenharmony_ci * @param { Want } admin - admin indicates the administrator ability information. 40561847f8eSopenharmony_ci * @param { string } feature - feature indicates the specific feature to be disallowed. 40661847f8eSopenharmony_ci * @param { number } accountId - indicates the account ID. 40761847f8eSopenharmony_ci * @returns { Array<string> } list - list of applications or bundles or other contents. 40861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 40961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 41061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 41161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 41261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 41361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 41461847f8eSopenharmony_ci * @stagemodelonly 41561847f8eSopenharmony_ci * @since 14 41661847f8eSopenharmony_ci */ 41761847f8eSopenharmony_ci function getDisallowedListForAccount(admin: Want, feature: string, accountId: number): Array<string>; 41861847f8eSopenharmony_ci} 41961847f8eSopenharmony_ci 42061847f8eSopenharmony_ciexport default restrictions; 421