提交 4c088a70 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 89f62c69
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
The cardEmulation module implements Near-Field Communication (NFC) card emulation. The cardEmulation module implements Near-Field Communication (NFC) card emulation.
> **NOTE**<br> > **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
......
...@@ -32,7 +32,7 @@ This is a system API. ...@@ -32,7 +32,7 @@ This is a system API.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the key input event to listen for. Only **key** is supported.| | type | string | Yes| Type of the key input event to listen for. Only **key** is supported.|
| keyOptions | [keyOptions](#keyOptions) | Yes| Key option, which specifies the condition for combination key input.| | keyOptions | [keyOptions](#keyoptions) | Yes| Key option, which specifies the condition for combination key input.|
| callback | Callback&lt;KeyOptions&gt; | Yes| Callback used to return the result.<br> When a key input event that meets the specified options occurs, **keyOptions** will be passed as an input parameter to **callback**.| | callback | Callback&lt;KeyOptions&gt; | Yes| Callback used to return the result.<br> When a key input event that meets the specified options occurs, **keyOptions** will be passed as an input parameter to **callback**.|
**Example** **Example**
...@@ -62,7 +62,7 @@ This is a system API. ...@@ -62,7 +62,7 @@ This is a system API.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the key input event to listen for. Only **key** is supported.| | type | string | Yes| Type of the key input event to listen for. Only **key** is supported.|
| keyOptions | [keyOptions](#keyOptions) | Yes| Key options passed to the key input event when listening starts.| | keyOptions | [keyOptions](#keyoptions) | Yes| Key options passed to the key input event when listening starts.|
| callback | Callback&lt;KeyOptions&gt; | Yes| Callback function passed to the key input event with **keyOptions** when listening starts.| | callback | Callback&lt;KeyOptions&gt; | Yes| Callback function passed to the key input event with **keyOptions** when listening starts.|
**Example** **Example**
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
The Input Device module implements listening for connection, disconnection, and update events of input devices and displays information about input devices. For example, it can be used to listen for mouse insertion and removal and obtain information such as the ID, name, and pointer speed of the mouse. The Input Device module implements listening for connection, disconnection, and update events of input devices and displays information about input devices. For example, it can be used to listen for mouse insertion and removal and obtain information such as the ID, name, and pointer speed of the mouse.
> **NOTE**<br> > **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -28,7 +29,7 @@ Enables listening for hot swap events of an input device. ...@@ -28,7 +29,7 @@ Enables listening for hot swap events of an input device.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------- | | -------- | ---------------------------------------- | ---- | ----------- |
| type | string | Yes | Event type of the input device. | | type | string | Yes | Event type of the input device. |
| listener | Callback&lt;[DeviceListener](#devicelistener<sup>9+</sup>)&gt; | Yes | Listener for events of the input device.| | listener | Callback&lt;[DeviceListener](#devicelistener9)&gt; | Yes | Listener for events of the input device.|
**Example** **Example**
...@@ -63,7 +64,7 @@ Disables listening for hot swap events of an input device. ...@@ -63,7 +64,7 @@ Disables listening for hot swap events of an input device.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------- | | -------- | ---------------------------------------- | ---- | ----------- |
| type | string | Yes | Event type of the input device. | | type | string | Yes | Event type of the input device. |
| listener | Callback&lt;[DeviceListener](#devicelistener<sup>9+</sup>)&gt; | No | Listener for events of the input device.| | listener | Callback&lt;[DeviceListener](#devicelistener9)&gt; | No | Listener for events of the input device.|
**Example** **Example**
...@@ -245,7 +246,7 @@ Obtains the keyboard type of an input device. This API uses an asynchronous call ...@@ -245,7 +246,7 @@ Obtains the keyboard type of an input device. This API uses an asynchronous call
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------------- | | -------- | ---------------------------------------- | ---- | --------------------------------- |
| deviceId | number | Yes | Unique ID of the input device. If the same physical device is repeatedly inserted and removed, its ID changes.| | deviceId | number | Yes | Unique ID of the input device. If the same physical device is repeatedly inserted and removed, its ID changes.|
| callback | AsyncCallback&lt;[KeyboardType](#keyboardtype)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[KeyboardType](#keyboardtype9)&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -268,7 +269,7 @@ Obtains the keyboard type of an input device. This API uses a promise to return ...@@ -268,7 +269,7 @@ Obtains the keyboard type of an input device. This API uses a promise to return
| Parameter | Description | | Parameter | Description |
| ---------------------------------------- | ------------------- | | ---------------------------------------- | ------------------- |
| Promise&lt;[KeyboardType](#keyboardtype)&gt; | Promise used to return the result.| | Promise&lt;[KeyboardType](#keyboardtype9)&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -336,7 +337,7 @@ Defines the axis range of an input device. ...@@ -336,7 +337,7 @@ Defines the axis range of an input device.
| Name | Type | Description | | Name | Type | Description |
| ----------------------- | ------------------------- | -------- | | ----------------------- | ------------------------- | -------- |
| source | [SourceType](#sourcetype) | Input source type of the axis.| | source | [SourceType](#sourcetype) | Input source type of the axis.|
| axis | [AxisType](#axistype) | Axis type. | | axis | [AxisType](#axistype9) | Axis type. |
| max | number | Maximum value of the axis. | | max | number | Maximum value of the axis. |
| min | number | Minimum value of the axis. | | min | number | Minimum value of the axis. |
| fuzz<sup>9+</sup> | number | Fuzzy value of the axis. | | fuzz<sup>9+</sup> | number | Fuzzy value of the axis. |
...@@ -358,7 +359,7 @@ Enumerates the input source types. For example, if a mouse reports an x-axis eve ...@@ -358,7 +359,7 @@ Enumerates the input source types. For example, if a mouse reports an x-axis eve
| touchpad | string | The input device is a touchpad.| | touchpad | string | The input device is a touchpad.|
| joystick | string | The input device is a joystick.| | joystick | string | The input device is a joystick.|
## ChangeType ## ChangedType
Defines the change type for the hot swap event of an input device. Defines the change type for the hot swap event of an input device.
......
...@@ -126,7 +126,7 @@ Switches to another input method. This API uses a promise to return the result. ...@@ -126,7 +126,7 @@ Switches to another input method. This API uses a promise to return the result.
``` ```
## InputMethodController ## InputMethodController
In the following API examples, you must first use **[getInputMethodController](#inputmethodgetinputmethodcontroller)** to obtain an **InputMethodController** instance, and then call the APIs using the obtained instance. In the following API examples, you must first use [getInputMethodController](#getinputmethodcontroller) to obtain an **InputMethodController** instance, and then call the APIs using the obtained instance.
### stopInput ### stopInput
...@@ -174,7 +174,7 @@ Hides the keyboard. This API uses an asynchronous callback to return the result. ...@@ -174,7 +174,7 @@ Hides the keyboard. This API uses an asynchronous callback to return the result.
## InputMethodSetting<sup>8+</sup> ## InputMethodSetting<sup>8+</sup>
In the following API examples, you must first use **[getInputMethodSetting](#inputmethodgetinputmethodcontroller)** to obtain an **InputMethodSetting** instance, and then call the APIs using the obtained instance. In the following API examples, you must first use [getInputMethodSetting](#getinputmethodsetting) to obtain an **InputMethodSetting** instance, and then call the APIs using the obtained instance.
### listInputMethod ### listInputMethod
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Implements Near-Field Communication (NFC). Implements Near-Field Communication (NFC).
> **NOTE**<br> > **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## **Modules to Import** ## **Modules to Import**
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Manages Near-Field Communication (NFC) tags. Manages Near-Field Communication (NFC) tags.
> **NOTE**<br> > **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## **Modules to Import** ## **Modules to Import**
......
...@@ -7,7 +7,7 @@ There are two types of updates: SD card update and over the air (OTA) update. ...@@ -7,7 +7,7 @@ There are two types of updates: SD card update and over the air (OTA) update.
- The SD card update depends on the update packages and SD cards. - The SD card update depends on the update packages and SD cards.
- The OTA update depends on the server deployed by the device manufacturer for managing update packages. The OTA server IP address is passed by the caller. The request interface is fixed and developed by the device manufacturer. - The OTA update depends on the server deployed by the device manufacturer for managing update packages. The OTA server IP address is passed by the caller. The request interface is fixed and developed by the device manufacturer.
> **NOTE** > **Note:**
> >
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> >
...@@ -30,7 +30,7 @@ Obtains an **OnlineUpdater** object. ...@@ -30,7 +30,7 @@ Obtains an **OnlineUpdater** object.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ---- | | ----------- | --------------------------- | ---- | ------ |
| upgradeInfo | [UpgradeInfo](#upgradeinfo) | Yes | **UpgradeInfo** object.| | upgradeInfo | [UpgradeInfo](#upgradeinfo) | Yes | **UpgradeInfo** object.|
**Return value** **Return value**
...@@ -41,7 +41,7 @@ Obtains an **OnlineUpdater** object. ...@@ -41,7 +41,7 @@ Obtains an **OnlineUpdater** object.
**Example** **Example**
``` ```ts
try { try {
var upgradeInfo = { var upgradeInfo = {
upgradeApp: "com.ohos.ota.updateclient", upgradeApp: "com.ohos.ota.updateclient",
...@@ -68,12 +68,12 @@ Obtains a **Restorer** object for restoring factory settings. ...@@ -68,12 +68,12 @@ Obtains a **Restorer** object for restoring factory settings.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | ---- | | --------------------- | ------ |
| [Restorer](#restorer) | **Restorer** object for restoring factory settings.| | [Restorer](#restorer) | **Restorer** object for restoring factory settings.|
**Example** **Example**
``` ```ts
try { try {
let restorer = update.getRestorer(); let restorer = update.getRestorer();
} catch(error) { } catch(error) {
...@@ -92,12 +92,12 @@ Obtains a **LocalUpdater** object. ...@@ -92,12 +92,12 @@ Obtains a **LocalUpdater** object.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | ---- | | ----------------------------- | ------ |
| [LocalUpdater](#localupdater) | **LocalUpdater** object.| | [LocalUpdater](#localupdater) | **LocalUpdater** object.|
**Example** **Example**
``` ```ts
try { try {
let localUpdater = update.getLocalUpdater(); let localUpdater = update.getLocalUpdater();
} catch(error) { } catch(error) {
...@@ -120,12 +120,12 @@ Checks whether a new version is available. This API uses an asynchronous callbac ...@@ -120,12 +120,12 @@ Checks whether a new version is available. This API uses an asynchronous callbac
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | -------------- |
| callback | AsyncCallback\<[CheckResult](#checkresult)> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[CheckResult](#checkresult)> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
updater.checkNewVersion((err, result) => { updater.checkNewVersion((err, result) => {
console.log(`checkNewVersion isExistNewVersion ${result?.isExistNewVersion}`); console.log(`checkNewVersion isExistNewVersion ${result?.isExistNewVersion}`);
}); });
...@@ -144,12 +144,12 @@ Checks whether a new version is available. This API uses a promise to return the ...@@ -144,12 +144,12 @@ Checks whether a new version is available. This API uses a promise to return the
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | ------------------------------------- | ------------------- |
| Promise\<[CheckResult](#checkresult)> | Promise used to return the result.| | Promise\<[CheckResult](#checkresult)> | Promise used to return the result.|
**Example** **Example**
``` ```ts
updater.checkNewVersion().then(result => { updater.checkNewVersion().then(result => {
console.log(`checkNewVersion isExistNewVersion: ${result.isExistNewVersion}`); console.log(`checkNewVersion isExistNewVersion: ${result.isExistNewVersion}`);
// Version digest information // Version digest information
...@@ -172,12 +172,12 @@ Obtains information about the new version. This API uses an asynchronous callbac ...@@ -172,12 +172,12 @@ Obtains information about the new version. This API uses an asynchronous callbac
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | --------------- |
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
updater.getNewVersionInfo((err, info) => { updater.getNewVersionInfo((err, info) => {
console.log(`info displayVersion = ${info?.versionComponents[0].displayVersion}`); console.log(`info displayVersion = ${info?.versionComponents[0].displayVersion}`);
console.log(`info innerVersion = ${info?.versionComponents[0].innerVersion}`); console.log(`info innerVersion = ${info?.versionComponents[0].innerVersion}`);
...@@ -197,12 +197,12 @@ Obtains information about the new version. This API uses a promise to return the ...@@ -197,12 +197,12 @@ Obtains information about the new version. This API uses a promise to return the
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | -------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the result.| | Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the result.|
**Example** **Example**
``` ```ts
updater.getNewVersionInfo().then(info => { updater.getNewVersionInfo().then(info => {
console.log(`info displayVersion = ${info.versionComponents[0].displayVersion}`); console.log(`info displayVersion = ${info.versionComponents[0].displayVersion}`);
console.log(`info innerVersion = ${info.versionComponents[0].innerVersion}`); console.log(`info innerVersion = ${info.versionComponents[0].innerVersion}`);
...@@ -224,14 +224,14 @@ Obtains the description file of the new version. This API uses an asynchronous c ...@@ -224,14 +224,14 @@ Obtains the description file of the new version. This API uses an asynchronous c
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | -------------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.| | descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file. |
| callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | Yes | Callback used to return the result.| | callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -262,19 +262,19 @@ Obtains the description file of the new version. This API uses a promise to retu ...@@ -262,19 +262,19 @@ Obtains the description file of the new version. This API uses a promise to retu
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.| | descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | ------------------- |
| Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise used to return the result.| | Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise used to return the result.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -306,12 +306,12 @@ Obtains information about the current version. This API uses an asynchronous cal ...@@ -306,12 +306,12 @@ Obtains information about the current version. This API uses an asynchronous cal
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | ---------------- |
| callback | AsyncCallback\<[CurrentVersionInfo](#currentversioninfo)> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[CurrentVersionInfo](#currentversioninfo)> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
updater.getCurrentVersionInfo((err, info) => { updater.getCurrentVersionInfo((err, info) => {
console.log(`info osVersion = ${info?.osVersion}`); console.log(`info osVersion = ${info?.osVersion}`);
console.log(`info deviceName = ${info?.deviceName}`); console.log(`info deviceName = ${info?.deviceName}`);
...@@ -332,12 +332,12 @@ Obtains information about the current version. This API uses a promise to return ...@@ -332,12 +332,12 @@ Obtains information about the current version. This API uses a promise to return
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | ------------------- |
| Promise\<[CurrentVersionInfo](#currentversioninfo)> | Promise used to return the result.| | Promise\<[CurrentVersionInfo](#currentversioninfo)> | Promise used to return the result.|
**Example** **Example**
``` ```ts
updater.getCurrentVersionInfo().then(info => { updater.getCurrentVersionInfo().then(info => {
console.log(`info osVersion = ${info.osVersion}`); console.log(`info osVersion = ${info.osVersion}`);
console.log(`info deviceName = ${info.deviceName}`); console.log(`info deviceName = ${info.deviceName}`);
...@@ -360,13 +360,13 @@ Obtains the description file of the current version. This API uses an asynchrono ...@@ -360,13 +360,13 @@ Obtains the description file of the current version. This API uses an asynchrono
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | --------------- |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.| | descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file. |
| callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | Yes | Callback used to return the result.| | callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
// Options of the description file // Options of the description file
var descriptionOptions = { var descriptionOptions = {
format: DescriptionFormat.STANDARD, // Standard format format: DescriptionFormat.STANDARD, // Standard format
...@@ -392,18 +392,18 @@ Obtains the description file of the current version. This API uses a promise to ...@@ -392,18 +392,18 @@ Obtains the description file of the current version. This API uses a promise to
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | ------ |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.| | descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | -------------------- |
| Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise used to return the result.| | Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise used to return the result.|
**Example** **Example**
``` ```ts
// Options of the description file // Options of the description file
var descriptionOptions = { var descriptionOptions = {
format: DescriptionFormat.STANDARD, // Standard format format: DescriptionFormat.STANDARD, // Standard format
...@@ -430,12 +430,12 @@ Obtains information about the update task. This API uses an asynchronous callbac ...@@ -430,12 +430,12 @@ Obtains information about the update task. This API uses an asynchronous callbac
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ------------------------------------- | ---- | ---------------- |
| callback | AsyncCallback\<[TaskInfo](#taskinfo)> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[TaskInfo](#taskinfo)> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
updater.getTaskInfo((err, info) => { updater.getTaskInfo((err, info) => {
console.log(`getTaskInfo isexistTask= ${info?.existTask}`); console.log(`getTaskInfo isexistTask= ${info?.existTask}`);
}); });
...@@ -454,12 +454,12 @@ Obtains information about the update task. This API uses a promise to return the ...@@ -454,12 +454,12 @@ Obtains information about the update task. This API uses a promise to return the
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | ------------------------------- | ------------------- |
| Promise\<[TaskInfo](#taskinfo)> | Promise used to return the result.| | Promise\<[TaskInfo](#taskinfo)> | Promise used to return the result.|
**Example** **Example**
``` ```ts
updater.getTaskInfo().then(info => { updater.getTaskInfo().then(info => {
console.log(`getTaskInfo isexistTask= ${info.existTask}`); console.log(`getTaskInfo isexistTask= ${info.existTask}`);
}).catch(err => { }).catch(err => {
...@@ -480,14 +480,14 @@ Downloads the new version. This API uses an asynchronous callback to return the ...@@ -480,14 +480,14 @@ Downloads the new version. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ---------------------------------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options.| | downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -516,19 +516,19 @@ Downloads the new version. This API uses a promise to return the result. ...@@ -516,19 +516,19 @@ Downloads the new version. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options.| | downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -559,14 +559,14 @@ Resumes download of the new version. This API uses an asynchronous callback to r ...@@ -559,14 +559,14 @@ Resumes download of the new version. This API uses an asynchronous callback to r
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | --------------------- | ---------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | Yes | Options for resuming download.| | resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | Yes | Options for resuming download. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -594,19 +594,19 @@ Resumes download of the new version. This API uses a promise to return the resul ...@@ -594,19 +594,19 @@ Resumes download of the new version. This API uses a promise to return the resul
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | --------------------- | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | Yes | Options for resuming download.| | resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | Yes | Options for resuming download.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -636,14 +636,14 @@ Pauses download of the new version. This API uses an asynchronous callback to re ...@@ -636,14 +636,14 @@ Pauses download of the new version. This API uses an asynchronous callback to re
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------------------- | ---------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | Yes | Options for pausing download.| | pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | Yes | Options for pausing download. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -671,19 +671,19 @@ Resumes download of the new version. This API uses a promise to return the resul ...@@ -671,19 +671,19 @@ Resumes download of the new version. This API uses a promise to return the resul
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------------------- | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | Yes | Options for pausing download.| | pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | Yes | Options for pausing download.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -713,14 +713,14 @@ Updates the version. This API uses an asynchronous callback to return the result ...@@ -713,14 +713,14 @@ Updates the version. This API uses an asynchronous callback to return the result
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options.| | upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -748,19 +748,19 @@ Updates the version. This API uses a promise to return the result. ...@@ -748,19 +748,19 @@ Updates the version. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options.| | upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -790,14 +790,14 @@ Clears errors. This API uses an asynchronous callback to return the result. ...@@ -790,14 +790,14 @@ Clears errors. This API uses an asynchronous callback to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| clearOptions | [ClearOptions](#clearoptions) | Yes | Clear options.| | clearOptions | [ClearOptions](#clearoptions) | Yes | Clear options. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -825,19 +825,19 @@ Clears errors. This API uses a promise to return the result. ...@@ -825,19 +825,19 @@ Clears errors. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.| | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| clearOptions | [ClearOptions](#clearoptions) | Yes | Update options.| | clearOptions | [ClearOptions](#clearoptions) | Yes | Update options. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
// Version digest information // Version digest information
var versionDigestInfo = { var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result versionDigest: "versionDigest" // Version digest information in the check result
...@@ -867,12 +867,12 @@ Obtains the update policy. This API uses an asynchronous callback to return the ...@@ -867,12 +867,12 @@ Obtains the update policy. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------- | | -------- | ---------------------------------------- | ---- | --------------- |
| callback | AsyncCallback\<[UpgradePolicy](#upgradepolicy)> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[UpgradePolicy](#upgradepolicy)> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
updater.getUpgradePolicy((err, policy) => { updater.getUpgradePolicy((err, policy) => {
console.log(`policy downloadStrategy = ${policy?.downloadStrategy}`); console.log(`policy downloadStrategy = ${policy?.downloadStrategy}`);
console.log(`policy autoUpgradeStrategy = ${policy?.autoUpgradeStrategy}`); console.log(`policy autoUpgradeStrategy = ${policy?.autoUpgradeStrategy}`);
...@@ -892,12 +892,12 @@ Obtains the update policy. This API uses a promise to return the result. ...@@ -892,12 +892,12 @@ Obtains the update policy. This API uses a promise to return the result.
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------------------------- | ----------------- | | ---------------------------------------- | --------------------- |
| Promise\<[UpgradePolicy](#upgradepolicy)> | Promise used to return the result.| | Promise\<[UpgradePolicy](#upgradepolicy)> | Promise used to return the result.|
**Example** **Example**
``` ```ts
updater.getUpgradePolicy().then(policy => { updater.getUpgradePolicy().then(policy => {
console.log(`policy downloadStrategy = ${policy.downloadStrategy}`); console.log(`policy downloadStrategy = ${policy.downloadStrategy}`);
console.log(`policy autoUpgradeStrategy = ${policy.autoUpgradeStrategy}`); console.log(`policy autoUpgradeStrategy = ${policy.autoUpgradeStrategy}`);
...@@ -919,13 +919,13 @@ Sets the update policy. This API uses an asynchronous callback to return the res ...@@ -919,13 +919,13 @@ Sets the update policy. This API uses an asynchronous callback to return the res
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------- | | -------- | ------------------------------- | ---- | ------------- |
| policy | [UpgradePolicy](#upgradepolicy) | Yes | Update policy.| | policy | [UpgradePolicy](#upgradepolicy) | Yes | Update policy. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
let policy = { let policy = {
downloadStrategy: false, downloadStrategy: false,
autoUpgradeStrategy: false, autoUpgradeStrategy: false,
...@@ -949,18 +949,18 @@ Sets the update policy. This API uses a promise to return the result. ...@@ -949,18 +949,18 @@ Sets the update policy. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------ | ----------------------------- | ---- | ------ | | ------ | ------------------------------- | ---- | ---- |
| policy | [UpgradePolicy](#upgradepolicy) | Yes | Update policy.| | policy | [UpgradePolicy](#upgradepolicy) | Yes | Update policy.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------- | --------------- | | -------------- | ------------------- |
| Promise\<void> | Promise used to return the result.| | Promise\<void> | Promise used to return the result.|
**Example** **Example**
``` ```ts
let policy = { let policy = {
downloadStrategy: false, downloadStrategy: false,
autoUpgradeStrategy: false, autoUpgradeStrategy: false,
...@@ -986,12 +986,12 @@ Terminates the update. This API uses an asynchronous callback to return the resu ...@@ -986,12 +986,12 @@ Terminates the update. This API uses an asynchronous callback to return the resu
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | -------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
updater.terminateUpgrade((err) => { updater.terminateUpgrade((err) => {
console.log(`terminateUpgrade error ${JSON.stringify(err)}`); console.log(`terminateUpgrade error ${JSON.stringify(err)}`);
}); });
...@@ -1010,12 +1010,12 @@ Terminates the update. This API uses a promise to return the result. ...@@ -1010,12 +1010,12 @@ Terminates the update. This API uses a promise to return the result.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
updater.terminateUpgrade().then(() => { updater.terminateUpgrade().then(() => {
console.log(`terminateUpgrade success`); console.log(`terminateUpgrade success`);
}).catch(err => { }).catch(err => {
...@@ -1034,13 +1034,13 @@ Enables listening for update events. This API uses an asynchronous callback to r ...@@ -1034,13 +1034,13 @@ Enables listening for update events. This API uses an asynchronous callback to r
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.| | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.| | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.|
**Example** **Example**
``` ```ts
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1061,13 +1061,13 @@ Disables listening for update events. This API uses an asynchronous callback to ...@@ -1061,13 +1061,13 @@ Disables listening for update events. This API uses an asynchronous callback to
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.| | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | No | Event callback.| | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | No | Event callback.|
**Example** **Example**
``` ```ts
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1084,7 +1084,7 @@ updater.off(eventClassifyInfo, (eventInfo) => { ...@@ -1084,7 +1084,7 @@ updater.off(eventClassifyInfo, (eventInfo) => {
factoryReset(callback: AsyncCallback\<void>): void factoryReset(callback: AsyncCallback\<void>): void
Restores factory settings. This API uses an asynchronous callback to return the result. Restore the device to its factory settings. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
...@@ -1093,12 +1093,12 @@ Restores factory settings. This API uses an asynchronous callback to return the ...@@ -1093,12 +1093,12 @@ Restores factory settings. This API uses an asynchronous callback to return the
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | -------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
restorer.factoryReset((err) => { restorer.factoryReset((err) => {
console.log(`factoryReset error ${JSON.stringify(err)}`); console.log(`factoryReset error ${JSON.stringify(err)}`);
}); });
...@@ -1108,7 +1108,7 @@ restorer.factoryReset((err) => { ...@@ -1108,7 +1108,7 @@ restorer.factoryReset((err) => {
factoryReset(): Promise\<void> factoryReset(): Promise\<void>
Restores factory settings. This API uses a promise to return the result. Restore the device to its factory settings. This API uses a promise to return the result.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
...@@ -1117,12 +1117,12 @@ Restores factory settings. This API uses a promise to return the result. ...@@ -1117,12 +1117,12 @@ Restores factory settings. This API uses a promise to return the result.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
restorer.factoryReset().then(() => { restorer.factoryReset().then(() => {
console.log(`factoryReset success`); console.log(`factoryReset success`);
}).catch(err => { }).catch(err => {
...@@ -1145,14 +1145,14 @@ Verifies the update package. This API uses an asynchronous callback to return th ...@@ -1145,14 +1145,14 @@ Verifies the update package. This API uses an asynchronous callback to return th
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------- | --------------------------- | ---- | ---------------- |
| upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file.| | upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file. |
| certsFile | string | Yes | Path of the certificate file.| | certsFile | string | Yes | Path of the certificate file. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void> | Yes | Callback used to return the result.|
**Example** **Example**
``` ```ts
var upgradeFile = { var upgradeFile = {
fileType: update.ComponentType.OTA, // OTA package fileType: update.ComponentType.OTA, // OTA package
filePath: "path" // Path of the local update package filePath: "path" // Path of the local update package
...@@ -1176,19 +1176,19 @@ Verifies the update package. This API uses a promise to return the result. ...@@ -1176,19 +1176,19 @@ Verifies the update package. This API uses a promise to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------- | --------------------------- | ---- | ------ |
| upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file.| | upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file. |
| certsFile | string | Yes | Path of the certificate file.| | certsFile | string | Yes | Path of the certificate file.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | ---------------------- |
| Promise\<void> | Promise used to return the result.| | Promise\<void> | Promise used to return the result.|
**Example** **Example**
``` ```ts
var upgradeFile = { var upgradeFile = {
fileType: update.ComponentType.OTA, // OTA package fileType: update.ComponentType.OTA, // OTA package
filePath: "path" // Path of the local update package filePath: "path" // Path of the local update package
...@@ -1212,13 +1212,13 @@ Installs the update package. This API uses an asynchronous callback to return th ...@@ -1212,13 +1212,13 @@ Installs the update package. This API uses an asynchronous callback to return th
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------- | ---------------------------------- | ---- | --------------------------------------- |
| upgradeFile | Array<[UpgradeFile](#upgradefile)> | Yes | Update file.| | upgradeFile | Array<[UpgradeFile](#upgradefile)> | Yes | Update file. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.| | callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.|
**Example** **Example**
``` ```ts
var upgradeFiles = [{ var upgradeFiles = [{
fileType: update.ComponentType.OTA, // OTA package fileType: update.ComponentType.OTA, // OTA package
filePath: "path" // Path of the local update package filePath: "path" // Path of the local update package
...@@ -1242,12 +1242,12 @@ Installs the update package. This API uses a promise to return the result. ...@@ -1242,12 +1242,12 @@ Installs the update package. This API uses a promise to return the result.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
``` ```ts
var upgradeFiles = [{ var upgradeFiles = [{
fileType: update.ComponentType.OTA, // OTA package fileType: update.ComponentType.OTA, // OTA package
filePath: "path" // Path of the local update package filePath: "path" // Path of the local update package
...@@ -1269,13 +1269,13 @@ Enables listening for update events. This API uses an asynchronous callback to r ...@@ -1269,13 +1269,13 @@ Enables listening for update events. This API uses an asynchronous callback to r
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.| | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.| | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.|
**Example** **Example**
``` ```ts
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1298,13 +1298,13 @@ Disables listening for update events. This API uses an asynchronous callback to ...@@ -1298,13 +1298,13 @@ Disables listening for update events. This API uses an asynchronous callback to
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.| | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.| | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.|
**Example** **Example**
``` ```ts
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1324,9 +1324,9 @@ Represents update information. ...@@ -1324,9 +1324,9 @@ Represents update information.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ----------------------------- | ---- | ------ |
| upgradeApp | string | Yes | Application package name. | | upgradeApp | string | Yes | Application package name. |
| businessType | [BusinessType](#businesstype) | Yes | Update service type. | | businessType | [BusinessType](#businesstype) | Yes | Update service type.|
## BusinessType ## BusinessType
...@@ -1335,9 +1335,9 @@ Enumerates update service types. ...@@ -1335,9 +1335,9 @@ Enumerates update service types.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------- | ----------------------------------- | ---- | ---- |
| vendor | [BusinessVendor](#businessvendor) | Yes | Application vendor. | | vendor | [BusinessVendor](#businessvendor) | Yes | Application vendor. |
| subType | [BusinessSubType](#businesssubtype) | Yes | Update service sub-type. | | subType | [BusinessSubType](#businesssubtype) | Yes | Type |
## CheckResult ## CheckResult
...@@ -1346,8 +1346,8 @@ Represents the package check result. ...@@ -1346,8 +1346,8 @@ Represents the package check result.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | --------------------------------- | ---- | ------ |
| isExistNewVersion | bool | Yes | Whether a new version is available. | | isExistNewVersion | bool | Yes | Whether a new version is available.|
| newVersionInfo | [NewVersionInfo](#newversioninfo) | No | Information about the new version. | | newVersionInfo | [NewVersionInfo](#newversioninfo) | No | Information about the new version. |
## NewVersionInfo ## NewVersionInfo
...@@ -1357,9 +1357,9 @@ Represents information about the new version. ...@@ -1357,9 +1357,9 @@ Represents information about the new version.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components. | | versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components.|
## VersionDigestInfo ## VersionDigestInfo
...@@ -1368,8 +1368,8 @@ Represents version digest information. ...@@ -1368,8 +1368,8 @@ Represents version digest information.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------- | ------ | ---- | ---- |
| versionDigest | string | Yes | Version digest information. | | versionDigest | string | Yes | Version digest information.|
## VersionComponent ## VersionComponent
...@@ -1377,16 +1377,16 @@ Represents a version component. ...@@ -1377,16 +1377,16 @@ Represents a version component.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Parameter | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | --------------- | ----------------------------------- | ---- | -------- |
| componentId | number | Yes | Component ID. | | componentId | number | Yes | Component ID. |
| componentType | [ComponentType](#componentyype) | Yes | Component type. | | componentType | [ComponentType](#componenttype) | Yes | Component type. |
| upgradeAction | [UpgradeAction](#upgradeaction) | Yes | Update mode. | | upgradeAction | [UpgradeAction](#upgradeaction) | Yes | Update mode. |
| displayVersion | string | Yes | Display version number. | | displayVersion | string | Yes | Display version number. |
| innerVersion | string | Yes | Internal version number. | | innerVersion | string | Yes | Internal version number. |
| size | number | Yes | Update package size. | | size | number | Yes | Update package size. |
| effectiveMode | [EffectiveMode](#effectivemode) | Yes | Effective mode. | | effectiveMode | [EffectiveMode](#effectivemode) | Yes | Effective mode. |
| descriptionInfo | [DescriptionInfo](#descriptioninfo) | Yes | Information about the version description file. | | descriptionInfo | [DescriptionInfo](#descriptioninfo) | Yes | Information about the version description file.|
## DescriptionOptions ## DescriptionOptions
...@@ -1395,9 +1395,9 @@ Represents options of the description file. ...@@ -1395,9 +1395,9 @@ Represents options of the description file.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | -------- | --------------------------------------- | ---- | ------ |
| format | [DescriptionFormat](#descriptionformat) | Yes | Format of the description file. | | format | [DescriptionFormat](#descriptionformat) | Yes | Format of the description file.|
| language | string | Yes | Language of the description file. | | language | string | Yes | Language of the description file.|
## ComponentDescription ## ComponentDescription
...@@ -1406,9 +1406,9 @@ Represents a component description file. ...@@ -1406,9 +1406,9 @@ Represents a component description file.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | --------------- | ----------------------------------- | ---- | ------ |
| componentId | string | Yes | Component ID. | | componentId | string | Yes | Component ID. |
| descriptionInfo | [DescriptionInfo](#descriptioninfo) | Yes | Information about the description file. | | descriptionInfo | [DescriptionInfo](#descriptioninfo) | Yes | Information about the description file.|
## DescriptionInfo ## DescriptionInfo
...@@ -1417,9 +1417,9 @@ Represents information about the version description file. ...@@ -1417,9 +1417,9 @@ Represents information about the version description file.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | --------------- | ----------------------------------- | ---- | ------ |
| descriptionType | [DescriptionType](#descriptiontype) | Yes | Type of the description file. | | descriptionType | [DescriptionType](#descriptiontype) | Yes | Type of the description file.|
| content | string | Yes | Content of the description file. | | content | string | Yes | Content of the description file.|
## CurrentVersionInfo ## CurrentVersionInfo
...@@ -1428,10 +1428,10 @@ Represents information about the current version. ...@@ -1428,10 +1428,10 @@ Represents information about the current version.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---------------------------------------- | ---- | ----- |
| osVersion | string | Yes | System version number. | | osVersion | string | Yes | System version number.|
| deviceName | string | Yes | Device name. | | deviceName | string | Yes | Device name. |
| versionComponents | Array\<[VersionComponent](#vesioncomponent)> | No | Version components. | | versionComponents | Array\<[VersionComponent](#versioncomponent)> | No | Version components. |
## DownloadOptions ## DownloadOptions
...@@ -1440,9 +1440,9 @@ Represents download options. ...@@ -1440,9 +1440,9 @@ Represents download options.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ------------------- | ---- | ---- |
| allowNetwork | [NetType](#nettype) | Yes | Network type. | | allowNetwork | [NetType](#nettype) | Yes | Network type.|
| order | [Order](#order) | Yes | Update command. | | order | [Order](#order) | Yes | Update command.|
## ResumeDownloadOptions ## ResumeDownloadOptions
...@@ -1450,9 +1450,9 @@ Represents options for resuming download. ...@@ -1450,9 +1450,9 @@ Represents options for resuming download.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Parameter | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ------------------- | ---- | ---- |
| allowNetwork | [NetType](#nettype) | Yes | Network type. | | allowNetwork | [NetType](#nettype) | Yes | Network type.|
## PauseDownloadOptions ## PauseDownloadOptions
...@@ -1460,9 +1460,9 @@ Represents options for pausing download. ...@@ -1460,9 +1460,9 @@ Represents options for pausing download.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type| Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---- | ---- | -------- |
| isAllowAutoResume | bool | Yes | Whether to allow automatic resuming of download. | | isAllowAutoResume | bool | Yes | Whether to allow automatic resuming of download.|
## UpgradeOptions ## UpgradeOptions
...@@ -1471,8 +1471,8 @@ Represents update options. ...@@ -1471,8 +1471,8 @@ Represents update options.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----- | --------------- | ---- | ---- |
| order | [Order](#order) | Yes | Update command. | | order | [Order](#order) | Yes | Update command.|
## ClearOptions ## ClearOptions
...@@ -1481,8 +1481,8 @@ Represents options for clearing errors. ...@@ -1481,8 +1481,8 @@ Represents options for clearing errors.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------ | ------------------------------- | ---- | ---- |
| status | [UpgradeStatus](#upgradestatus) | Yes | Error status. | | status | [UpgradeStatus](#upgradestatus) | Yes | Error status.|
## UpgradePolicy ## UpgradePolicy
...@@ -1491,7 +1491,7 @@ Represents an update policy. ...@@ -1491,7 +1491,7 @@ Represents an update policy.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------------- | --------------------------------------- | ---- | ------- |
| downloadStrategy | bool | Yes | Automatic download policy. | | downloadStrategy | bool | Yes | Automatic download policy. |
| autoUpgradeStrategy | bool | Yes | Automatic update policy. | | autoUpgradeStrategy | bool | Yes | Automatic update policy. |
| autoUpgradePeriods | Array\<[UpgradePeriod](#upgradeperiod)> | Yes | Automatic update period.| | autoUpgradePeriods | Array\<[UpgradePeriod](#upgradeperiod)> | Yes | Automatic update period.|
...@@ -1503,9 +1503,9 @@ Represents a period for automatic update. ...@@ -1503,9 +1503,9 @@ Represents a period for automatic update.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----- | ------ | ---- | ---- |
| start | number | Yes | Start time. | | start | number | Yes | Start time.|
| end | number | Yes | End time. | | end | number | Yes | End time.|
## TaskInfo ## TaskInfo
...@@ -1514,20 +1514,20 @@ Represents task information. ...@@ -1514,20 +1514,20 @@ Represents task information.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | --------- | --------------------- | ---- | ------ |
| existTask | bool | Yes | Whether a task exists. | | existTask | bool | Yes | Whether a task exists.|
| taskBody | [TaskBody](#taskinfo) | Yes | Task data. | | taskBody | [TaskBody](#taskinfo) | Yes | Task data. |
## EventInfo ## EventInfo
Represents event information. Represents event type information.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Parameter | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | -------- | --------------------- | ---- | ---- |
| eventId | [EventId](#eventid) | Yes | Event ID. | | eventId | [EventId](#eventid) | Yes | Event ID.|
| taskBody | [TaskBody](#taskinfo) | Yes | Task data. | | taskBody | [TaskBody](#taskinfo) | Yes | Task data.|
## TaskBody ## TaskBody
...@@ -1536,14 +1536,14 @@ Represents task data. ...@@ -1536,14 +1536,14 @@ Represents task data.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| status | [UpgradeStatus](#upgradestatus) | Yes | Update status. | | status | [UpgradeStatus](#upgradestatus) | Yes | Update status.|
| subStatus | number | No | Sub-status. | | subStatus | number | No | Sub-status. |
| progress | number | Yes | Progress. | | progress | number | Yes | Progress. |
| installMode | number | Yes | Installation mode. | | installMode | number | Yes | Installation mode.|
| errorMessages | Array\<[ErrorMessage](#errormessage)> | No | Error message. | | errorMessages | Array\<[ErrorMessage](#errormessage)> | No | Error message.|
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components. | | versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components.|
## ErrorMessage ## ErrorMessage
...@@ -1552,9 +1552,9 @@ Represents an error message. ...@@ -1552,9 +1552,9 @@ Represents an error message.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ------ | ---- | ---- |
| errorCode | number | Yes | Error code. | | errorCode | number | Yes | Error code. |
| errorMessage | string | Yes | Error description. | | errorMessage | string | Yes | Error description.|
## EventClassifyInfo ## EventClassifyInfo
...@@ -1563,9 +1563,9 @@ Represents event type information. ...@@ -1563,9 +1563,9 @@ Represents event type information.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | ------------- | ------------------------------- | ---- | ---- |
| eventClassify | [EventClassify](#eventclassify) | Yes | Event type. | | eventClassify | [EventClassify](#eventclassify) | Yes | Event type.|
| extraInfo | string | Yes | Additional information. | | extraInfo | string | Yes | Additional information.|
## UpgradeFile ## UpgradeFile
...@@ -1574,20 +1574,20 @@ Represents an update file. ...@@ -1574,20 +1574,20 @@ Represents an update file.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- | | -------- | ------------------------------- | ---- | ---- |
| fileType | [ComponentType](#componenttype) | Yes | File type. | | fileType | [ComponentType](#componenttype) | Yes | File type.|
| filePath | string | Yes | File path. | | filePath | string | Yes | File path.|
## UpgradeTaskCallback ## UpgradeTaskCallback
### (eventInfo: [EventInfo](#eventinfo)): void ### (eventInfo: [EventInfo](#eventinfo)): void
Event callback. Represents an event callback.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Parameter | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------------- | ---------------------------------------- | ---- | ---- | | --------- | ----------------------- | ---- | ---- |
| eventInfo | [EventInfo](#eventinfo) | Yes | Event information.| | eventInfo | [EventInfo](#eventinfo) | Yes | Event information.|
## BusinessVendor ## BusinessVendor
...@@ -1597,7 +1597,7 @@ Device vendor. ...@@ -1597,7 +1597,7 @@ Device vendor.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ------ | -------- | ---- |
| PUBLIC | "public" | Open source. | | PUBLIC | "public" | Open source. |
## BusinessSubType ## BusinessSubType
...@@ -1607,7 +1607,7 @@ Represents an update type. ...@@ -1607,7 +1607,7 @@ Represents an update type.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | -------- | ---- | ---- |
| FIRMWARE | 1 | Firmware. | | FIRMWARE | 1 | Firmware. |
## ComponentType ## ComponentType
...@@ -1617,7 +1617,7 @@ Represents a component type. ...@@ -1617,7 +1617,7 @@ Represents a component type.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ---- | ---- | ---- |
| OTA | 1 | Firmware. | | OTA | 1 | Firmware. |
## UpgradeAction ## UpgradeAction
...@@ -1627,7 +1627,7 @@ Represents an update mode. ...@@ -1627,7 +1627,7 @@ Represents an update mode.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | -------- | ---------- | ---- |
| UPGRADE | "upgrade" | Differential package. | | UPGRADE | "upgrade" | Differential package. |
| RECOVERY | "recovery" | Recovery package. | | RECOVERY | "recovery" | Recovery package. |
...@@ -1638,10 +1638,10 @@ Represents an effective mode. ...@@ -1638,10 +1638,10 @@ Represents an effective mode.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ------------- | ---- | ---- |
| COLD | 1 | Cold update. | | COLD | 1 | Cold update. |
| LIVE | 2 | Live update. | | LIVE | 2 | Live update. |
| LIVE_AND_COLD | 3 | Hybrid live and cold update. | | LIVE_AND_COLD | 3 | Hybrid live and cold update.|
## DescriptionType ## DescriptionType
...@@ -1650,7 +1650,7 @@ Represents a description file type. ...@@ -1650,7 +1650,7 @@ Represents a description file type.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ------- | ---- | ---- |
| CONTENT | 0 | Content. | | CONTENT | 0 | Content. |
| URI | 1 | Link. | | URI | 1 | Link. |
...@@ -1661,9 +1661,9 @@ Represents a description file format. ...@@ -1661,9 +1661,9 @@ Represents a description file format.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ---------- | ---- | ---- |
| STANDARD | 0 | Standard format. | | STANDARD | 0 | Standard format.|
| SIMPLIFIED | 1 | Simple format. | | SIMPLIFIED | 1 | Simple format.|
## NetType ## NetType
...@@ -1672,12 +1672,12 @@ Enumerates network types. ...@@ -1672,12 +1672,12 @@ Enumerates network types.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ----------------- | ---- | --------- |
| CELLULAR | 1 | Data network. | | CELLULAR | 1 | Data network. |
| METERED_WIFI | 2 | Wi-Fi hotspot. | | METERED_WIFI | 2 | Wi-Fi hotspot. |
| NOT_METERED_WIFI | 4 | Non Wi-Fi hotspot. | | NOT_METERED_WIFI | 4 | Non Wi-Fi hotspot. |
| WIFI | 6 | WIFI | | WIFI | 6 | Wi-Fi. |
| CELLULAR_AND_WIFI | 7 | Data network and Wi-Fi. | | CELLULAR_AND_WIFI | 7 | Data network and Wi-Fi.|
## Order ## Order
...@@ -1686,12 +1686,12 @@ Represents an update command. ...@@ -1686,12 +1686,12 @@ Represents an update command.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | -------------------- | ---- | ----- |
| DOWNLOAD | 1 | Download. | | DOWNLOAD | 1 | Download. |
| INSTALL | 2 | Install. | | INSTALL | 2 | Install. |
| DOWNLOAD_AND_INSTALL | 3 | Download and install. | | DOWNLOAD_AND_INSTALL | 3 | Download and install.|
| APPLY | 4 | Apply. | | APPLY | 4 | Apply. |
| INSTALL_AND_APPLY | 6 | Install and apply. | | INSTALL_AND_APPLY | 6 | Install and apply.|
## UpgradeStatus ## UpgradeStatus
...@@ -1700,17 +1700,17 @@ Enumerates update states. ...@@ -1700,17 +1700,17 @@ Enumerates update states.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ---------------- | ---- | ---- |
| WAITING_DOWNLOAD | 20 | Waiting for download. | | WAITING_DOWNLOAD | 20 | Waiting for download. |
| DOWNLOADING | 21 | Downloading. | | DOWNLOADING | 21 | Downloading. |
| DOWNLOAD_PAUSED | 22 | Download paused. | | DOWNLOAD_PAUSED | 22 | Download paused.|
| DOWNLOAD_FAIL | 23 | Download failed. | | DOWNLOAD_FAIL | 23 | Download failed.|
| WAITING_INSTALL | 30 | Waiting for installation. | | WAITING_INSTALL | 30 | Waiting for installation. |
| UPDATING | 31 | Updating. | | UPDATING | 31 | Updating. |
| WAITING_APPLY | 40 | Waiting for applying the update. | | WAITING_APPLY | 40 | Waiting for applying the update. |
| APPLYING | 21 | Applying the update. | | APPLYING | 21 | Applying the update. |
| UPGRADE_SUCCESS | 50 | Update succeeded. | | UPGRADE_SUCCESS | 50 | Update succeeded.|
| UPGRADE_FAIL | 51 | Update failed. | | UPGRADE_FAIL | 51 | Update failed.|
## EventClassify ## EventClassify
...@@ -1719,8 +1719,8 @@ Represents an event type. ...@@ -1719,8 +1719,8 @@ Represents an event type.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ---- | ---------- | ---- |
| TASK | 0x01000000 | Task event. | | TASK | 0x01000000 | Task event.|
## EventId ## EventId
...@@ -1729,13 +1729,13 @@ Enumerates event IDs. ...@@ -1729,13 +1729,13 @@ Enumerates event IDs.
**System capability**: SystemCapability.Update.UpdateService **System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description | | Name | Default Value | Description |
| ------------------- | ---- | -------- | | ---------------------- | ---------- | ------ |
| EVENT_TASK_BASE | 0x01000000 | Indicates a task event. | | EVENT_TASK_BASE | 0x01000000 | Indicates a task event. |
| EVENT_TASK_RECEIVE | 0x01000001 | Indicates that a task is received. | | EVENT_TASK_RECEIVE | 0x01000001 | Indicates that a task is received. |
| EVENT_TASK_CANCEL | 0x01000010 | Indicates that a task is cancelled. | | EVENT_TASK_CANCEL | 0x01000010 | Indicates that a task is cancelled. |
| EVENT_DOWNLOAD_WAIT | 0x01000011 | Indicates the state of waiting for the download. | | EVENT_DOWNLOAD_WAIT | 0x01000011 | Indicates the state of waiting for the download. |
| EVENT_DOWNLOAD_START | 0x01000100 | Indicates that the download starts. | | EVENT_DOWNLOAD_START | 0x01000100 | Indicates that the download starts. |
| EVENT_DOWNLOAD_UPDATE | 0x01000101 | Indicates the download progress update. | | EVENT_DOWNLOAD_UPDATE | 0x01000101 | Indicates the download progress update.|
| EVENT_DOWNLOAD_PAUSE | 0x01000110 | Indicates that the download is paused. | | EVENT_DOWNLOAD_PAUSE | 0x01000110 | Indicates that the download is paused. |
| EVENT_DOWNLOAD_RESUME | 0x01000111 | Indicates that the download is resumed. | | EVENT_DOWNLOAD_RESUME | 0x01000111 | Indicates that the download is resumed. |
| EVENT_DOWNLOAD_SUCCESS | 0x01001000 | Indicates that the download succeeded. | | EVENT_DOWNLOAD_SUCCESS | 0x01001000 | Indicates that the download succeeded. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册