• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2024 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
16/**
17 * @file
18 * @kit MDMKit
19 */
20
21import type Want from './@ohos.app.ability.Want';
22
23/**
24 * This module provides the capability to manage the system of the enterprise devices.
25 *
26 * @namespace systemManager
27 * @syscap SystemCapability.Customization.EnterpriseDeviceManager
28 * @stagemodelonly
29 * @since 12
30 */
31declare namespace systemManager {
32  /**
33   * The device system update info.
34   *
35   * @typedef SystemUpdateInfo
36   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
37   * @stagemodelonly
38   * @since 12
39   */
40  export interface SystemUpdateInfo {
41    /**
42     * The name of version need to update.
43     *
44     * @type { string }
45     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
46     * @stagemodelonly
47     * @since 12
48     */
49    versionName: string;
50
51    /**
52     * The time when the version first received.
53     *
54     * @type { number }
55     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
56     * @stagemodelonly
57     * @since 12
58     */
59    firstReceivedTime: number;
60
61    /**
62     * The type of version package.
63     *
64     * @type { string }
65     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
66     * @stagemodelonly
67     * @since 12
68     */
69    packageType: string;
70  }
71
72  /**
73   * Sets NTP server.
74   * This function can be called by a super administrator.
75   *
76   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
77   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
78   *                         The admin must have the corresponding permission.
79   * @param { string } server - the address of NTP server.
80   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
81   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
82   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
83   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
84   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
85   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
86   * @stagemodelonly
87   * @since 12
88   */
89  function setNTPServer(admin: Want, server: string): void;
90
91  /**
92   * Gets NTP server.
93   * This function can be called by a super administrator.
94   *
95   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
96   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
97   *                         The admin must have the corresponding permission.
98   * @returns { string } the address of NTP server.
99   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
100   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
101   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
102   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
103   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
104   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
105   * @stagemodelonly
106   * @since 12
107   */
108  function getNTPServer(admin: Want): string;
109}
110
111export default systemManager;