提交 704a8ca8 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 e11ce5f9
...@@ -41,7 +41,7 @@ Obtains an **OnlineUpdater** object. ...@@ -41,7 +41,7 @@ Obtains an **OnlineUpdater** object.
**Example** **Example**
``` ```js
try { try {
var upgradeInfo = { var upgradeInfo = {
upgradeApp: "com.ohos.ota.updateclient", upgradeApp: "com.ohos.ota.updateclient",
...@@ -73,7 +73,7 @@ Obtains a **Restorer** object for restoring factory settings. ...@@ -73,7 +73,7 @@ Obtains a **Restorer** object for restoring factory settings.
**Example** **Example**
``` ```js
try { try {
let restorer = update.getRestorer(); let restorer = update.getRestorer();
} catch(error) { } catch(error) {
...@@ -97,7 +97,7 @@ Obtains a **LocalUpdater** object. ...@@ -97,7 +97,7 @@ Obtains a **LocalUpdater** object.
**Example** **Example**
``` ```js
try { try {
let localUpdater = update.getLocalUpdater(); let localUpdater = update.getLocalUpdater();
} catch(error) { } catch(error) {
...@@ -125,7 +125,7 @@ Checks whether a new version is available. This API uses an asynchronous callbac ...@@ -125,7 +125,7 @@ Checks whether a new version is available. This API uses an asynchronous callbac
**Example** **Example**
``` ```js
updater.checkNewVersion((err, result) => { updater.checkNewVersion((err, result) => {
console.log(`checkNewVersion isExistNewVersion ${result?.isExistNewVersion}`); console.log(`checkNewVersion isExistNewVersion ${result?.isExistNewVersion}`);
}); });
...@@ -149,7 +149,7 @@ Checks whether a new version is available. This API uses a promise to return the ...@@ -149,7 +149,7 @@ Checks whether a new version is available. This API uses a promise to return the
**Example** **Example**
``` ```js
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
...@@ -177,7 +177,7 @@ Obtains information about the new version. This API uses an asynchronous callbac ...@@ -177,7 +177,7 @@ Obtains information about the new version. This API uses an asynchronous callbac
**Example** **Example**
``` ```js
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}`);
...@@ -202,7 +202,7 @@ Obtains information about the new version. This API uses a promise to return the ...@@ -202,7 +202,7 @@ Obtains information about the new version. This API uses a promise to return the
**Example** **Example**
``` ```js
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}`);
...@@ -231,7 +231,7 @@ Obtains the description file of the new version. This API uses an asynchronous c ...@@ -231,7 +231,7 @@ Obtains the description file of the new version. This API uses an asynchronous c
**Example** **Example**
``` ```js
// 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
...@@ -274,7 +274,7 @@ Obtains the description file of the new version. This API uses a promise to retu ...@@ -274,7 +274,7 @@ Obtains the description file of the new version. This API uses a promise to retu
**Example** **Example**
``` ```js
// 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
...@@ -311,7 +311,7 @@ Obtains information about the current version. This API uses an asynchronous cal ...@@ -311,7 +311,7 @@ Obtains information about the current version. This API uses an asynchronous cal
**Example** **Example**
``` ```js
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}`);
...@@ -337,7 +337,7 @@ Obtains information about the current version. This API uses a promise to return ...@@ -337,7 +337,7 @@ Obtains information about the current version. This API uses a promise to return
**Example** **Example**
``` ```js
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}`);
...@@ -366,7 +366,7 @@ Obtains the description file of the current version. This API uses an asynchrono ...@@ -366,7 +366,7 @@ Obtains the description file of the current version. This API uses an asynchrono
**Example** **Example**
``` ```js
// Options of the description file // Options of the description file
var descriptionOptions = { var descriptionOptions = {
format: DescriptionFormat.STANDARD, // Standard format format: DescriptionFormat.STANDARD, // Standard format
...@@ -403,7 +403,7 @@ Obtains the description file of the current version. This API uses a promise to ...@@ -403,7 +403,7 @@ Obtains the description file of the current version. This API uses a promise to
**Example** **Example**
``` ```js
// Options of the description file // Options of the description file
var descriptionOptions = { var descriptionOptions = {
format: DescriptionFormat.STANDARD, // Standard format format: DescriptionFormat.STANDARD, // Standard format
...@@ -435,7 +435,7 @@ Obtains information about the update task. This API uses an asynchronous callbac ...@@ -435,7 +435,7 @@ Obtains information about the update task. This API uses an asynchronous callbac
**Example** **Example**
``` ```js
updater.getTaskInfo((err, info) => { updater.getTaskInfo((err, info) => {
console.log(`getTaskInfo isexistTask= ${info?.existTask}`); console.log(`getTaskInfo isexistTask= ${info?.existTask}`);
}); });
...@@ -459,7 +459,7 @@ Obtains information about the update task. This API uses a promise to return the ...@@ -459,7 +459,7 @@ Obtains information about the update task. This API uses a promise to return the
**Example** **Example**
``` ```js
updater.getTaskInfo().then(info => { updater.getTaskInfo().then(info => {
console.log(`getTaskInfo isexistTask= ${info.existTask}`); console.log(`getTaskInfo isexistTask= ${info.existTask}`);
}).catch(err => { }).catch(err => {
...@@ -487,7 +487,7 @@ Downloads the new version. This API uses an asynchronous callback to return the ...@@ -487,7 +487,7 @@ Downloads the new version. This API uses an asynchronous callback to return the
**Example** **Example**
``` ```js
// 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
...@@ -528,7 +528,7 @@ Downloads the new version. This API uses a promise to return the result. ...@@ -528,7 +528,7 @@ Downloads the new version. This API uses a promise to return the result.
**Example** **Example**
``` ```js
// 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
...@@ -566,7 +566,7 @@ Resumes download of the new version. This API uses an asynchronous callback to r ...@@ -566,7 +566,7 @@ Resumes download of the new version. This API uses an asynchronous callback to r
**Example** **Example**
``` ```js
// 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
...@@ -606,7 +606,7 @@ Resumes download of the new version. This API uses a promise to return the resul ...@@ -606,7 +606,7 @@ Resumes download of the new version. This API uses a promise to return the resul
**Example** **Example**
``` ```js
// 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
...@@ -643,7 +643,7 @@ Pauses download of the new version. This API uses an asynchronous callback to re ...@@ -643,7 +643,7 @@ Pauses download of the new version. This API uses an asynchronous callback to re
**Example** **Example**
``` ```js
// 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
...@@ -683,7 +683,7 @@ Resumes download of the new version. This API uses a promise to return the resul ...@@ -683,7 +683,7 @@ Resumes download of the new version. This API uses a promise to return the resul
**Example** **Example**
``` ```js
// 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
...@@ -720,7 +720,7 @@ Updates the version. This API uses an asynchronous callback to return the result ...@@ -720,7 +720,7 @@ Updates the version. This API uses an asynchronous callback to return the result
**Example** **Example**
``` ```js
// 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
...@@ -760,7 +760,7 @@ Updates the version. This API uses a promise to return the result. ...@@ -760,7 +760,7 @@ Updates the version. This API uses a promise to return the result.
**Example** **Example**
``` ```js
// 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
...@@ -797,7 +797,7 @@ Clears errors. This API uses an asynchronous callback to return the result. ...@@ -797,7 +797,7 @@ Clears errors. This API uses an asynchronous callback to return the result.
**Example** **Example**
``` ```js
// 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
...@@ -837,7 +837,7 @@ Clears errors. This API uses a promise to return the result. ...@@ -837,7 +837,7 @@ Clears errors. This API uses a promise to return the result.
**Example** **Example**
``` ```js
// 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
...@@ -872,7 +872,7 @@ Obtains the update policy. This API uses an asynchronous callback to return the ...@@ -872,7 +872,7 @@ Obtains the update policy. This API uses an asynchronous callback to return the
**Example** **Example**
``` ```js
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}`);
...@@ -897,7 +897,7 @@ Obtains the update policy. This API uses a promise to return the result. ...@@ -897,7 +897,7 @@ Obtains the update policy. This API uses a promise to return the result.
**Example** **Example**
``` ```js
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}`);
...@@ -925,7 +925,7 @@ Sets the update policy. This API uses an asynchronous callback to return the res ...@@ -925,7 +925,7 @@ Sets the update policy. This API uses an asynchronous callback to return the res
**Example** **Example**
``` ```js
let policy = { let policy = {
downloadStrategy: false, downloadStrategy: false,
autoUpgradeStrategy: false, autoUpgradeStrategy: false,
...@@ -960,7 +960,7 @@ Sets the update policy. This API uses a promise to return the result. ...@@ -960,7 +960,7 @@ Sets the update policy. This API uses a promise to return the result.
**Example** **Example**
``` ```js
let policy = { let policy = {
downloadStrategy: false, downloadStrategy: false,
autoUpgradeStrategy: false, autoUpgradeStrategy: false,
...@@ -991,7 +991,7 @@ Terminates the update. This API uses an asynchronous callback to return the resu ...@@ -991,7 +991,7 @@ Terminates the update. This API uses an asynchronous callback to return the resu
**Example** **Example**
``` ```js
updater.terminateUpgrade((err) => { updater.terminateUpgrade((err) => {
console.log(`terminateUpgrade error ${JSON.stringify(err)}`); console.log(`terminateUpgrade error ${JSON.stringify(err)}`);
}); });
...@@ -1015,7 +1015,7 @@ Terminates the update. This API uses a promise to return the result. ...@@ -1015,7 +1015,7 @@ Terminates the update. This API uses a promise to return the result.
**Example** **Example**
``` ```js
updater.terminateUpgrade().then(() => { updater.terminateUpgrade().then(() => {
console.log(`terminateUpgrade success`); console.log(`terminateUpgrade success`);
}).catch(err => { }).catch(err => {
...@@ -1040,7 +1040,7 @@ Enables listening for update events. This API uses an asynchronous callback to r ...@@ -1040,7 +1040,7 @@ Enables listening for update events. This API uses an asynchronous callback to r
**Example** **Example**
``` ```js
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1067,7 +1067,7 @@ Disables listening for update events. This API uses an asynchronous callback to ...@@ -1067,7 +1067,7 @@ Disables listening for update events. This API uses an asynchronous callback to
**Example** **Example**
``` ```js
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1098,7 +1098,7 @@ Restores factory settings. This API uses an asynchronous callback to return the ...@@ -1098,7 +1098,7 @@ Restores factory settings. This API uses an asynchronous callback to return the
**Example** **Example**
``` ```js
restorer.factoryReset((err) => { restorer.factoryReset((err) => {
console.log(`factoryReset error ${JSON.stringify(err)}`); console.log(`factoryReset error ${JSON.stringify(err)}`);
}); });
...@@ -1122,7 +1122,7 @@ Restores factory settings. This API uses a promise to return the result. ...@@ -1122,7 +1122,7 @@ Restores factory settings. This API uses a promise to return the result.
**Example** **Example**
``` ```js
restorer.factoryReset().then(() => { restorer.factoryReset().then(() => {
console.log(`factoryReset success`); console.log(`factoryReset success`);
}).catch(err => { }).catch(err => {
...@@ -1152,7 +1152,7 @@ Verifies the update package. This API uses an asynchronous callback to return th ...@@ -1152,7 +1152,7 @@ Verifies the update package. This API uses an asynchronous callback to return th
**Example** **Example**
``` ```js
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
...@@ -1188,7 +1188,7 @@ Verifies the update package. This API uses a promise to return the result. ...@@ -1188,7 +1188,7 @@ Verifies the update package. This API uses a promise to return the result.
**Example** **Example**
``` ```js
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
...@@ -1218,7 +1218,7 @@ Installs the update package. This API uses an asynchronous callback to return th ...@@ -1218,7 +1218,7 @@ Installs the update package. This API uses an asynchronous callback to return th
**Example** **Example**
``` ```js
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
...@@ -1247,7 +1247,7 @@ Installs the update package. This API uses a promise to return the result. ...@@ -1247,7 +1247,7 @@ Installs the update package. This API uses a promise to return the result.
**Example** **Example**
``` ```js
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
...@@ -1275,7 +1275,7 @@ Enables listening for update events. This API uses an asynchronous callback to r ...@@ -1275,7 +1275,7 @@ Enables listening for update events. This API uses an asynchronous callback to r
**Example** **Example**
``` ```js
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
...@@ -1304,7 +1304,7 @@ Disables listening for update events. This API uses an asynchronous callback to ...@@ -1304,7 +1304,7 @@ Disables listening for update events. This API uses an asynchronous callback to
**Example** **Example**
``` ```js
var eventClassifyInfo = { var eventClassifyInfo = {
eventClassify: update.EventClassify.TASK, // Listening for update events eventClassify: update.EventClassify.TASK, // Listening for update events
extraInfo: "" extraInfo: ""
......
...@@ -23,13 +23,14 @@ Use HiSysEvent logging to flush logged event data to disks. ...@@ -23,13 +23,14 @@ Use HiSysEvent logging to flush logged event data to disks.
HiSysEvent logging is implemented using the API provided by the **HiSysEvent** class. For details, see the API Reference. HiSysEvent logging is implemented using the API provided by the **HiSysEvent** class. For details, see the API Reference.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In OpenHarmony-3.2-Beta3, HiSysEvent logging is open for restricted use to avoid event storms. The **HiSysEvent::Write** API in Table 1 is replaced by the **HiSysEventWrite** API in Table 2. The **HiSysEvent::Write** API has been deprecated. Use the **HiSysEventWrite** API instead for HiSysEvent logging. > In OpenHarmony-3.2-Beta3, HiSysEvent logging is open for restricted use to avoid event storms. The **HiSysEvent::Write** API in Table 1 is replaced by the **HiSysEventWrite** API in Table 2. The **HiSysEvent::Write** API has been deprecated. Use the **HiSysEventWrite** API instead for HiSysEvent logging.
**Table 1** C++ event logging API (deprecated) **Table 1** C++ event logging API (deprecated)
| API | Description | | API | Description |
| ------------------------------------------------------------ | ---------------------- | | ------------------------------------------------------------ | ---------------------- |
| template&lt;typename...&nbsp;Types&gt;&nbsp;<br>static&nbsp;int&nbsp;Write(const&nbsp;std::string&nbsp;&amp;domain,&nbsp;const&nbsp;std::string&nbsp;&amp;eventName,&nbsp;EventType&nbsp;type,&nbsp;Types...&nbsp;keyValues) | Flushes logged event data to disks.| | template&lt;typename... Types&gt; <br>static int Write(const std::string &amp;domain, const std::string &amp;eventName, EventType type, Types... keyValues) | Flushes logged event data to disks.|
**Table 2** C++ event logging API (in use) **Table 2** C++ event logging API (in use)
| API | Description | | API | Description |
...@@ -49,7 +50,7 @@ HiSysEvent logging is implemented using the API provided by the **HiSysEvent** c ...@@ -49,7 +50,7 @@ HiSysEvent logging is implemented using the API provided by the **HiSysEvent** c
The following table describes the kernel event logging APIs. The following table describes the kernel event logging APIs.
**Table 4** Description of kernel event logging APIs **Table 4** Kernel event logging APIs
| API | Description | | API | Description |
| ------------------------------------------------------------ | ------------------------------------ | | ------------------------------------------------------------ | ------------------------------------ |
......
...@@ -15,7 +15,7 @@ If OpenHarmony devices and applications need to be used globally, they must meet ...@@ -15,7 +15,7 @@ If OpenHarmony devices and applications need to be used globally, they must meet
## Architecture<a name="section1558604311012"></a> ## Architecture<a name="section1558604311012"></a>
**Figure 1** Architecture of the globalization subsystem<a name="fig1687592425010"></a> **Figure 1** Architecture of the globalization subsystem<a name="fig1687592425010"></a>
![](figures/architecture-of-the-globalization-subsystem.png "architecture-of-the-globalization-subsystem") ![](figures/architecture-of-the-globalization-subsystem.png "architecture-of-the-globalization-subsystem")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册