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

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 89f62c69
......@@ -3,7 +3,7 @@
The cardEmulation module implements Near-Field Communication (NFC) card emulation.
> **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
......
......@@ -32,7 +32,7 @@ This is a system API.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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**.|
**Example**
......@@ -62,7 +62,7 @@ This is a system API.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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.|
**Example**
......
......@@ -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.
> **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.
......@@ -28,7 +29,7 @@ Enables listening for hot swap events of an input device.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------- |
| 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**
......@@ -63,7 +64,7 @@ Disables listening for hot swap events of an input device.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------- |
| 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**
......@@ -245,7 +246,7 @@ Obtains the keyboard type of an input device. This API uses an asynchronous call
| 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.|
| 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**
......@@ -268,7 +269,7 @@ Obtains the keyboard type of an input device. This API uses a promise to return
| 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**
......@@ -336,7 +337,7 @@ Defines the axis range of an input device.
| Name | Type | Description |
| ----------------------- | ------------------------- | -------- |
| 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. |
| min | number | Minimum 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
| touchpad | string | The input device is a touchpad.|
| joystick | string | The input device is a joystick.|
## ChangeType
## ChangedType
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.
```
## 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
......@@ -174,7 +174,7 @@ Hides the keyboard. This API uses an asynchronous callback to return the result.
## 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
......
......@@ -3,7 +3,7 @@
Implements Near-Field Communication (NFC).
> **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**
......
......@@ -3,7 +3,7 @@
Manages Near-Field Communication (NFC) tags.
> **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**
......
......@@ -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 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.
>
......@@ -30,7 +30,7 @@ Obtains an **OnlineUpdater** object.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ---- |
| ----------- | --------------------------- | ---- | ------ |
| upgradeInfo | [UpgradeInfo](#upgradeinfo) | Yes | **UpgradeInfo** object.|
**Return value**
......@@ -41,7 +41,7 @@ Obtains an **OnlineUpdater** object.
**Example**
```
```ts
try {
var upgradeInfo = {
upgradeApp: "com.ohos.ota.updateclient",
......@@ -68,12 +68,12 @@ Obtains a **Restorer** object for restoring factory settings.
**Return value**
| Type | Description |
| ------------------- | ---- |
| --------------------- | ------ |
| [Restorer](#restorer) | **Restorer** object for restoring factory settings.|
**Example**
```
```ts
try {
let restorer = update.getRestorer();
} catch(error) {
......@@ -92,12 +92,12 @@ Obtains a **LocalUpdater** object.
**Return value**
| Type | Description |
| ------------------- | ---- |
| ----------------------------- | ------ |
| [LocalUpdater](#localupdater) | **LocalUpdater** object.|
**Example**
```
```ts
try {
let localUpdater = update.getLocalUpdater();
} catch(error) {
......@@ -120,12 +120,12 @@ Checks whether a new version is available. This API uses an asynchronous callbac
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| -------- | ---------------------------------------- | ---- | -------------- |
| callback | AsyncCallback\<[CheckResult](#checkresult)> | Yes | Callback used to return the result.|
**Example**
```
```ts
updater.checkNewVersion((err, result) => {
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
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| ------------------------------------- | ------------------- |
| Promise\<[CheckResult](#checkresult)> | Promise used to return the result.|
**Example**
```
```ts
updater.checkNewVersion().then(result => {
console.log(`checkNewVersion isExistNewVersion: ${result.isExistNewVersion}`);
// Version digest information
......@@ -172,12 +172,12 @@ Obtains information about the new version. This API uses an asynchronous callbac
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| -------- | ---------------------------------------- | ---- | --------------- |
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | Yes | Callback used to return the result.|
**Example**
```
```ts
updater.getNewVersionInfo((err, info) => {
console.log(`info displayVersion = ${info?.versionComponents[0].displayVersion}`);
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
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| ---------------------------------------- | -------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the result.|
**Example**
```
```ts
updater.getNewVersionInfo().then(info => {
console.log(`info displayVersion = ${info.versionComponents[0].displayVersion}`);
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.|
| ------------------ | ---------------------------------------- | ---- | -------------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file. |
| callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | Yes | Callback used to return the result.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ------------------ | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.|
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| ---------------------------------------- | ------------------- |
| Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise used to return the result.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| -------- | ---------------------------------------- | ---- | ---------------- |
| callback | AsyncCallback\<[CurrentVersionInfo](#currentversioninfo)> | Yes | Callback used to return the result.|
**Example**
```
```ts
updater.getCurrentVersionInfo((err, info) => {
console.log(`info osVersion = ${info?.osVersion}`);
console.log(`info deviceName = ${info?.deviceName}`);
......@@ -332,12 +332,12 @@ Obtains information about the current version. This API uses a promise to return
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| ---------------------------------------- | ------------------- |
| Promise\<[CurrentVersionInfo](#currentversioninfo)> | Promise used to return the result.|
**Example**
```
```ts
updater.getCurrentVersionInfo().then(info => {
console.log(`info osVersion = ${info.osVersion}`);
console.log(`info deviceName = ${info.deviceName}`);
......@@ -360,13 +360,13 @@ Obtains the description file of the current version. This API uses an asynchrono
**Parameters**
| 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.|
**Example**
```
```ts
// Options of the description file
var descriptionOptions = {
format: DescriptionFormat.STANDARD, // Standard format
......@@ -392,18 +392,18 @@ Obtains the description file of the current version. This API uses a promise to
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ------------------ | ---------------------------------------- | ---- | ------ |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | Yes | Options of the description file.|
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| ---------------------------------------- | -------------------- |
| Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise used to return the result.|
**Example**
```
```ts
// Options of the description file
var descriptionOptions = {
format: DescriptionFormat.STANDARD, // Standard format
......@@ -430,12 +430,12 @@ Obtains information about the update task. This API uses an asynchronous callbac
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| -------- | ------------------------------------- | ---- | ---------------- |
| callback | AsyncCallback\<[TaskInfo](#taskinfo)> | Yes | Callback used to return the result.|
**Example**
```
```ts
updater.getTaskInfo((err, info) => {
console.log(`getTaskInfo isexistTask= ${info?.existTask}`);
});
......@@ -454,12 +454,12 @@ Obtains information about the update task. This API uses a promise to return the
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| ------------------------------- | ------------------- |
| Promise\<[TaskInfo](#taskinfo)> | Promise used to return the result.|
**Example**
```
```ts
updater.getTaskInfo().then(info => {
console.log(`getTaskInfo isexistTask= ${info.existTask}`);
}).catch(err => {
......@@ -480,14 +480,14 @@ Downloads the new version. This API uses an asynchronous callback to return the
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| 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.|
| ----------------- | --------------------------------------- | ---- | ---------------------------------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options. |
| 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**
```
```ts
// Version digest information
var versionDigestInfo = {
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.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options.|
| downloadOptions | [DownloadOptions](#downloadoptions) | Yes | Download options. |
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| 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.|
| --------------------- | ---------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | Yes | Options for resuming download. |
| 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**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| --------------------- | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | Yes | Options for resuming download.|
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| 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.|
| -------------------- | ---------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | Yes | Options for pausing download. |
| 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**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| -------------------- | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | Yes | Options for pausing download.|
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| 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.|
| ----------------- | --------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options. |
| 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**
```
```ts
// Version digest information
var versionDigestInfo = {
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.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options.|
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | Yes | Update options. |
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| 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.|
| ----------------- | --------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| clearOptions | [ClearOptions](#clearoptions) | Yes | Clear options. |
| 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**
```
```ts
// Version digest information
var versionDigestInfo = {
versionDigest: "versionDigest" // Version digest information in the check result
......@@ -825,19 +825,19 @@ Clears errors. This API uses a promise to return the result.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| clearOptions | [ClearOptions](#clearoptions) | Yes | Update options.|
| clearOptions | [ClearOptions](#clearoptions) | Yes | Update options. |
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
// Version digest information
var versionDigestInfo = {
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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------- |
| -------- | ---------------------------------------- | ---- | --------------- |
| callback | AsyncCallback\<[UpgradePolicy](#upgradepolicy)> | Yes | Callback used to return the result.|
**Example**
```
```ts
updater.getUpgradePolicy((err, policy) => {
console.log(`policy downloadStrategy = ${policy?.downloadStrategy}`);
console.log(`policy autoUpgradeStrategy = ${policy?.autoUpgradeStrategy}`);
......@@ -892,12 +892,12 @@ Obtains the update policy. This API uses a promise to return the result.
**Return value**
| Type | Description |
| --------------------------------------- | ----------------- |
| ---------------------------------------- | --------------------- |
| Promise\<[UpgradePolicy](#upgradepolicy)> | Promise used to return the result.|
**Example**
```
```ts
updater.getUpgradePolicy().then(policy => {
console.log(`policy downloadStrategy = ${policy.downloadStrategy}`);
console.log(`policy autoUpgradeStrategy = ${policy.autoUpgradeStrategy}`);
......@@ -919,13 +919,13 @@ Sets the update policy. This API uses an asynchronous callback to return the res
**Parameters**
| 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.|
**Example**
```
```ts
let policy = {
downloadStrategy: false,
autoUpgradeStrategy: false,
......@@ -949,18 +949,18 @@ Sets the update policy. This API uses a promise to return the result.
**Parameters**
| Name | Type | Mandatory | Description |
| ------ | ----------------------------- | ---- | ------ |
| ------ | ------------------------------- | ---- | ---- |
| policy | [UpgradePolicy](#upgradepolicy) | Yes | Update policy.|
**Return value**
| Type | Description |
| ---------------- | --------------- |
| -------------- | ------------------- |
| Promise\<void> | Promise used to return the result.|
**Example**
```
```ts
let policy = {
downloadStrategy: false,
autoUpgradeStrategy: false,
......@@ -986,12 +986,12 @@ Terminates the update. This API uses an asynchronous callback to return the resu
**Parameters**
| 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**
```
```ts
updater.terminateUpgrade((err) => {
console.log(`terminateUpgrade error ${JSON.stringify(err)}`);
});
......@@ -1010,12 +1010,12 @@ Terminates the update. This API uses a promise to return the result.
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
updater.terminateUpgrade().then(() => {
console.log(`terminateUpgrade success`);
}).catch(err => {
......@@ -1034,13 +1034,13 @@ Enables listening for update events. This API uses an asynchronous callback to r
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.|
**Example**
```
```ts
var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: ""
......@@ -1061,13 +1061,13 @@ Disables listening for update events. This API uses an asynchronous callback to
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | No | Event callback.|
**Example**
```
```ts
var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: ""
......@@ -1084,7 +1084,7 @@ updater.off(eventClassifyInfo, (eventInfo) => {
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
......@@ -1093,12 +1093,12 @@ Restores factory settings. This API uses an asynchronous callback to return the
**Parameters**
| 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**
```
```ts
restorer.factoryReset((err) => {
console.log(`factoryReset error ${JSON.stringify(err)}`);
});
......@@ -1108,7 +1108,7 @@ restorer.factoryReset((err) => {
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
......@@ -1117,12 +1117,12 @@ Restores factory settings. This API uses a promise to return the result.
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
restorer.factoryReset().then(() => {
console.log(`factoryReset success`);
}).catch(err => {
......@@ -1145,14 +1145,14 @@ Verifies the update package. This API uses an asynchronous callback to return th
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file.|
| certsFile | string | Yes | Path of the certificate file.|
| ----------- | --------------------------- | ---- | ---------------- |
| upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file. |
| certsFile | string | Yes | Path of the certificate file. |
| callback | AsyncCallback\<void> | Yes | Callback used to return the result.|
**Example**
```
```ts
var upgradeFile = {
fileType: update.ComponentType.OTA, // OTA 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.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file.|
| ----------- | --------------------------- | ---- | ------ |
| upgradeFile | [UpgradeFile](#upgradefile) | Yes | Update file. |
| certsFile | string | Yes | Path of the certificate file.|
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | ---------------------- |
| Promise\<void> | Promise used to return the result.|
**Example**
```
```ts
var upgradeFile = {
fileType: update.ComponentType.OTA, // OTA 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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| 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.|
| ----------- | ---------------------------------- | ---- | --------------------------------------- |
| upgradeFile | Array<[UpgradeFile](#upgradefile)> | Yes | Update file. |
| 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**
```
```ts
var upgradeFiles = [{
fileType: update.ComponentType.OTA, // OTA 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.
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| -------------- | -------------------------- |
| Promise\<void> | Promise that returns no value.|
**Example**
```
```ts
var upgradeFiles = [{
fileType: update.ComponentType.OTA, // OTA 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
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.|
**Example**
```
```ts
var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: ""
......@@ -1298,13 +1298,13 @@ Disables listening for update events. This API uses an asynchronous callback to
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | Yes | Event information.|
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | Yes | Event callback.|
**Example**
```
```ts
var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: ""
......@@ -1324,9 +1324,9 @@ Represents update information.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| ------------ | ----------------------------- | ---- | ------ |
| upgradeApp | string | Yes | Application package name. |
| businessType | [BusinessType](#businesstype) | Yes | Update service type. |
| businessType | [BusinessType](#businesstype) | Yes | Update service type.|
## BusinessType
......@@ -1335,9 +1335,9 @@ Enumerates update service types.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| ------- | ----------------------------------- | ---- | ---- |
| vendor | [BusinessVendor](#businessvendor) | Yes | Application vendor. |
| subType | [BusinessSubType](#businesssubtype) | Yes | Update service sub-type. |
| subType | [BusinessSubType](#businesssubtype) | Yes | Type |
## CheckResult
......@@ -1346,8 +1346,8 @@ Represents the package check result.
**System capability**: SystemCapability.Update.UpdateService
| 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
......@@ -1357,9 +1357,9 @@ Represents information about the new version.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components. |
| ----------------- | ---------------------------------------- | ---- | ---- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components.|
## VersionDigestInfo
......@@ -1368,8 +1368,8 @@ Represents version digest information.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| versionDigest | string | Yes | Version digest information. |
| ------------- | ------ | ---- | ---- |
| versionDigest | string | Yes | Version digest information.|
## VersionComponent
......@@ -1377,16 +1377,16 @@ Represents a version component.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| Parameter | Type | Mandatory | Description |
| --------------- | ----------------------------------- | ---- | -------- |
| componentId | number | Yes | Component ID. |
| componentType | [ComponentType](#componentyype) | Yes | Component type. |
| componentType | [ComponentType](#componenttype) | Yes | Component type. |
| upgradeAction | [UpgradeAction](#upgradeaction) | Yes | Update mode. |
| displayVersion | string | Yes | Display version number. |
| innerVersion | string | Yes | Internal version number. |
| size | number | Yes | Update package size. |
| 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
......@@ -1395,9 +1395,9 @@ Represents options of the description file.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| format | [DescriptionFormat](#descriptionformat) | Yes | Format of the description file. |
| language | string | Yes | Language of the description file. |
| -------- | --------------------------------------- | ---- | ------ |
| format | [DescriptionFormat](#descriptionformat) | Yes | Format of the description file.|
| language | string | Yes | Language of the description file.|
## ComponentDescription
......@@ -1406,9 +1406,9 @@ Represents a component description file.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| --------------- | ----------------------------------- | ---- | ------ |
| componentId | string | Yes | Component ID. |
| descriptionInfo | [DescriptionInfo](#descriptioninfo) | Yes | Information about the description file. |
| descriptionInfo | [DescriptionInfo](#descriptioninfo) | Yes | Information about the description file.|
## DescriptionInfo
......@@ -1417,9 +1417,9 @@ Represents information about the version description file.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| descriptionType | [DescriptionType](#descriptiontype) | Yes | Type of the description file. |
| content | string | Yes | Content of the description file. |
| --------------- | ----------------------------------- | ---- | ------ |
| descriptionType | [DescriptionType](#descriptiontype) | Yes | Type of the description file.|
| content | string | Yes | Content of the description file.|
## CurrentVersionInfo
......@@ -1428,10 +1428,10 @@ Represents information about the current version.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| osVersion | string | Yes | System version number. |
| ----------------- | ---------------------------------------- | ---- | ----- |
| osVersion | string | Yes | System version number.|
| deviceName | string | Yes | Device name. |
| versionComponents | Array\<[VersionComponent](#vesioncomponent)> | No | Version components. |
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | No | Version components. |
## DownloadOptions
......@@ -1440,9 +1440,9 @@ Represents download options.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| allowNetwork | [NetType](#nettype) | Yes | Network type. |
| order | [Order](#order) | Yes | Update command. |
| ------------ | ------------------- | ---- | ---- |
| allowNetwork | [NetType](#nettype) | Yes | Network type.|
| order | [Order](#order) | Yes | Update command.|
## ResumeDownloadOptions
......@@ -1450,9 +1450,9 @@ Represents options for resuming download.
**System capability**: SystemCapability.Update.UpdateService
| Parameter | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| allowNetwork | [NetType](#nettype) | Yes | Network type. |
| Name | Type | Mandatory | Description |
| ------------ | ------------------- | ---- | ---- |
| allowNetwork | [NetType](#nettype) | Yes | Network type.|
## PauseDownloadOptions
......@@ -1460,9 +1460,9 @@ Represents options for pausing download.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| isAllowAutoResume | bool | Yes | Whether to allow automatic resuming of download. |
| Name | Type| Mandatory | Description |
| ----------------- | ---- | ---- | -------- |
| isAllowAutoResume | bool | Yes | Whether to allow automatic resuming of download.|
## UpgradeOptions
......@@ -1471,8 +1471,8 @@ Represents update options.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| order | [Order](#order) | Yes | Update command. |
| ----- | --------------- | ---- | ---- |
| order | [Order](#order) | Yes | Update command.|
## ClearOptions
......@@ -1481,8 +1481,8 @@ Represents options for clearing errors.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| status | [UpgradeStatus](#upgradestatus) | Yes | Error status. |
| ------ | ------------------------------- | ---- | ---- |
| status | [UpgradeStatus](#upgradestatus) | Yes | Error status.|
## UpgradePolicy
......@@ -1491,7 +1491,7 @@ Represents an update policy.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| ------------------- | --------------------------------------- | ---- | ------- |
| downloadStrategy | bool | Yes | Automatic download policy. |
| autoUpgradeStrategy | bool | Yes | Automatic update policy. |
| autoUpgradePeriods | Array\<[UpgradePeriod](#upgradeperiod)> | Yes | Automatic update period.|
......@@ -1503,9 +1503,9 @@ Represents a period for automatic update.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| start | number | Yes | Start time. |
| end | number | Yes | End time. |
| ----- | ------ | ---- | ---- |
| start | number | Yes | Start time.|
| end | number | Yes | End time.|
## TaskInfo
......@@ -1514,20 +1514,20 @@ Represents task information.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| existTask | bool | Yes | Whether a task exists. |
| --------- | --------------------- | ---- | ------ |
| existTask | bool | Yes | Whether a task exists.|
| taskBody | [TaskBody](#taskinfo) | Yes | Task data. |
## EventInfo
Represents event information.
Represents event type information.
**System capability**: SystemCapability.Update.UpdateService
| Parameter | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| eventId | [EventId](#eventid) | Yes | Event ID. |
| taskBody | [TaskBody](#taskinfo) | Yes | Task data. |
| Name | Type | Mandatory | Description |
| -------- | --------------------- | ---- | ---- |
| eventId | [EventId](#eventid) | Yes | Event ID.|
| taskBody | [TaskBody](#taskinfo) | Yes | Task data.|
## TaskBody
......@@ -1536,14 +1536,14 @@ Represents task data.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information. |
| status | [UpgradeStatus](#upgradestatus) | Yes | Update status. |
| ----------------- | ---------------------------------------- | ---- | ---- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | Yes | Version digest information.|
| status | [UpgradeStatus](#upgradestatus) | Yes | Update status.|
| subStatus | number | No | Sub-status. |
| progress | number | Yes | Progress. |
| installMode | number | Yes | Installation mode. |
| errorMessages | Array\<[ErrorMessage](#errormessage)> | No | Error message. |
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components. |
| installMode | number | Yes | Installation mode.|
| errorMessages | Array\<[ErrorMessage](#errormessage)> | No | Error message.|
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | Yes | Version components.|
## ErrorMessage
......@@ -1552,9 +1552,9 @@ Represents an error message.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| ------------ | ------ | ---- | ---- |
| errorCode | number | Yes | Error code. |
| errorMessage | string | Yes | Error description. |
| errorMessage | string | Yes | Error description.|
## EventClassifyInfo
......@@ -1563,9 +1563,9 @@ Represents event type information.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| eventClassify | [EventClassify](#eventclassify) | Yes | Event type. |
| extraInfo | string | Yes | Additional information. |
| ------------- | ------------------------------- | ---- | ---- |
| eventClassify | [EventClassify](#eventclassify) | Yes | Event type.|
| extraInfo | string | Yes | Additional information.|
## UpgradeFile
......@@ -1574,20 +1574,20 @@ Represents an update file.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| fileType | [ComponentType](#componenttype) | Yes | File type. |
| filePath | string | Yes | File path. |
| -------- | ------------------------------- | ---- | ---- |
| fileType | [ComponentType](#componenttype) | Yes | File type.|
| filePath | string | Yes | File path.|
## UpgradeTaskCallback
### (eventInfo: [EventInfo](#eventinfo)): void
Event callback.
Represents an event callback.
**System capability**: SystemCapability.Update.UpdateService
| Parameter | Type | Mandatory | Description |
| --------------- | ---------------------------------------- | ---- | ---- |
| Name | Type | Mandatory | Description |
| --------- | ----------------------- | ---- | ---- |
| eventInfo | [EventInfo](#eventinfo) | Yes | Event information.|
## BusinessVendor
......@@ -1597,7 +1597,7 @@ Device vendor.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ------ | -------- | ---- |
| PUBLIC | "public" | Open source. |
## BusinessSubType
......@@ -1607,7 +1607,7 @@ Represents an update type.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| -------- | ---- | ---- |
| FIRMWARE | 1 | Firmware. |
## ComponentType
......@@ -1617,7 +1617,7 @@ Represents a component type.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ---- | ---- | ---- |
| OTA | 1 | Firmware. |
## UpgradeAction
......@@ -1627,7 +1627,7 @@ Represents an update mode.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| -------- | ---------- | ---- |
| UPGRADE | "upgrade" | Differential package. |
| RECOVERY | "recovery" | Recovery package. |
......@@ -1638,10 +1638,10 @@ Represents an effective mode.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ------------- | ---- | ---- |
| COLD | 1 | Cold update. |
| LIVE | 2 | Live update. |
| LIVE_AND_COLD | 3 | Hybrid live and cold update. |
| LIVE_AND_COLD | 3 | Hybrid live and cold update.|
## DescriptionType
......@@ -1650,7 +1650,7 @@ Represents a description file type.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ------- | ---- | ---- |
| CONTENT | 0 | Content. |
| URI | 1 | Link. |
......@@ -1661,9 +1661,9 @@ Represents a description file format.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| STANDARD | 0 | Standard format. |
| SIMPLIFIED | 1 | Simple format. |
| ---------- | ---- | ---- |
| STANDARD | 0 | Standard format.|
| SIMPLIFIED | 1 | Simple format.|
## NetType
......@@ -1672,12 +1672,12 @@ Enumerates network types.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ----------------- | ---- | --------- |
| CELLULAR | 1 | Data network. |
| METERED_WIFI | 2 | Wi-Fi hotspot. |
| NOT_METERED_WIFI | 4 | Non Wi-Fi hotspot. |
| WIFI | 6 | WIFI |
| CELLULAR_AND_WIFI | 7 | Data network and Wi-Fi. |
| WIFI | 6 | Wi-Fi. |
| CELLULAR_AND_WIFI | 7 | Data network and Wi-Fi.|
## Order
......@@ -1686,12 +1686,12 @@ Represents an update command.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| -------------------- | ---- | ----- |
| DOWNLOAD | 1 | Download. |
| INSTALL | 2 | Install. |
| DOWNLOAD_AND_INSTALL | 3 | Download and install. |
| DOWNLOAD_AND_INSTALL | 3 | Download and install.|
| APPLY | 4 | Apply. |
| INSTALL_AND_APPLY | 6 | Install and apply. |
| INSTALL_AND_APPLY | 6 | Install and apply.|
## UpgradeStatus
......@@ -1700,17 +1700,17 @@ Enumerates update states.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ---------------- | ---- | ---- |
| WAITING_DOWNLOAD | 20 | Waiting for download. |
| DOWNLOADING | 21 | Downloading. |
| DOWNLOAD_PAUSED | 22 | Download paused. |
| DOWNLOAD_FAIL | 23 | Download failed. |
| DOWNLOAD_PAUSED | 22 | Download paused.|
| DOWNLOAD_FAIL | 23 | Download failed.|
| WAITING_INSTALL | 30 | Waiting for installation. |
| UPDATING | 31 | Updating. |
| WAITING_APPLY | 40 | Waiting for applying the update. |
| APPLYING | 21 | Applying the update. |
| UPGRADE_SUCCESS | 50 | Update succeeded. |
| UPGRADE_FAIL | 51 | Update failed. |
| UPGRADE_SUCCESS | 50 | Update succeeded.|
| UPGRADE_FAIL | 51 | Update failed.|
## EventClassify
......@@ -1719,8 +1719,8 @@ Represents an event type.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| TASK | 0x01000000 | Task event. |
| ---- | ---------- | ---- |
| TASK | 0x01000000 | Task event.|
## EventId
......@@ -1729,13 +1729,13 @@ Enumerates event IDs.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ---------------------- | ---------- | ------ |
| EVENT_TASK_BASE | 0x01000000 | Indicates a task event. |
| EVENT_TASK_RECEIVE | 0x01000001 | Indicates that a task is received. |
| EVENT_TASK_CANCEL | 0x01000010 | Indicates that a task is cancelled. |
| EVENT_DOWNLOAD_WAIT | 0x01000011 | Indicates the state of waiting for the download. |
| 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_RESUME | 0x01000111 | Indicates that the download is resumed. |
| 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.
先完成此消息的编辑!
想要评论请 注册