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 Want from './@ohos.app.ability.Want';
2261847f8eSopenharmony_ci
2361847f8eSopenharmony_ci/**
2461847f8eSopenharmony_ci * This module provides the capability to manage the system of the enterprise devices.
2561847f8eSopenharmony_ci *
2661847f8eSopenharmony_ci * @namespace systemManager
2761847f8eSopenharmony_ci * @syscap SystemCapability.Customization.EnterpriseDeviceManager
2861847f8eSopenharmony_ci * @stagemodelonly
2961847f8eSopenharmony_ci * @since 12
3061847f8eSopenharmony_ci */
3161847f8eSopenharmony_cideclare namespace systemManager {
3261847f8eSopenharmony_ci  /**
3361847f8eSopenharmony_ci   * The device system update info.
3461847f8eSopenharmony_ci   *
3561847f8eSopenharmony_ci   * @typedef SystemUpdateInfo
3661847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
3761847f8eSopenharmony_ci   * @stagemodelonly
3861847f8eSopenharmony_ci   * @since 12
3961847f8eSopenharmony_ci   */
4061847f8eSopenharmony_ci  export interface SystemUpdateInfo {
4161847f8eSopenharmony_ci    /**
4261847f8eSopenharmony_ci     * The name of version need to update.
4361847f8eSopenharmony_ci     *
4461847f8eSopenharmony_ci     * @type { string }
4561847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
4661847f8eSopenharmony_ci     * @stagemodelonly
4761847f8eSopenharmony_ci     * @since 12
4861847f8eSopenharmony_ci     */
4961847f8eSopenharmony_ci    versionName: string;
5061847f8eSopenharmony_ci
5161847f8eSopenharmony_ci    /**
5261847f8eSopenharmony_ci     * The time when the version first received.
5361847f8eSopenharmony_ci     *
5461847f8eSopenharmony_ci     * @type { number }
5561847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
5661847f8eSopenharmony_ci     * @stagemodelonly
5761847f8eSopenharmony_ci     * @since 12
5861847f8eSopenharmony_ci     */
5961847f8eSopenharmony_ci    firstReceivedTime: number;
6061847f8eSopenharmony_ci
6161847f8eSopenharmony_ci    /**
6261847f8eSopenharmony_ci     * The type of version package.
6361847f8eSopenharmony_ci     *
6461847f8eSopenharmony_ci     * @type { string }
6561847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
6661847f8eSopenharmony_ci     * @stagemodelonly
6761847f8eSopenharmony_ci     * @since 12
6861847f8eSopenharmony_ci     */
6961847f8eSopenharmony_ci    packageType: string;
7061847f8eSopenharmony_ci  }
7161847f8eSopenharmony_ci
7261847f8eSopenharmony_ci  /**
7361847f8eSopenharmony_ci   * System update policy type.
7461847f8eSopenharmony_ci   *
7561847f8eSopenharmony_ci   * @enum { number }
7661847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
7761847f8eSopenharmony_ci   * @stagemodelonly
7861847f8eSopenharmony_ci   * @since 12
7961847f8eSopenharmony_ci   */
8061847f8eSopenharmony_ci  enum PolicyType {
8161847f8eSopenharmony_ci    /**
8261847f8eSopenharmony_ci     * Default update policy
8361847f8eSopenharmony_ci     *
8461847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
8561847f8eSopenharmony_ci     * @stagemodelonly
8661847f8eSopenharmony_ci     * @since 12
8761847f8eSopenharmony_ci     */
8861847f8eSopenharmony_ci    DEFAULT = 0,
8961847f8eSopenharmony_ci
9061847f8eSopenharmony_ci    /**
9161847f8eSopenharmony_ci     * Prohibit update policy
9261847f8eSopenharmony_ci     *
9361847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
9461847f8eSopenharmony_ci     * @stagemodelonly
9561847f8eSopenharmony_ci     * @since 12
9661847f8eSopenharmony_ci     */
9761847f8eSopenharmony_ci    PROHIBIT = 1,
9861847f8eSopenharmony_ci
9961847f8eSopenharmony_ci    /**
10061847f8eSopenharmony_ci     * Update to specific software version policy
10161847f8eSopenharmony_ci     *
10261847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
10361847f8eSopenharmony_ci     * @stagemodelonly
10461847f8eSopenharmony_ci     * @since 12
10561847f8eSopenharmony_ci     */
10661847f8eSopenharmony_ci    UPDATE_TO_SPECIFIC_VERSION = 2,
10761847f8eSopenharmony_ci
10861847f8eSopenharmony_ci    /**
10961847f8eSopenharmony_ci     * Update within a specified time window
11061847f8eSopenharmony_ci     *
11161847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
11261847f8eSopenharmony_ci     * @stagemodelonly
11361847f8eSopenharmony_ci     * @since 12
11461847f8eSopenharmony_ci     */
11561847f8eSopenharmony_ci    WINDOWS = 3,
11661847f8eSopenharmony_ci
11761847f8eSopenharmony_ci    /**
11861847f8eSopenharmony_ci     * Delay the update for a period of time
11961847f8eSopenharmony_ci     *
12061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
12161847f8eSopenharmony_ci     * @stagemodelonly
12261847f8eSopenharmony_ci     * @since 12
12361847f8eSopenharmony_ci     */
12461847f8eSopenharmony_ci    POSTPONE = 4
12561847f8eSopenharmony_ci  }
12661847f8eSopenharmony_ci
12761847f8eSopenharmony_ci  /**
12861847f8eSopenharmony_ci   * OTA update policy.
12961847f8eSopenharmony_ci   *
13061847f8eSopenharmony_ci   * @typedef OtaUpdatePolicy
13161847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
13261847f8eSopenharmony_ci   * @stagemodelonly
13361847f8eSopenharmony_ci   * @since 12
13461847f8eSopenharmony_ci   */
13561847f8eSopenharmony_ci  export interface OtaUpdatePolicy {
13661847f8eSopenharmony_ci    /**
13761847f8eSopenharmony_ci     * Software update type.
13861847f8eSopenharmony_ci     *
13961847f8eSopenharmony_ci     * @type { PolicyType }
14061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
14161847f8eSopenharmony_ci     * @stagemodelonly
14261847f8eSopenharmony_ci     * @since 12
14361847f8eSopenharmony_ci     */
14461847f8eSopenharmony_ci    policyType: PolicyType;
14561847f8eSopenharmony_ci
14661847f8eSopenharmony_ci    /**
14761847f8eSopenharmony_ci     * Software version.
14861847f8eSopenharmony_ci     *
14961847f8eSopenharmony_ci     * @type { string }
15061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
15161847f8eSopenharmony_ci     * @stagemodelonly
15261847f8eSopenharmony_ci     * @since 12
15361847f8eSopenharmony_ci     */
15461847f8eSopenharmony_ci    version: string;
15561847f8eSopenharmony_ci
15661847f8eSopenharmony_ci    /**
15761847f8eSopenharmony_ci     * The latest time of update.
15861847f8eSopenharmony_ci     *
15961847f8eSopenharmony_ci     * @type { ?number }
16061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
16161847f8eSopenharmony_ci     * @stagemodelonly
16261847f8eSopenharmony_ci     * @since 12
16361847f8eSopenharmony_ci     */
16461847f8eSopenharmony_ci    latestUpdateTime?: number;
16561847f8eSopenharmony_ci
16661847f8eSopenharmony_ci    /**
16761847f8eSopenharmony_ci     * The time of delay update.
16861847f8eSopenharmony_ci     *
16961847f8eSopenharmony_ci     * @type { ?number }
17061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
17161847f8eSopenharmony_ci     * @stagemodelonly
17261847f8eSopenharmony_ci     * @since 12
17361847f8eSopenharmony_ci     */
17461847f8eSopenharmony_ci    delayUpdateTime?: number;
17561847f8eSopenharmony_ci
17661847f8eSopenharmony_ci    /**
17761847f8eSopenharmony_ci     * The start time of installation window.
17861847f8eSopenharmony_ci     *
17961847f8eSopenharmony_ci     * @type { ?number }
18061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
18161847f8eSopenharmony_ci     * @stagemodelonly
18261847f8eSopenharmony_ci     * @since 12
18361847f8eSopenharmony_ci     */
18461847f8eSopenharmony_ci    installStartTime?: number;
18561847f8eSopenharmony_ci
18661847f8eSopenharmony_ci    /**
18761847f8eSopenharmony_ci     * The end time of installation window.
18861847f8eSopenharmony_ci     *
18961847f8eSopenharmony_ci     * @type { ?number }
19061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
19161847f8eSopenharmony_ci     * @stagemodelonly
19261847f8eSopenharmony_ci     * @since 12
19361847f8eSopenharmony_ci     */
19461847f8eSopenharmony_ci    installEndTime?: number;
19561847f8eSopenharmony_ci  }
19661847f8eSopenharmony_ci
19761847f8eSopenharmony_ci  /**
19861847f8eSopenharmony_ci   * The device system update package info.
19961847f8eSopenharmony_ci   *
20061847f8eSopenharmony_ci   * @typedef UpdatePackageInfo
20161847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
20261847f8eSopenharmony_ci   * @stagemodelonly
20361847f8eSopenharmony_ci   * @since 12
20461847f8eSopenharmony_ci   */
20561847f8eSopenharmony_ci  export interface UpdatePackageInfo {
20661847f8eSopenharmony_ci    /**
20761847f8eSopenharmony_ci     * The version of system update package.
20861847f8eSopenharmony_ci     *
20961847f8eSopenharmony_ci     * @type { string }
21061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
21161847f8eSopenharmony_ci     * @stagemodelonly
21261847f8eSopenharmony_ci     * @since 12
21361847f8eSopenharmony_ci     */
21461847f8eSopenharmony_ci    version: string;
21561847f8eSopenharmony_ci
21661847f8eSopenharmony_ci    /**
21761847f8eSopenharmony_ci     * The detail of system update packages.
21861847f8eSopenharmony_ci     *
21961847f8eSopenharmony_ci     * @type { Array<Package> }
22061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
22161847f8eSopenharmony_ci     * @stagemodelonly
22261847f8eSopenharmony_ci     * @since 12
22361847f8eSopenharmony_ci     */
22461847f8eSopenharmony_ci    packages: Array<Package>;
22561847f8eSopenharmony_ci
22661847f8eSopenharmony_ci    /**
22761847f8eSopenharmony_ci     * The description of system update package.
22861847f8eSopenharmony_ci     *
22961847f8eSopenharmony_ci     * @type { ?PackageDescription }
23061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
23161847f8eSopenharmony_ci     * @stagemodelonly
23261847f8eSopenharmony_ci     * @since 12
23361847f8eSopenharmony_ci     */
23461847f8eSopenharmony_ci    description?: PackageDescription;
23561847f8eSopenharmony_ci  }
23661847f8eSopenharmony_ci
23761847f8eSopenharmony_ci  /**
23861847f8eSopenharmony_ci   * The detail of system update package.
23961847f8eSopenharmony_ci   *
24061847f8eSopenharmony_ci   * @typedef Package
24161847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
24261847f8eSopenharmony_ci   * @stagemodelonly
24361847f8eSopenharmony_ci   * @since 12
24461847f8eSopenharmony_ci   */
24561847f8eSopenharmony_ci  interface Package {
24661847f8eSopenharmony_ci    /**
24761847f8eSopenharmony_ci     * The type of system update package.
24861847f8eSopenharmony_ci     *
24961847f8eSopenharmony_ci     * @type { PackageType }
25061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
25161847f8eSopenharmony_ci     * @stagemodelonly
25261847f8eSopenharmony_ci     * @since 12
25361847f8eSopenharmony_ci     */
25461847f8eSopenharmony_ci    type: PackageType;
25561847f8eSopenharmony_ci
25661847f8eSopenharmony_ci    /**
25761847f8eSopenharmony_ci     * The path of system update package.
25861847f8eSopenharmony_ci     *
25961847f8eSopenharmony_ci     * @type { string }
26061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
26161847f8eSopenharmony_ci     * @stagemodelonly
26261847f8eSopenharmony_ci     * @since 12
26361847f8eSopenharmony_ci     */
26461847f8eSopenharmony_ci    path: string;
26561847f8eSopenharmony_ci
26661847f8eSopenharmony_ci    /**
26761847f8eSopenharmony_ci     * The file descriptor of system update package.
26861847f8eSopenharmony_ci     *
26961847f8eSopenharmony_ci     * @type { ?number }
27061847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
27161847f8eSopenharmony_ci     * @stagemodelonly
27261847f8eSopenharmony_ci     * @since 12
27361847f8eSopenharmony_ci     */
27461847f8eSopenharmony_ci    fd?: number;
27561847f8eSopenharmony_ci  }
27661847f8eSopenharmony_ci
27761847f8eSopenharmony_ci  /**
27861847f8eSopenharmony_ci   * Enum for system update package.
27961847f8eSopenharmony_ci   *
28061847f8eSopenharmony_ci   * @enum { number }
28161847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
28261847f8eSopenharmony_ci   * @stagemodelonly
28361847f8eSopenharmony_ci   * @since 12
28461847f8eSopenharmony_ci   */
28561847f8eSopenharmony_ci  enum PackageType {
28661847f8eSopenharmony_ci    /**
28761847f8eSopenharmony_ci     * FIRMWARE
28861847f8eSopenharmony_ci     *
28961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
29061847f8eSopenharmony_ci     * @stagemodelonly
29161847f8eSopenharmony_ci     * @since 12
29261847f8eSopenharmony_ci     */
29361847f8eSopenharmony_ci    FIRMWARE = 1
29461847f8eSopenharmony_ci  }
29561847f8eSopenharmony_ci
29661847f8eSopenharmony_ci  /**
29761847f8eSopenharmony_ci   * The description of system update package.
29861847f8eSopenharmony_ci   *
29961847f8eSopenharmony_ci   * @typedef PackageDescription
30061847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
30161847f8eSopenharmony_ci   * @stagemodelonly
30261847f8eSopenharmony_ci   * @since 12
30361847f8eSopenharmony_ci   */
30461847f8eSopenharmony_ci  interface PackageDescription {
30561847f8eSopenharmony_ci    /**
30661847f8eSopenharmony_ci     * The custom notification of system update package.
30761847f8eSopenharmony_ci     *
30861847f8eSopenharmony_ci     * @type { ?NotifyDescription }
30961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
31061847f8eSopenharmony_ci     * @stagemodelonly
31161847f8eSopenharmony_ci     * @since 12
31261847f8eSopenharmony_ci     */
31361847f8eSopenharmony_ci    notify?: NotifyDescription;
31461847f8eSopenharmony_ci  }
31561847f8eSopenharmony_ci
31661847f8eSopenharmony_ci  /**
31761847f8eSopenharmony_ci   * The custom notification of system update package.
31861847f8eSopenharmony_ci   *
31961847f8eSopenharmony_ci   * @typedef NotifyDescription
32061847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
32161847f8eSopenharmony_ci   * @stagemodelonly
32261847f8eSopenharmony_ci   * @since 12
32361847f8eSopenharmony_ci   */
32461847f8eSopenharmony_ci  interface NotifyDescription {
32561847f8eSopenharmony_ci    /**
32661847f8eSopenharmony_ci     * The custom notification tips of system update package.
32761847f8eSopenharmony_ci     *
32861847f8eSopenharmony_ci     * @type { ?string }
32961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
33061847f8eSopenharmony_ci     * @stagemodelonly
33161847f8eSopenharmony_ci     * @since 12
33261847f8eSopenharmony_ci     */
33361847f8eSopenharmony_ci    installTips?: string;
33461847f8eSopenharmony_ci
33561847f8eSopenharmony_ci    /**
33661847f8eSopenharmony_ci     * The custom notification tips detail of system update package.
33761847f8eSopenharmony_ci     *
33861847f8eSopenharmony_ci     * @type { ?string }
33961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
34061847f8eSopenharmony_ci     * @stagemodelonly
34161847f8eSopenharmony_ci     * @since 12
34261847f8eSopenharmony_ci     */
34361847f8eSopenharmony_ci    installTipsDetail?: string;
34461847f8eSopenharmony_ci  }
34561847f8eSopenharmony_ci
34661847f8eSopenharmony_ci  /**
34761847f8eSopenharmony_ci   * The result of system update.
34861847f8eSopenharmony_ci   *
34961847f8eSopenharmony_ci   * @typedef UpdateResult
35061847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
35161847f8eSopenharmony_ci   * @stagemodelonly
35261847f8eSopenharmony_ci   * @since 12
35361847f8eSopenharmony_ci   */
35461847f8eSopenharmony_ci  interface UpdateResult {
35561847f8eSopenharmony_ci    /**
35661847f8eSopenharmony_ci     * The current version of the system.
35761847f8eSopenharmony_ci     *
35861847f8eSopenharmony_ci     * @type { string }
35961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
36061847f8eSopenharmony_ci     * @stagemodelonly
36161847f8eSopenharmony_ci     * @since 12
36261847f8eSopenharmony_ci     */
36361847f8eSopenharmony_ci    version: string;
36461847f8eSopenharmony_ci
36561847f8eSopenharmony_ci    /**
36661847f8eSopenharmony_ci     * The update status of the system.
36761847f8eSopenharmony_ci     *
36861847f8eSopenharmony_ci     * @type { UpdateStatus }
36961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
37061847f8eSopenharmony_ci     * @stagemodelonly
37161847f8eSopenharmony_ci     * @since 12
37261847f8eSopenharmony_ci     */
37361847f8eSopenharmony_ci    status: UpdateStatus;
37461847f8eSopenharmony_ci
37561847f8eSopenharmony_ci    /**
37661847f8eSopenharmony_ci     * The update error message of the system.
37761847f8eSopenharmony_ci     *
37861847f8eSopenharmony_ci     * @type { ErrorInfo }
37961847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
38061847f8eSopenharmony_ci     * @stagemodelonly
38161847f8eSopenharmony_ci     * @since 12
38261847f8eSopenharmony_ci     */
38361847f8eSopenharmony_ci    errorInfo: ErrorInfo;
38461847f8eSopenharmony_ci  }
38561847f8eSopenharmony_ci
38661847f8eSopenharmony_ci  /**
38761847f8eSopenharmony_ci   * Enum for system update status.
38861847f8eSopenharmony_ci   *
38961847f8eSopenharmony_ci   * @enum { number }
39061847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
39161847f8eSopenharmony_ci   * @stagemodelonly
39261847f8eSopenharmony_ci   * @since 12
39361847f8eSopenharmony_ci   */
39461847f8eSopenharmony_ci  enum UpdateStatus {
39561847f8eSopenharmony_ci    /**
39661847f8eSopenharmony_ci     * The specified version system update package does not exist.
39761847f8eSopenharmony_ci     *
39861847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
39961847f8eSopenharmony_ci     * @stagemodelonly
40061847f8eSopenharmony_ci     * @since 12
40161847f8eSopenharmony_ci     */
40261847f8eSopenharmony_ci    NO_UPDATE_PACKAGE = -4,
40361847f8eSopenharmony_ci
40461847f8eSopenharmony_ci    /**
40561847f8eSopenharmony_ci     * The system update package waiting for installation.
40661847f8eSopenharmony_ci     *
40761847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
40861847f8eSopenharmony_ci     * @stagemodelonly
40961847f8eSopenharmony_ci     * @since 12
41061847f8eSopenharmony_ci     */
41161847f8eSopenharmony_ci    UPDATE_WAITING = -3,
41261847f8eSopenharmony_ci
41361847f8eSopenharmony_ci    /**
41461847f8eSopenharmony_ci     * The system is updating.
41561847f8eSopenharmony_ci     *
41661847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
41761847f8eSopenharmony_ci     * @stagemodelonly
41861847f8eSopenharmony_ci     * @since 12
41961847f8eSopenharmony_ci     */
42061847f8eSopenharmony_ci    UPDATING = -2,
42161847f8eSopenharmony_ci
42261847f8eSopenharmony_ci    /**
42361847f8eSopenharmony_ci     * The system update failed.
42461847f8eSopenharmony_ci     *
42561847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
42661847f8eSopenharmony_ci     * @stagemodelonly
42761847f8eSopenharmony_ci     * @since 12
42861847f8eSopenharmony_ci     */
42961847f8eSopenharmony_ci    UPDATE_FAILURE = -1,
43061847f8eSopenharmony_ci
43161847f8eSopenharmony_ci    /**
43261847f8eSopenharmony_ci     * The system update successful.
43361847f8eSopenharmony_ci     *
43461847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
43561847f8eSopenharmony_ci     * @stagemodelonly
43661847f8eSopenharmony_ci     * @since 12
43761847f8eSopenharmony_ci     */
43861847f8eSopenharmony_ci    UPDATE_SUCCESS = 0
43961847f8eSopenharmony_ci  }
44061847f8eSopenharmony_ci
44161847f8eSopenharmony_ci  /**
44261847f8eSopenharmony_ci   * The update error information of the system.
44361847f8eSopenharmony_ci   *
44461847f8eSopenharmony_ci   * @typedef ErrorInfo
44561847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
44661847f8eSopenharmony_ci   * @stagemodelonly
44761847f8eSopenharmony_ci   * @since 12
44861847f8eSopenharmony_ci   */
44961847f8eSopenharmony_ci  interface ErrorInfo {
45061847f8eSopenharmony_ci    /**
45161847f8eSopenharmony_ci     * The update error code of the system.
45261847f8eSopenharmony_ci     *
45361847f8eSopenharmony_ci     * @type { number }
45461847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
45561847f8eSopenharmony_ci     * @stagemodelonly
45661847f8eSopenharmony_ci     * @since 12
45761847f8eSopenharmony_ci     */
45861847f8eSopenharmony_ci    code: number;
45961847f8eSopenharmony_ci
46061847f8eSopenharmony_ci    /**
46161847f8eSopenharmony_ci     * The update error message of the system.
46261847f8eSopenharmony_ci     *
46361847f8eSopenharmony_ci     * @type { string }
46461847f8eSopenharmony_ci     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
46561847f8eSopenharmony_ci     * @stagemodelonly
46661847f8eSopenharmony_ci     * @since 12
46761847f8eSopenharmony_ci     */
46861847f8eSopenharmony_ci    message: string;
46961847f8eSopenharmony_ci  }
47061847f8eSopenharmony_ci
47161847f8eSopenharmony_ci  /**
47261847f8eSopenharmony_ci   * Sets NTP server.
47361847f8eSopenharmony_ci   * This function can be called by a super administrator.
47461847f8eSopenharmony_ci   *
47561847f8eSopenharmony_ci   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
47661847f8eSopenharmony_ci   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
47761847f8eSopenharmony_ci   *                         The admin must have the corresponding permission.
47861847f8eSopenharmony_ci   * @param { string } server - the address of NTP server.
47961847f8eSopenharmony_ci   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
48061847f8eSopenharmony_ci   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
48161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
48261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
48361847f8eSopenharmony_ci   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
48461847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
48561847f8eSopenharmony_ci   * @stagemodelonly
48661847f8eSopenharmony_ci   * @since 12
48761847f8eSopenharmony_ci   */
48861847f8eSopenharmony_ci  function setNTPServer(admin: Want, server: string): void;
48961847f8eSopenharmony_ci
49061847f8eSopenharmony_ci  /**
49161847f8eSopenharmony_ci   * Gets NTP server.
49261847f8eSopenharmony_ci   * This function can be called by a super administrator.
49361847f8eSopenharmony_ci   *
49461847f8eSopenharmony_ci   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
49561847f8eSopenharmony_ci   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
49661847f8eSopenharmony_ci   *                         The admin must have the corresponding permission.
49761847f8eSopenharmony_ci   * @returns { string } the address of NTP server.
49861847f8eSopenharmony_ci   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
49961847f8eSopenharmony_ci   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
50061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
50161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
50261847f8eSopenharmony_ci   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
50361847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
50461847f8eSopenharmony_ci   * @stagemodelonly
50561847f8eSopenharmony_ci   * @since 12
50661847f8eSopenharmony_ci   */
50761847f8eSopenharmony_ci  function getNTPServer(admin: Want): string;
50861847f8eSopenharmony_ci
50961847f8eSopenharmony_ci  /**
51061847f8eSopenharmony_ci   * Sets device OTA update policy.
51161847f8eSopenharmony_ci   * This function can be called by a super administrator.
51261847f8eSopenharmony_ci   *
51361847f8eSopenharmony_ci   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
51461847f8eSopenharmony_ci   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
51561847f8eSopenharmony_ci   *                         The admin must have the corresponding permission.
51661847f8eSopenharmony_ci   * @param { OtaUpdatePolicy } policy - OTA update policy.
51761847f8eSopenharmony_ci   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
51861847f8eSopenharmony_ci   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
51961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
52061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
52161847f8eSopenharmony_ci   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
52261847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
52361847f8eSopenharmony_ci   * @stagemodelonly
52461847f8eSopenharmony_ci   * @since 12
52561847f8eSopenharmony_ci   */
52661847f8eSopenharmony_ci  function setOtaUpdatePolicy(admin: Want, policy: OtaUpdatePolicy): void;
52761847f8eSopenharmony_ci
52861847f8eSopenharmony_ci  /**
52961847f8eSopenharmony_ci   * Gets device OTA update policy.
53061847f8eSopenharmony_ci   * This function can be called by a super administrator.
53161847f8eSopenharmony_ci   *
53261847f8eSopenharmony_ci   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
53361847f8eSopenharmony_ci   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
53461847f8eSopenharmony_ci   *                         The admin must have the corresponding permission.
53561847f8eSopenharmony_ci   * @returns { OtaUpdatePolicy } OTA update policy.
53661847f8eSopenharmony_ci   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
53761847f8eSopenharmony_ci   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
53861847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
53961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
54061847f8eSopenharmony_ci   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
54161847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
54261847f8eSopenharmony_ci   * @stagemodelonly
54361847f8eSopenharmony_ci   * @since 12
54461847f8eSopenharmony_ci   */
54561847f8eSopenharmony_ci  function getOtaUpdatePolicy(admin: Want): OtaUpdatePolicy;
54661847f8eSopenharmony_ci
54761847f8eSopenharmony_ci  /**
54861847f8eSopenharmony_ci   * Notifies the system of update packages information.
54961847f8eSopenharmony_ci   * This function can be called by a super administrator.
55061847f8eSopenharmony_ci   *
55161847f8eSopenharmony_ci   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
55261847f8eSopenharmony_ci   * @param { Want } admin - admin indicates the administrator ability information.
55361847f8eSopenharmony_ci   * @param { UpdatePackageInfo } packageInfo - packageInfo indicates the information of system update package.
55461847f8eSopenharmony_ci   * @returns { Promise<void> } the promise returned by the notifyUpdatePackages.
55561847f8eSopenharmony_ci   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
55661847f8eSopenharmony_ci   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
55761847f8eSopenharmony_ci   * @throws { BusinessError } 9201004 - The update packages do not exist or analyzing failed.
55861847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
55961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
56061847f8eSopenharmony_ci   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
56161847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
56261847f8eSopenharmony_ci   * @stagemodelonly
56361847f8eSopenharmony_ci   * @since 12
56461847f8eSopenharmony_ci   */
56561847f8eSopenharmony_ci  function notifyUpdatePackages(admin: Want, packageInfo: UpdatePackageInfo): Promise<void>;
56661847f8eSopenharmony_ci
56761847f8eSopenharmony_ci  /**
56861847f8eSopenharmony_ci   * Gets the result of system update.
56961847f8eSopenharmony_ci   * This function can be called by a super administrator.
57061847f8eSopenharmony_ci   *
57161847f8eSopenharmony_ci   * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM
57261847f8eSopenharmony_ci   * @param { Want } admin - admin indicates the administrator ability information.
57361847f8eSopenharmony_ci   * @param { string } version - version indicates the version of update.
57461847f8eSopenharmony_ci   * @returns { Promise<UpdateResult> } the promise returned by the getUpdateResult.
57561847f8eSopenharmony_ci   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
57661847f8eSopenharmony_ci   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
57761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
57861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
57961847f8eSopenharmony_ci   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
58061847f8eSopenharmony_ci   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
58161847f8eSopenharmony_ci   * @stagemodelonly
58261847f8eSopenharmony_ci   * @since 12
58361847f8eSopenharmony_ci   */
58461847f8eSopenharmony_ci  function getUpdateResult(admin: Want, version: string): Promise<UpdateResult>;
58561847f8eSopenharmony_ci}
58661847f8eSopenharmony_ci
58761847f8eSopenharmony_ciexport default systemManager;