• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import type { AsyncCallback, Callback } from './@ohos.base';
17import type Want from './@ohos.app.ability.Want';
18
19/**
20 * This module provides the capability to control the enterprise devices.
21 *
22 * @namespace deviceControl
23 * @syscap SystemCapability.Customization.EnterpriseDeviceManager
24 * @systemapi
25 * @since 10
26 */
27declare namespace deviceControl {
28  /**
29   * Allow the administrator to reset the enterprise devices.
30   * This function can be called by a super administrator.
31   *
32   * @permission ohos.permission.ENTERPRISE_RESET_DEVICE
33   * @param { Want } admin - admin indicates the administrator ability information.
34   * @param { AsyncCallback<void> } callback - the callback of resetFactory.
35   * @throws { BusinessError } 9200001 - the application is not an administrator of the device.
36   * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
37   * @throws { BusinessError } 201 - the application does not have permission to call this function.
38   * @throws { BusinessError } 202 - not system application.
39   * @throws { BusinessError } 401 - invalid input parameter.
40   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
41   * @systemapi
42   * @StageModelOnly
43   * @since 10
44   */
45  function resetFactory(admin: Want, callback: AsyncCallback<void>): void;
46
47  /**
48   * Allow the administrator to reset the enterprise devices.
49   * This function can be called by a super administrator.
50   *
51   * @permission ohos.permission.ENTERPRISE_RESET_DEVICE
52   * @param { Want } admin - admin indicates the administrator ability information.
53   * @returns { Promise<void> } the promise returned by the resetFactory.
54   * @throws { BusinessError } 9200001 - the application is not an administrator of the device.
55   * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
56   * @throws { BusinessError } 201 - the application does not have permission to call this function.
57   * @throws { BusinessError } 202 - not system application.
58   * @throws { BusinessError } 401 - invalid input parameter.
59   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
60   * @systemapi
61   * @StageModelOnly
62   * @since 10
63   */
64  function resetFactory(admin: Want): Promise<void>;
65}
66
67export default deviceControl;
68