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 the device settings of the enterprise devices. 2661847f8eSopenharmony_ci * 2761847f8eSopenharmony_ci * @namespace deviceSettings 2861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 2961847f8eSopenharmony_ci * @since 10 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace deviceSettings { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Device power policy. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @typedef PowerPolicy 3661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 3761847f8eSopenharmony_ci * @systemapi 3861847f8eSopenharmony_ci * @stagemodelonly 3961847f8eSopenharmony_ci * @since 11 4061847f8eSopenharmony_ci */ 4161847f8eSopenharmony_ci export interface PowerPolicy { 4261847f8eSopenharmony_ci /** 4361847f8eSopenharmony_ci * An action that needs to be performed after a certain delay 4461847f8eSopenharmony_ci * 4561847f8eSopenharmony_ci * @type { PowerPolicyAction } 4661847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 4761847f8eSopenharmony_ci * @systemapi 4861847f8eSopenharmony_ci * @stagemodelonly 4961847f8eSopenharmony_ci * @since 11 5061847f8eSopenharmony_ci */ 5161847f8eSopenharmony_ci powerPolicyAction: PowerPolicyAction; 5261847f8eSopenharmony_ci 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * Delay time fo execute power policy action 5561847f8eSopenharmony_ci * 5661847f8eSopenharmony_ci * @type { number } 5761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 5861847f8eSopenharmony_ci * @systemapi 5961847f8eSopenharmony_ci * @stagemodelonly 6061847f8eSopenharmony_ci * @since 11 6161847f8eSopenharmony_ci */ 6261847f8eSopenharmony_ci delayTime: number; 6361847f8eSopenharmony_ci } 6461847f8eSopenharmony_ci 6561847f8eSopenharmony_ci /** 6661847f8eSopenharmony_ci * Actions of power policy. 6761847f8eSopenharmony_ci * 6861847f8eSopenharmony_ci * @enum { number } 6961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 7061847f8eSopenharmony_ci * @systemapi 7161847f8eSopenharmony_ci * @since 11 7261847f8eSopenharmony_ci */ 7361847f8eSopenharmony_ci enum PowerPolicyAction { 7461847f8eSopenharmony_ci /** 7561847f8eSopenharmony_ci * Performs no action after a certain delay 7661847f8eSopenharmony_ci * 7761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 7861847f8eSopenharmony_ci * @systemapi 7961847f8eSopenharmony_ci * @stagemodelonly 8061847f8eSopenharmony_ci * @since 11 8161847f8eSopenharmony_ci */ 8261847f8eSopenharmony_ci NONE = 0, 8361847f8eSopenharmony_ci 8461847f8eSopenharmony_ci /** 8561847f8eSopenharmony_ci * Performs auto suspend action after a certain delay 8661847f8eSopenharmony_ci * 8761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 8861847f8eSopenharmony_ci * @systemapi 8961847f8eSopenharmony_ci * @stagemodelonly 9061847f8eSopenharmony_ci * @since 11 9161847f8eSopenharmony_ci */ 9261847f8eSopenharmony_ci AUTO_SUSPEND, 9361847f8eSopenharmony_ci 9461847f8eSopenharmony_ci /** 9561847f8eSopenharmony_ci * Performs force suspend action after a certain delay 9661847f8eSopenharmony_ci * 9761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 9861847f8eSopenharmony_ci * @systemapi 9961847f8eSopenharmony_ci * @stagemodelonly 10061847f8eSopenharmony_ci * @since 11 10161847f8eSopenharmony_ci */ 10261847f8eSopenharmony_ci FORCE_SUSPEND, 10361847f8eSopenharmony_ci 10461847f8eSopenharmony_ci /** 10561847f8eSopenharmony_ci * Performs hibernate action after a certain delay 10661847f8eSopenharmony_ci * 10761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 10861847f8eSopenharmony_ci * @systemapi 10961847f8eSopenharmony_ci * @stagemodelonly 11061847f8eSopenharmony_ci * @since 11 11161847f8eSopenharmony_ci */ 11261847f8eSopenharmony_ci HIBERNATE, 11361847f8eSopenharmony_ci 11461847f8eSopenharmony_ci /** 11561847f8eSopenharmony_ci * Performs shutdown action after a certain delay 11661847f8eSopenharmony_ci * 11761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 11861847f8eSopenharmony_ci * @systemapi 11961847f8eSopenharmony_ci * @stagemodelonly 12061847f8eSopenharmony_ci * @since 11 12161847f8eSopenharmony_ci */ 12261847f8eSopenharmony_ci SHUTDOWN 12361847f8eSopenharmony_ci } 12461847f8eSopenharmony_ci 12561847f8eSopenharmony_ci /** 12661847f8eSopenharmony_ci * The scene to execute power policy. 12761847f8eSopenharmony_ci * 12861847f8eSopenharmony_ci * @enum { number } 12961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 13061847f8eSopenharmony_ci * @systemapi 13161847f8eSopenharmony_ci * @since 11 13261847f8eSopenharmony_ci */ 13361847f8eSopenharmony_ci enum PowerScene { 13461847f8eSopenharmony_ci /** 13561847f8eSopenharmony_ci * Time out scene 13661847f8eSopenharmony_ci * 13761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 13861847f8eSopenharmony_ci * @systemapi 13961847f8eSopenharmony_ci * @stagemodelonly 14061847f8eSopenharmony_ci * @since 11 14161847f8eSopenharmony_ci */ 14261847f8eSopenharmony_ci TIME_OUT = 0 14361847f8eSopenharmony_ci } 14461847f8eSopenharmony_ci 14561847f8eSopenharmony_ci /** 14661847f8eSopenharmony_ci * User certificate data. 14761847f8eSopenharmony_ci * 14861847f8eSopenharmony_ci * @typedef CertBlob 14961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 15061847f8eSopenharmony_ci * @systemapi 15161847f8eSopenharmony_ci * @stagemodelonly 15261847f8eSopenharmony_ci * @since 10 15361847f8eSopenharmony_ci */ 15461847f8eSopenharmony_ci export interface CertBlob { 15561847f8eSopenharmony_ci /** 15661847f8eSopenharmony_ci * The certificate content 15761847f8eSopenharmony_ci * 15861847f8eSopenharmony_ci * @type { Uint8Array } 15961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 16061847f8eSopenharmony_ci * @systemapi 16161847f8eSopenharmony_ci * @stagemodelonly 16261847f8eSopenharmony_ci * @since 10 16361847f8eSopenharmony_ci */ 16461847f8eSopenharmony_ci inData: Uint8Array; 16561847f8eSopenharmony_ci 16661847f8eSopenharmony_ci /** 16761847f8eSopenharmony_ci * The certificate alias 16861847f8eSopenharmony_ci * 16961847f8eSopenharmony_ci * @type { string } 17061847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 17161847f8eSopenharmony_ci * @systemapi 17261847f8eSopenharmony_ci * @stagemodelonly 17361847f8eSopenharmony_ci * @since 10 17461847f8eSopenharmony_ci */ 17561847f8eSopenharmony_ci alias: string; 17661847f8eSopenharmony_ci } 17761847f8eSopenharmony_ci 17861847f8eSopenharmony_ci /** 17961847f8eSopenharmony_ci * Sets the screen off time. 18061847f8eSopenharmony_ci * This function can be called by a super administrator. 18161847f8eSopenharmony_ci * 18261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME 18361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 18461847f8eSopenharmony_ci * The admin must have the corresponding permission. 18561847f8eSopenharmony_ci * @param { number } time - screen off time. The minimum value is 15000. It is recommended that the time 18661847f8eSopenharmony_ci * is consistent with the optional screen-off time of the device. 18761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 18861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 18961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 19061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 19161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 19261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 19361847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 19461847f8eSopenharmony_ci * @systemapi 19561847f8eSopenharmony_ci * @stagemodelonly 19661847f8eSopenharmony_ci * @since 11 19761847f8eSopenharmony_ci */ 19861847f8eSopenharmony_ci function setScreenOffTime(admin: Want, time: number): void; 19961847f8eSopenharmony_ci 20061847f8eSopenharmony_ci /** 20161847f8eSopenharmony_ci * Gets the device screen off time. 20261847f8eSopenharmony_ci * This function can be called by a super administrator. 20361847f8eSopenharmony_ci * 20461847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_SETTINGS 20561847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 20661847f8eSopenharmony_ci * The admin must have the corresponding permission. 20761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - the callback of getScreenOffTime. 20861847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 20961847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 21061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 21161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 21261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 21361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 21461847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 21561847f8eSopenharmony_ci * @systemapi 21661847f8eSopenharmony_ci * @StageModelOnly 21761847f8eSopenharmony_ci * @since 10 21861847f8eSopenharmony_ci */ 21961847f8eSopenharmony_ci function getScreenOffTime(admin: Want, callback: AsyncCallback<number>): void; 22061847f8eSopenharmony_ci 22161847f8eSopenharmony_ci /** 22261847f8eSopenharmony_ci * Gets the device screen off time. 22361847f8eSopenharmony_ci * This function can be called by a super administrator. 22461847f8eSopenharmony_ci * 22561847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_GET_SETTINGS 22661847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 22761847f8eSopenharmony_ci * The admin must have the corresponding permission. 22861847f8eSopenharmony_ci * @returns { Promise<number> } the promise returned by the getScreenOffTime. 22961847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 23061847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 23161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 23261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 23361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 23461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 23561847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 23661847f8eSopenharmony_ci * @systemapi 23761847f8eSopenharmony_ci * @StageModelOnly 23861847f8eSopenharmony_ci * @since 10 23961847f8eSopenharmony_ci */ 24061847f8eSopenharmony_ci function getScreenOffTime(admin: Want): Promise<number>; 24161847f8eSopenharmony_ci 24261847f8eSopenharmony_ci /** 24361847f8eSopenharmony_ci * Install user certificate. 24461847f8eSopenharmony_ci * This function can be called by a super administrator. 24561847f8eSopenharmony_ci * 24661847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_CERTIFICATE 24761847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 24861847f8eSopenharmony_ci * The admin must have the corresponding permission. 24961847f8eSopenharmony_ci * @param { CertBlob } certificate - certificate file content and alias. It cannot be empty or more than 40 characters. 25061847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - The callback carries the uri of the certificate used to uninstall 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 } 9201001 - Failed to manage the certificate. 25461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 25561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 25661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 25761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 25861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 25961847f8eSopenharmony_ci * @systemapi 26061847f8eSopenharmony_ci * @stagemodelonly 26161847f8eSopenharmony_ci * @since 10 26261847f8eSopenharmony_ci */ 26361847f8eSopenharmony_ci function installUserCertificate(admin: Want, certificate: CertBlob, callback: AsyncCallback<string>): void; 26461847f8eSopenharmony_ci 26561847f8eSopenharmony_ci /** 26661847f8eSopenharmony_ci * Install user certificate. 26761847f8eSopenharmony_ci * This function can be called by a super administrator. 26861847f8eSopenharmony_ci * 26961847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_CERTIFICATE 27061847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 27161847f8eSopenharmony_ci * The admin must have the corresponding permission. 27261847f8eSopenharmony_ci * @param { CertBlob } certificate - certificate file content and alias. It cannot be empty or more than 40 characters. 27361847f8eSopenharmony_ci * @returns { Promise<string> } the promise carries the uri of the certificate used to uninstall 27461847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 27561847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 27661847f8eSopenharmony_ci * @throws { BusinessError } 9201001 - Failed to manage the certificate. 27761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 27861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 27961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 28061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 28161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 28261847f8eSopenharmony_ci * @systemapi 28361847f8eSopenharmony_ci * @stagemodelonly 28461847f8eSopenharmony_ci * @since 10 28561847f8eSopenharmony_ci */ 28661847f8eSopenharmony_ci function installUserCertificate(admin: Want, certificate: CertBlob): Promise<string>; 28761847f8eSopenharmony_ci 28861847f8eSopenharmony_ci /** 28961847f8eSopenharmony_ci * Uninstall user certificate. 29061847f8eSopenharmony_ci * This function can be called by a super administrator. 29161847f8eSopenharmony_ci * 29261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_CERTIFICATE 29361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 29461847f8eSopenharmony_ci * The admin must have the corresponding permission. 29561847f8eSopenharmony_ci * @param { string } certUri - uri of the certificate. It cannot be empty or more than 64 characters. 29661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback of uninstallUserCertificate. 29761847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 29861847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 29961847f8eSopenharmony_ci * @throws { BusinessError } 9201001 - Failed to manage the certificate. 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 10 30861847f8eSopenharmony_ci */ 30961847f8eSopenharmony_ci function uninstallUserCertificate(admin: Want, certUri: string, callback: AsyncCallback<void>): void; 31061847f8eSopenharmony_ci 31161847f8eSopenharmony_ci /** 31261847f8eSopenharmony_ci * Uninstall user certificate. 31361847f8eSopenharmony_ci * This function can be called by a super administrator. 31461847f8eSopenharmony_ci * 31561847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_CERTIFICATE 31661847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 31761847f8eSopenharmony_ci * The admin must have the corresponding permission. 31861847f8eSopenharmony_ci * @param { string } certUri - uri of the certificate. It cannot be empty or more than 64 characters. 31961847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the uninstallUserCertificate. 32061847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 32161847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 32261847f8eSopenharmony_ci * @throws { BusinessError } 9201001 - Failed to manage the certificate. 32361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 32461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 32561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 32661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 32761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 32861847f8eSopenharmony_ci * @systemapi 32961847f8eSopenharmony_ci * @stagemodelonly 33061847f8eSopenharmony_ci * @since 10 33161847f8eSopenharmony_ci */ 33261847f8eSopenharmony_ci function uninstallUserCertificate(admin: Want, certUri: string): Promise<void>; 33361847f8eSopenharmony_ci 33461847f8eSopenharmony_ci /** 33561847f8eSopenharmony_ci * Sets the power policy. 33661847f8eSopenharmony_ci * This function can be called by a super administrator. 33761847f8eSopenharmony_ci * 33861847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_SETTINGS 33961847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 34061847f8eSopenharmony_ci * The admin must have the corresponding permission. 34161847f8eSopenharmony_ci * @param { PowerScene } powerScene - the scene to execute power policy. Only timeout scenario is supported now. 34261847f8eSopenharmony_ci * @param { PowerPolicy } powerPolicy - device power policy. 34361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 34461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 34561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 34661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 34761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 34861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 34961847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 35061847f8eSopenharmony_ci * @systemapi 35161847f8eSopenharmony_ci * @stagemodelonly 35261847f8eSopenharmony_ci * @since 11 35361847f8eSopenharmony_ci */ 35461847f8eSopenharmony_ci function setPowerPolicy(admin: Want, powerScene: PowerScene, powerPolicy: PowerPolicy): void; 35561847f8eSopenharmony_ci 35661847f8eSopenharmony_ci /** 35761847f8eSopenharmony_ci * Gets the power policy. 35861847f8eSopenharmony_ci * This function can be called by a super administrator. 35961847f8eSopenharmony_ci * 36061847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_SETTINGS 36161847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 36261847f8eSopenharmony_ci * The admin must have the corresponding permission. 36361847f8eSopenharmony_ci * @param { PowerScene } powerScene - the scene to execute power policy. Only timeout scenario is supported now. 36461847f8eSopenharmony_ci * @returns { PowerPolicy } device power policy. 36561847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 36661847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 36761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 36861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 36961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 37061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 37161847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 37261847f8eSopenharmony_ci * @systemapi 37361847f8eSopenharmony_ci * @stagemodelonly 37461847f8eSopenharmony_ci * @since 11 37561847f8eSopenharmony_ci */ 37661847f8eSopenharmony_ci function getPowerPolicy(admin: Want, powerScene: PowerScene): PowerPolicy; 37761847f8eSopenharmony_ci 37861847f8eSopenharmony_ci /** 37961847f8eSopenharmony_ci * Sets the device settings value. 38061847f8eSopenharmony_ci * This function can be called by a super administrator. 38161847f8eSopenharmony_ci * 38261847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_SETTINGS 38361847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 38461847f8eSopenharmony_ci * The admin must have the corresponding permission. 38561847f8eSopenharmony_ci * @param { string } item - item indicates the device properties that need to be set, including screenOff, powerPolicy and dateTime. 38661847f8eSopenharmony_ci * screenOff means the device screen off time, powerPolicy means the device power policy 38761847f8eSopenharmony_ci * and dataTime means the device system time. 38861847f8eSopenharmony_ci * @param { string } value - device settings policy. 38961847f8eSopenharmony_ci * When the power policy is set, only timeout scenario is available now. 39061847f8eSopenharmony_ci * When the screen off time is set, the minimum value is 15000. It is recommended that 39161847f8eSopenharmony_ci * the time is consistent with the optional screen-off time of the device. 39261847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 39361847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 39461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 39561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 39661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 39761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 39861847f8eSopenharmony_ci * @stagemodelonly 39961847f8eSopenharmony_ci * @since 12 40061847f8eSopenharmony_ci */ 40161847f8eSopenharmony_ci function setValue(admin: Want, item: string, value: string): void; 40261847f8eSopenharmony_ci 40361847f8eSopenharmony_ci /** 40461847f8eSopenharmony_ci * Gets the device settings value. 40561847f8eSopenharmony_ci * This function can be called by a super administrator. 40661847f8eSopenharmony_ci * 40761847f8eSopenharmony_ci * @permission ohos.permission.ENTERPRISE_MANAGE_SETTINGS 40861847f8eSopenharmony_ci * @param { Want } admin - admin indicates the enterprise admin extension ability information. 40961847f8eSopenharmony_ci * The admin must have the corresponding permission. 41061847f8eSopenharmony_ci * @param { string } item - item indicates the device properties that need to be get, including screenOff and powerPolicy. 41161847f8eSopenharmony_ci * screenOff means the device screen off time, powerPolicy means the device power policy. 41261847f8eSopenharmony_ci * @returns { string } device settings policy. 41361847f8eSopenharmony_ci * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 41461847f8eSopenharmony_ci * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 41561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 41661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 41761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 41861847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager 41961847f8eSopenharmony_ci * @stagemodelonly 42061847f8eSopenharmony_ci * @since 12 42161847f8eSopenharmony_ci */ 42261847f8eSopenharmony_ci function getValue(admin: Want, item: string): string; 42361847f8eSopenharmony_ci} 42461847f8eSopenharmony_ci 42561847f8eSopenharmony_ciexport default deviceSettings; 426