未验证 提交 9f0152d0 编写于 作者: O openharmony_ci 提交者: Gitee

!8221 翻译已完成7286+7315+7338+7480

Merge pull request !8221 from shawn_he/7286-a
...@@ -35,7 +35,7 @@ Obtains the localized script for the specified language. ...@@ -35,7 +35,7 @@ Obtains the localized script for the specified language.
| string | Localized script for the specified language.| | string | Localized script for the specified language.|
**Example** **Example**
``` ```js
i18n.getDisplayLanguage("zh", "en-GB", true); i18n.getDisplayLanguage("zh", "en-GB", true);
i18n.getDisplayLanguage("zh", "en-GB"); i18n.getDisplayLanguage("zh", "en-GB");
``` ```
...@@ -62,7 +62,7 @@ Obtains the localized script for the specified country. ...@@ -62,7 +62,7 @@ Obtains the localized script for the specified country.
| string | Localized script for the specified country.| | string | Localized script for the specified country.|
**Example** **Example**
``` ```js
i18n.getDisplayCountry("zh-CN", "en-GB", true); i18n.getDisplayCountry("zh-CN", "en-GB", true);
i18n.getDisplayCountry("zh-CN", "en-GB"); i18n.getDisplayCountry("zh-CN", "en-GB");
``` ```
...@@ -87,7 +87,7 @@ Checks whether the localized script for the specified language is displayed from ...@@ -87,7 +87,7 @@ Checks whether the localized script for the specified language is displayed from
| boolean | Returns **true** if the localized script is displayed from right to left; returns **false** otherwise.| | boolean | Returns **true** if the localized script is displayed from right to left; returns **false** otherwise.|
**Example** **Example**
``` ```js
i18n.isRTL("zh-CN");// Since Chinese is not written from right to left, false is returned. i18n.isRTL("zh-CN");// Since Chinese is not written from right to left, false is returned.
i18n.isRTL("ar-EG");// Since Arabic is written from right to left, true is returned. i18n.isRTL("ar-EG");// Since Arabic is written from right to left, true is returned.
``` ```
...@@ -107,7 +107,7 @@ Obtains the system language. ...@@ -107,7 +107,7 @@ Obtains the system language.
| string | System language ID.| | string | System language ID.|
**Example** **Example**
``` ```js
i18n.getSystemLanguage(); i18n.getSystemLanguage();
``` ```
...@@ -135,7 +135,7 @@ This is a system API. ...@@ -135,7 +135,7 @@ This is a system API.
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
``` ```js
i18n.setSystemLanguage('zh'); i18n.setSystemLanguage('zh');
``` ```
...@@ -156,7 +156,7 @@ Obtains the list of system languages. ...@@ -156,7 +156,7 @@ Obtains the list of system languages.
| Array<string> | List of the IDs of system languages.| | Array<string> | List of the IDs of system languages.|
**Example** **Example**
``` ```js
i18n.getSystemLanguages(); i18n.getSystemLanguages();
``` ```
...@@ -182,7 +182,7 @@ Obtains the list of countries and regions supported for the specified language. ...@@ -182,7 +182,7 @@ Obtains the list of countries and regions supported for the specified language.
| Array<string> | List of the IDs of the countries and regions supported for the specified language.| | Array<string> | List of the IDs of the countries and regions supported for the specified language.|
**Example** **Example**
``` ```js
i18n.getSystemCountries('zh'); i18n.getSystemCountries('zh');
``` ```
...@@ -201,7 +201,7 @@ Obtains the system region. ...@@ -201,7 +201,7 @@ Obtains the system region.
| string | System region ID.| | string | System region ID.|
**Example** **Example**
``` ```js
i18n.getSystemRegion(); i18n.getSystemRegion();
``` ```
...@@ -229,7 +229,7 @@ This is a system API. ...@@ -229,7 +229,7 @@ This is a system API.
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
``` ```js
i18n.setSystemRegion('CN'); i18n.setSystemRegion('CN');
``` ```
...@@ -248,7 +248,7 @@ Obtains the system locale. ...@@ -248,7 +248,7 @@ Obtains the system locale.
| string | System locale ID.| | string | System locale ID.|
**Example** **Example**
``` ```js
i18n.getSystemLocale(); i18n.getSystemLocale();
``` ```
...@@ -276,7 +276,7 @@ This is a system API. ...@@ -276,7 +276,7 @@ This is a system API.
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
``` ```js
i18n.setSystemLocale('zh-CN'); i18n.setSystemLocale('zh-CN');
``` ```
...@@ -303,7 +303,7 @@ Checks whether the system language matches the specified region. ...@@ -303,7 +303,7 @@ Checks whether the system language matches the specified region.
| boolean | Returns **true** if the system language matches the specified region; returns **false** otherwise.| | boolean | Returns **true** if the system language matches the specified region; returns **false** otherwise.|
**Example** **Example**
``` ```js
i18n.isSuggested('zh', 'CN'); i18n.isSuggested('zh', 'CN');
``` ```
...@@ -328,7 +328,7 @@ Obtains a **Calendar** object. ...@@ -328,7 +328,7 @@ Obtains a **Calendar** object.
| [Calendar](#calendar8) | **Calendar** object.| | [Calendar](#calendar8) | **Calendar** object.|
**Example** **Example**
``` ```js
i18n.getCalendar("zh-Hans", "gregory"); i18n.getCalendar("zh-Hans", "gregory");
``` ```
...@@ -350,7 +350,7 @@ Sets the date for this **Calendar** object. ...@@ -350,7 +350,7 @@ Sets the date for this **Calendar** object.
| date | Date | Yes | Date to be set for the **Calendar** object.| | date | Date | Yes | Date to be set for the **Calendar** object.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("en-US", "gregory"); var calendar = i18n.getCalendar("en-US", "gregory");
var date = new Date(2021, 10, 7, 8, 0, 0, 0); var date = new Date(2021, 10, 7, 8, 0, 0, 0);
calendar.setTime(date); calendar.setTime(date);
...@@ -371,7 +371,7 @@ Sets the date and time for this **Calendar** object. The value is represented by ...@@ -371,7 +371,7 @@ Sets the date and time for this **Calendar** object. The value is represented by
| time | number | Yes | Number of milliseconds that have elapsed since the Unix epoch.| | time | number | Yes | Number of milliseconds that have elapsed since the Unix epoch.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("en-US", "gregory"); var calendar = i18n.getCalendar("en-US", "gregory");
calendar.setTime(10540800000); calendar.setTime(10540800000);
``` ```
...@@ -396,7 +396,7 @@ Sets the year, month, day, hour, minute, and second for this **Calendar** object ...@@ -396,7 +396,7 @@ Sets the year, month, day, hour, minute, and second for this **Calendar** object
| second | number | No | Second to set. | | second | number | No | Second to set. |
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.set(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00 calendar.set(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00
``` ```
...@@ -416,7 +416,7 @@ Sets the time zone of this **Calendar** object. ...@@ -416,7 +416,7 @@ Sets the time zone of this **Calendar** object.
| timezone | string | Yes | Time zone, for example, **Asia/Shanghai**.| | timezone | string | Yes | Time zone, for example, **Asia/Shanghai**.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.setTimeZone("Asia/Shanghai"); calendar.setTimeZone("Asia/Shanghai");
``` ```
...@@ -436,7 +436,7 @@ Obtains the time zone of this **Calendar** object. ...@@ -436,7 +436,7 @@ Obtains the time zone of this **Calendar** object.
| string | Time zone of the **Calendar** object.| | string | Time zone of the **Calendar** object.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.setTimeZone("Asia/Shanghai"); calendar.setTimeZone("Asia/Shanghai");
calendar.getTimeZone(); // Asia/Shanghai" calendar.getTimeZone(); // Asia/Shanghai"
...@@ -457,7 +457,7 @@ Obtains the start day of a week for this **Calendar** object. ...@@ -457,7 +457,7 @@ Obtains the start day of a week for this **Calendar** object.
| number | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.| | number | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("en-US", "gregory"); var calendar = i18n.getCalendar("en-US", "gregory");
calendar.getFirstDayOfWeek(); calendar.getFirstDayOfWeek();
``` ```
...@@ -477,7 +477,7 @@ Sets the start day of a week for this **Calendar** object. ...@@ -477,7 +477,7 @@ Sets the start day of a week for this **Calendar** object.
| value | number | No | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.| | value | number | No | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.setFirstDayOfWeek(0); calendar.setFirstDayOfWeek(0);
``` ```
...@@ -497,7 +497,7 @@ Obtains the minimum number of days in the first week of a year. ...@@ -497,7 +497,7 @@ Obtains the minimum number of days in the first week of a year.
| number | Minimum number of days in the first week of a year.| | number | Minimum number of days in the first week of a year.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.getMinimalDaysInFirstWeek(); calendar.getMinimalDaysInFirstWeek();
``` ```
...@@ -517,7 +517,7 @@ Sets the minimum number of days in the first week of a year. ...@@ -517,7 +517,7 @@ Sets the minimum number of days in the first week of a year.
| value | number | No | Minimum number of days in the first week of a year.| | value | number | No | Minimum number of days in the first week of a year.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.setMinimalDaysInFirstWeek(3); calendar.setMinimalDaysInFirstWeek(3);
``` ```
...@@ -542,7 +542,7 @@ Obtains the value of the specified field in the **Calendar** object. ...@@ -542,7 +542,7 @@ Obtains the value of the specified field in the **Calendar** object.
| number | Value of the specified field. For example, if the year in the internal date of this **Calendar** object is **1990**, the **get("year")** function will return **1990**.| | number | Value of the specified field. For example, if the year in the internal date of this **Calendar** object is **1990**, the **get("year")** function will return **1990**.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.set(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00 calendar.set(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00
calendar.get("hour_of_day"); // 8 calendar.get("hour_of_day"); // 8
...@@ -568,7 +568,7 @@ Obtains the name of the **Calendar** object displayed for the specified locale. ...@@ -568,7 +568,7 @@ Obtains the name of the **Calendar** object displayed for the specified locale.
| string | Name of the **Calendar** object displayed for the specified locale.| | string | Name of the **Calendar** object displayed for the specified locale.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("en-US", "buddhist"); var calendar = i18n.getCalendar("en-US", "buddhist");
calendar.getDisplayName("zh"); // Obtain the name of the Buddhist calendar in zh. calendar.getDisplayName("zh"); // Obtain the name of the Buddhist calendar in zh.
``` ```
...@@ -593,7 +593,7 @@ Checks whether the specified date in this **Calendar** object is a weekend. ...@@ -593,7 +593,7 @@ Checks whether the specified date in this **Calendar** object is a weekend.
| boolean | Returns **true** if the date is a weekend; returns **false** if the date is a weekday.| | boolean | Returns **true** if the date is a weekend; returns **false** if the date is a weekday.|
**Example** **Example**
``` ```js
var calendar = i18n.getCalendar("zh-Hans"); var calendar = i18n.getCalendar("zh-Hans");
calendar.set(2021, 11, 11, 8, 0, 0); // set time to 2021.11.11 08:00:00 calendar.set(2021, 11, 11, 8, 0, 0); // set time to 2021.11.11 08:00:00
calendar.isWeekend(); // false calendar.isWeekend(); // false
...@@ -620,7 +620,7 @@ Parameters ...@@ -620,7 +620,7 @@ Parameters
| options | [PhoneNumberFormatOptions](#phonenumberformatoptions8) | No | Options of the **PhoneNumberFormat** object. | | options | [PhoneNumberFormatOptions](#phonenumberformatoptions8) | No | Options of the **PhoneNumberFormat** object. |
**Example** **Example**
``` ```js
var phoneNumberFormat= new i18n.PhoneNumberFormat("CN", {"type": "E164"}); var phoneNumberFormat= new i18n.PhoneNumberFormat("CN", {"type": "E164"});
``` ```
...@@ -644,7 +644,7 @@ Checks whether the format of the specified phone number is valid. ...@@ -644,7 +644,7 @@ Checks whether the format of the specified phone number is valid.
| boolean | Returns **true** if the phone number format is valid; returns **false** otherwise.| | boolean | Returns **true** if the phone number format is valid; returns **false** otherwise.|
**Example** **Example**
``` ```js
var phonenumberfmt = new i18n.PhoneNumberFormat("CN"); var phonenumberfmt = new i18n.PhoneNumberFormat("CN");
phonenumberfmt.isValidNumber("15812312312"); phonenumberfmt.isValidNumber("15812312312");
``` ```
...@@ -669,9 +669,9 @@ Formats a phone number. ...@@ -669,9 +669,9 @@ Formats a phone number.
| string | Formatted phone number.| | string | Formatted phone number.|
**Example** **Example**
``` ```js
var phonenumberfmt = new i18n.PhoneNumberFormat("CN"); var phonenumberfmt = new i18n.PhoneNumberFormat("CN");
phonenumberfmt.format("15812312312"); phonenumberfmt.isValidNumber("15812312312");
``` ```
### getLocationName<sup>9+</sup> ### getLocationName<sup>9+</sup>
...@@ -694,11 +694,10 @@ Obtains the home location of a phone number. ...@@ -694,11 +694,10 @@ Obtains the home location of a phone number.
| string | Home location of the phone number.| | string | Home location of the phone number.|
**Example** **Example**
```js
var phonenumberfmt = new i18n.PhoneNumberFormat("CN");
phonenumberfmt.isValidNumber("15812312312");
``` ```
var location = i18n.PhoneNumberFormat.getLocationName('15812312345', 'zh-CN');
```
## PhoneNumberFormatOptions<sup>8+</sup> ## PhoneNumberFormatOptions<sup>8+</sup>
...@@ -750,7 +749,7 @@ Converts one measurement unit into another and formats the unit based on the spe ...@@ -750,7 +749,7 @@ Converts one measurement unit into another and formats the unit based on the spe
| string | Character string obtained after formatting based on the measurement unit specified by **toUnit**.| | string | Character string obtained after formatting based on the measurement unit specified by **toUnit**.|
**Example** **Example**
``` ```js
i18n.Util.unitConvert({unit: "cup", measureSystem: "US"}, {unit: "liter", measureSystem: "SI"}, 1000, "en-US", "long"); i18n.Util.unitConvert({unit: "cup", measureSystem: "US"}, {unit: "liter", measureSystem: "SI"}, 1000, "en-US", "long");
``` ```
...@@ -797,7 +796,7 @@ Creates an **IndexUtil** object. ...@@ -797,7 +796,7 @@ Creates an **IndexUtil** object.
| [IndexUtil](#indexutil8) | **IndexUtil** object mapping to the specified locale.| | [IndexUtil](#indexutil8) | **IndexUtil** object mapping to the specified locale.|
**Example** **Example**
``` ```js
var indexUtil= i18n.getInstance("zh-CN"); var indexUtil= i18n.getInstance("zh-CN");
``` ```
...@@ -819,7 +818,7 @@ Obtains the index list for this **locale** object. ...@@ -819,7 +818,7 @@ Obtains the index list for this **locale** object.
| Array&lt;string&gt; | Index list for this **locale** object.| | Array&lt;string&gt; | Index list for this **locale** object.|
**Example** **Example**
``` ```js
var indexUtil = i18n.getInstance("zh-CN"); var indexUtil = i18n.getInstance("zh-CN");
var indexList = indexUtil.getIndexList(); var indexList = indexUtil.getIndexList();
``` ```
...@@ -839,7 +838,7 @@ Adds the index of the new **locale** object to the index list. ...@@ -839,7 +838,7 @@ Adds the index of the new **locale** object to the index list.
| locale | string | Yes | A string containing locale information, including the language, optional script, and region.| | locale | string | Yes | A string containing locale information, including the language, optional script, and region.|
**Example** **Example**
``` ```js
var indexUtil = i18n.getInstance("zh-CN"); var indexUtil = i18n.getInstance("zh-CN");
indexUtil.addLocale("en-US"); indexUtil.addLocale("en-US");
``` ```
...@@ -864,7 +863,7 @@ Obtains the index of a text object. ...@@ -864,7 +863,7 @@ Obtains the index of a text object.
| string | Index of the **text** object.| | string | Index of the **text** object.|
**Example** **Example**
``` ```js
var indexUtil= i18n.getInstance("zh-CN"); var indexUtil= i18n.getInstance("zh-CN");
indexUtil.getIndex("hi"); // Return h. indexUtil.getIndex("hi"); // Return h.
``` ```
...@@ -892,7 +891,7 @@ Checks whether the input character string is composed of digits. ...@@ -892,7 +891,7 @@ Checks whether the input character string is composed of digits.
| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.| | boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isdigit = i18n.Character.isDigit("1"); // Return true. var isdigit = i18n.Character.isDigit("1"); // Return true.
``` ```
...@@ -916,7 +915,7 @@ Checks whether the input character is a space. ...@@ -916,7 +915,7 @@ Checks whether the input character is a space.
| boolean | Returns **true** if the input character is a space; returns **false** otherwise.| | boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isspacechar = i18n.Character.isSpaceChar("a"); // Return false. var isspacechar = i18n.Character.isSpaceChar("a"); // Return false.
``` ```
...@@ -940,7 +939,7 @@ Checks whether the input character is a white space. ...@@ -940,7 +939,7 @@ Checks whether the input character is a white space.
| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.| | boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isspacechar = i18n.Character.isSpaceChar("a"); // Return false. var isspacechar = i18n.Character.isSpaceChar("a"); // Return false.
``` ```
...@@ -964,7 +963,7 @@ Checks whether the input character is of the right to left (RTL) language. ...@@ -964,7 +963,7 @@ Checks whether the input character is of the right to left (RTL) language.
| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.| | boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isrtl = i18n.Character.isRTL("a"); // Return false. var isrtl = i18n.Character.isRTL("a"); // Return false.
``` ```
...@@ -988,7 +987,7 @@ Checks whether the input character is an ideographic character. ...@@ -988,7 +987,7 @@ Checks whether the input character is an ideographic character.
| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.| | boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isideograph = i18n.Character.isIdeograph("a"); // Return false. var isideograph = i18n.Character.isIdeograph("a"); // Return false.
``` ```
...@@ -1012,7 +1011,7 @@ Checks whether the input character is a letter. ...@@ -1012,7 +1011,7 @@ Checks whether the input character is a letter.
| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.| | boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isletter = i18n.Character.isLetter("a"); // Return true. var isletter = i18n.Character.isLetter("a"); // Return true.
``` ```
...@@ -1036,7 +1035,7 @@ Checks whether the input character is a lowercase letter. ...@@ -1036,7 +1035,7 @@ Checks whether the input character is a lowercase letter.
| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.| | boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
**Example** **Example**
``` ```js
var islowercase = i18n.Character.isLowerCase("a"); // Return true. var islowercase = i18n.Character.isLowerCase("a"); // Return true.
``` ```
...@@ -1060,7 +1059,7 @@ Checks whether the input character is an uppercase letter. ...@@ -1060,7 +1059,7 @@ Checks whether the input character is an uppercase letter.
| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.| | boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
**Example** **Example**
``` ```js
var isuppercase = i18n.Character.isUpperCase("a"); // Return false. var isuppercase = i18n.Character.isUpperCase("a"); // Return false.
``` ```
...@@ -1084,7 +1083,7 @@ Obtains the type of the input character string. ...@@ -1084,7 +1083,7 @@ Obtains the type of the input character string.
| string | Type of the input character.| | string | Type of the input character.|
**Example** **Example**
``` ```js
var type = i18n.Character.getType("a"); var type = i18n.Character.getType("a");
``` ```
...@@ -1108,7 +1107,7 @@ Obtains a [BreakIterator](#breakiterator8) object for text segmentation. ...@@ -1108,7 +1107,7 @@ Obtains a [BreakIterator](#breakiterator8) object for text segmentation.
| [BreakIterator](#breakiterator8) | [BreakIterator](#breakiterator8) object used for text segmentation.| | [BreakIterator](#breakiterator8) | [BreakIterator](#breakiterator8) object used for text segmentation.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
``` ```
...@@ -1130,7 +1129,7 @@ Sets the text to be processed by the [BreakIterator](#breakiterator8) object. ...@@ -1130,7 +1129,7 @@ Sets the text to be processed by the [BreakIterator](#breakiterator8) object.
| text | string | Yes | Text to be processed by the **BreakIterator** object.| | text | string | Yes | Text to be processed by the **BreakIterator** object.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
``` ```
...@@ -1150,7 +1149,7 @@ Obtains the text being processed by the [BreakIterator](#breakiterator8) object. ...@@ -1150,7 +1149,7 @@ Obtains the text being processed by the [BreakIterator](#breakiterator8) object.
| string | Text being processed by the **BreakIterator** object.| | string | Text being processed by the **BreakIterator** object.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.getLineBreakText(); // Apple is my favorite fruit. iterator.getLineBreakText(); // Apple is my favorite fruit.
...@@ -1171,7 +1170,7 @@ Obtains the position of the [BreakIterator](#breakiterator8) object in the text ...@@ -1171,7 +1170,7 @@ Obtains the position of the [BreakIterator](#breakiterator8) object in the text
| number | Position of the **BreakIterator** object in the text being processed.| | number | Position of the **BreakIterator** object in the text being processed.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.current(); // 0 iterator.current(); // 0
...@@ -1192,7 +1191,7 @@ Puts the [BreakIterator](#breakiterator8) object to the first text boundary, whi ...@@ -1192,7 +1191,7 @@ Puts the [BreakIterator](#breakiterator8) object to the first text boundary, whi
| number | Offset to the first text boundary of the processed text.| | number | Offset to the first text boundary of the processed text.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.first(); // 0 iterator.first(); // 0
...@@ -1213,7 +1212,7 @@ Puts the [BreakIterator](#breakiterator8) object to the last text boundary, whic ...@@ -1213,7 +1212,7 @@ Puts the [BreakIterator](#breakiterator8) object to the last text boundary, whic
| number | Offset of the last text boundary of the processed text.| | number | Offset of the last text boundary of the processed text.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.last(); // 27 iterator.last(); // 27
...@@ -1239,7 +1238,7 @@ Moves the [BreakIterator](#breakiterator8) object backward by the specified numb ...@@ -1239,7 +1238,7 @@ Moves the [BreakIterator](#breakiterator8) object backward by the specified numb
| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved by the specified number of text boundaries. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.| | number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved by the specified number of text boundaries. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.first(); // 0 iterator.first(); // 0
...@@ -1262,7 +1261,7 @@ Moves the [BreakIterator](#breakiterator8) object to the previous text boundary. ...@@ -1262,7 +1261,7 @@ Moves the [BreakIterator](#breakiterator8) object to the previous text boundary.
| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved to the previous text boundary. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.| | number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved to the previous text boundary. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.first(); // 0 iterator.first(); // 0
...@@ -1290,7 +1289,7 @@ Moves the [BreakIterator](#breakiterator8) object to the text boundary after the ...@@ -1290,7 +1289,7 @@ Moves the [BreakIterator](#breakiterator8) object to the text boundary after the
| number | The value **-1** is returned if the text boundary to which the [BreakIterator](#breakiterator8) object is moved is outside of the processed text.| | number | The value **-1** is returned if the text boundary to which the [BreakIterator](#breakiterator8) object is moved is outside of the processed text.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.following(0); // 6 iterator.following(0); // 6
...@@ -1318,7 +1317,7 @@ Checks whether the position specified by the offset is a text boundary. If **tru ...@@ -1318,7 +1317,7 @@ Checks whether the position specified by the offset is a text boundary. If **tru
| boolean | Returns **true** if the position specified by the offset is a text boundary; returns **false** otherwise.| | boolean | Returns **true** if the position specified by the offset is a text boundary; returns **false** otherwise.|
**Example** **Example**
``` ```js
var iterator = i18n.getLineInstance("en"); var iterator = i18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
iterator.isBoundary(0); // true; iterator.isBoundary(0); // true;
...@@ -1340,7 +1339,7 @@ Checks whether the 24-hour clock is used. ...@@ -1340,7 +1339,7 @@ Checks whether the 24-hour clock is used.
| boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.| | boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.|
**Example** **Example**
``` ```js
var is24HourClock = i18n.is24HourClock(); var is24HourClock = i18n.is24HourClock();
``` ```
...@@ -1366,7 +1365,7 @@ Sets the 24-hour clock. ...@@ -1366,7 +1365,7 @@ Sets the 24-hour clock.
| boolean | Returns **true** if the 24-hour clock is enabled; returns **false** otherwise.| | boolean | Returns **true** if the 24-hour clock is enabled; returns **false** otherwise.|
**Example** **Example**
``` ```js
// Set the system time to the 24-hour clock. // Set the system time to the 24-hour clock.
var success = i18n.set24HourClock(true); var success = i18n.set24HourClock(true);
``` ```
...@@ -1394,7 +1393,7 @@ Adds a preferred language to the specified position on the preferred language li ...@@ -1394,7 +1393,7 @@ Adds a preferred language to the specified position on the preferred language li
| boolean | Returns **true** if the preferred language is successfully added; returns **false** otherwise.| | boolean | Returns **true** if the preferred language is successfully added; returns **false** otherwise.|
**Example** **Example**
``` ```js
// Add zh-CN to the preferred language list. // Add zh-CN to the preferred language list.
var language = 'zh-CN'; var language = 'zh-CN';
var index = 0; var index = 0;
...@@ -1423,7 +1422,7 @@ Deletes a preferred language from the specified position on the preferred langua ...@@ -1423,7 +1422,7 @@ Deletes a preferred language from the specified position on the preferred langua
| boolean | Returns **true** if the preferred language is deleted; returns **false** otherwise.| | boolean | Returns **true** if the preferred language is deleted; returns **false** otherwise.|
**Example** **Example**
``` ```js
// Delete the first preferred language from the preferred language list. // Delete the first preferred language from the preferred language list.
var index = 0; var index = 0;
var success = i18n.removePreferredLanguage(index); var success = i18n.removePreferredLanguage(index);
...@@ -1444,7 +1443,7 @@ Obtains the list of preferred languages. ...@@ -1444,7 +1443,7 @@ Obtains the list of preferred languages.
| Array&lt;string&gt; | List of preferred languages.| | Array&lt;string&gt; | List of preferred languages.|
**Example** **Example**
``` ```js
var preferredLanguageList = i18n.getPreferredLanguageList(); var preferredLanguageList = i18n.getPreferredLanguageList();
``` ```
...@@ -1463,7 +1462,7 @@ Obtains the first language in the preferred language list. ...@@ -1463,7 +1462,7 @@ Obtains the first language in the preferred language list.
| string | First language in the preferred language list.| | string | First language in the preferred language list.|
**Example** **Example**
``` ```js
var firstPreferredLanguage = i18n.getFirstPreferredLanguage(); var firstPreferredLanguage = i18n.getFirstPreferredLanguage();
``` ```
...@@ -1482,7 +1481,7 @@ Obtains the preferred language of an application. ...@@ -1482,7 +1481,7 @@ Obtains the preferred language of an application.
| string | Preferred language of the application.| | string | Preferred language of the application.|
**Example** **Example**
``` ```js
var appPreferredLanguage = i18n.getAppPreferredLanguage(); var appPreferredLanguage = i18n.getAppPreferredLanguage();
``` ```
...@@ -1506,7 +1505,7 @@ Obtains the **TimeZone** object corresponding to the specified time zone ID. ...@@ -1506,7 +1505,7 @@ Obtains the **TimeZone** object corresponding to the specified time zone ID.
| TimeZone | **TimeZone** object corresponding to the time zone ID.| | TimeZone | **TimeZone** object corresponding to the time zone ID.|
**Example** **Example**
``` ```js
var timezone = i18n.getTimeZone(); var timezone = i18n.getTimeZone();
``` ```
...@@ -1528,7 +1527,7 @@ Obtains the ID of the specified **TimeZone** object. ...@@ -1528,7 +1527,7 @@ Obtains the ID of the specified **TimeZone** object.
| string | Time zone ID corresponding to the **TimeZone** object.| | string | Time zone ID corresponding to the **TimeZone** object.|
**Example** **Example**
``` ```js
var timezone = i18n.getTimeZone(); var timezone = i18n.getTimeZone();
timezone.getID(); timezone.getID();
``` ```
...@@ -1554,7 +1553,7 @@ Obtains the representation of a **TimeZone** object in the specified locale. ...@@ -1554,7 +1553,7 @@ Obtains the representation of a **TimeZone** object in the specified locale.
| string | Representation of the **TimeZone** object in the specified locale.| | string | Representation of the **TimeZone** object in the specified locale.|
**Example** **Example**
``` ```js
var timezone = i18n.getTimeZone(); var timezone = i18n.getTimeZone();
timezone.getDisplayName("zh-CN", false); timezone.getDisplayName("zh-CN", false);
``` ```
...@@ -1574,7 +1573,7 @@ Obtains the offset between the time zone represented by a **TimeZone** object an ...@@ -1574,7 +1573,7 @@ Obtains the offset between the time zone represented by a **TimeZone** object an
| number | Offset between the time zone represented by the **TimeZone** object and the UTC time zone.| | number | Offset between the time zone represented by the **TimeZone** object and the UTC time zone.|
**Example** **Example**
``` ```js
var timezone = i18n.getTimeZone(); var timezone = i18n.getTimeZone();
timezone.getRawOffset(); timezone.getRawOffset();
``` ```
...@@ -1594,7 +1593,7 @@ Obtains the offset between the time zone represented by a **TimeZone** object an ...@@ -1594,7 +1593,7 @@ Obtains the offset between the time zone represented by a **TimeZone** object an
| number | Offset between the time zone represented by the **TimeZone** object and the UTC time zone at a certain time point.| | number | Offset between the time zone represented by the **TimeZone** object and the UTC time zone at a certain time point.|
**Example** **Example**
``` ```js
var timezone = i18n.getTimeZone(); var timezone = i18n.getTimeZone();
timezone.getOffset(1234567890); timezone.getOffset(1234567890);
``` ```
...@@ -1613,7 +1612,7 @@ Obtains the list of time zone IDs supported by the system. ...@@ -1613,7 +1612,7 @@ Obtains the list of time zone IDs supported by the system.
| Array&lt;string&gt; | List of time zone IDs supported by the system.| | Array&lt;string&gt; | List of time zone IDs supported by the system.|
**Example** **Example**
``` ```js
var ids = i18n.TimeZone.getAvailableIDs(); var ids = i18n.TimeZone.getAvailableIDs();
``` ```
...@@ -1632,7 +1631,7 @@ Obtains the list of time zone city IDs supported by the system. ...@@ -1632,7 +1631,7 @@ Obtains the list of time zone city IDs supported by the system.
| Array&lt;string&gt; | List of time zone city IDs supported by the system.| | Array&lt;string&gt; | List of time zone city IDs supported by the system.|
**Example** **Example**
``` ```js
var cityIDs = i18n.TimeZone.getAvailableZoneCityIDs(); var cityIDs = i18n.TimeZone.getAvailableZoneCityIDs();
``` ```
...@@ -1657,7 +1656,7 @@ Obtains the localized display of a time zone city in the specified locale. ...@@ -1657,7 +1656,7 @@ Obtains the localized display of a time zone city in the specified locale.
| string | Localized display of the time zone city in the specified locale.| | string | Localized display of the time zone city in the specified locale.|
**Example** **Example**
``` ```js
var displayName = i18n.TimeZone.getCityDisplayName("Shanghai", "zh-CN"); var displayName = i18n.TimeZone.getCityDisplayName("Shanghai", "zh-CN");
``` ```
...@@ -1681,7 +1680,7 @@ Obtains the **TimeZone** object corresponding to the specified time zone city ID ...@@ -1681,7 +1680,7 @@ Obtains the **TimeZone** object corresponding to the specified time zone city ID
| TimeZone | **TimeZone** object corresponding to the specified time zone city ID.| | TimeZone | **TimeZone** object corresponding to the specified time zone city ID.|
**Example** **Example**
``` ```js
var timezone = i18n.TimeZone.getTimezoneFromCity("Shanghai"); var timezone = i18n.TimeZone.getTimezoneFromCity("Shanghai");
``` ```
...@@ -1708,7 +1707,7 @@ This is a system API. ...@@ -1708,7 +1707,7 @@ This is a system API.
| boolean | Result indicating whether the local digit switch is successfully set. The value **true** indicates that the local digit switch is successfully set, and the value **false** indicates the opposite.| | boolean | Result indicating whether the local digit switch is successfully set. The value **true** indicates that the local digit switch is successfully set, and the value **false** indicates the opposite.|
**Example** **Example**
``` ```js
var status = i18n.setUsingLocalDigit(true); var status = i18n.setUsingLocalDigit(true);
``` ```
...@@ -1727,7 +1726,7 @@ Checks whether the local digit switch is turned on. ...@@ -1727,7 +1726,7 @@ Checks whether the local digit switch is turned on.
| boolean | Result indicating whether the local digit switch is turned on. The value **true** indicates that the local digit switch is turned on, and the value **false** indicates the opposite.| | boolean | Result indicating whether the local digit switch is turned on. The value **true** indicates that the local digit switch is turned on, and the value **false** indicates the opposite.|
**Example** **Example**
``` ```js
var status = i18n.getUsingLocalDigit(); var status = i18n.getUsingLocalDigit();
``` ```
......
...@@ -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](#inputmethodgetinputmethodcontroller) 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](#inputmethodgetinputmethodcontroller) to obtain an **InputMethodSetting** instance, and then call the APIs using the obtained instance.
### listInputMethod ### listInputMethod
......
...@@ -536,7 +536,7 @@ Parameters ...@@ -536,7 +536,7 @@ Parameters
**Example** **Example**
``` ```
var pluralRules= new Intl.PluraRules("zh-CN", {"localeMatcher": "lookup", "type": "cardinal"}); var pluralRules= new Intl.PluralRules("zh-CN", {"localeMatcher": "lookup", "type": "cardinal"});
``` ```
......
...@@ -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.
> >
...@@ -29,9 +29,9 @@ Obtains an **OnlineUpdater** object. ...@@ -29,9 +29,9 @@ 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",
...@@ -67,13 +67,13 @@ Obtains a **Restorer** object for restoring factory settings. ...@@ -67,13 +67,13 @@ 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) {
...@@ -91,13 +91,13 @@ Obtains a **LocalUpdater** object. ...@@ -91,13 +91,13 @@ 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) {
...@@ -119,13 +119,13 @@ Checks whether a new version is available. This API uses an asynchronous callbac ...@@ -119,13 +119,13 @@ 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}`);
}); });
...@@ -143,13 +143,13 @@ Checks whether a new version is available. This API uses a promise to return the ...@@ -143,13 +143,13 @@ 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
...@@ -171,13 +171,13 @@ Obtains information about the new version. This API uses an asynchronous callbac ...@@ -171,13 +171,13 @@ 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}`);
...@@ -196,13 +196,13 @@ Obtains information about the new version. This API uses a promise to return the ...@@ -196,13 +196,13 @@ 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}`);
...@@ -223,15 +223,15 @@ Obtains the description file of the new version. This API uses an asynchronous c ...@@ -223,15 +223,15 @@ 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
...@@ -261,20 +261,20 @@ Obtains the description file of the new version. This API uses a promise to retu ...@@ -261,20 +261,20 @@ 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
...@@ -305,13 +305,13 @@ Obtains information about the current version. This API uses an asynchronous cal ...@@ -305,13 +305,13 @@ 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}`);
...@@ -331,13 +331,13 @@ Obtains information about the current version. This API uses a promise to return ...@@ -331,13 +331,13 @@ 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}`);
...@@ -359,14 +359,14 @@ Obtains the description file of the current version. This API uses an asynchrono ...@@ -359,14 +359,14 @@ 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
...@@ -391,19 +391,19 @@ Obtains the description file of the current version. This API uses a promise to ...@@ -391,19 +391,19 @@ 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
...@@ -429,13 +429,13 @@ Obtains information about the update task. This API uses an asynchronous callbac ...@@ -429,13 +429,13 @@ 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}`);
}); });
...@@ -453,13 +453,13 @@ Obtains information about the update task. This API uses a promise to return the ...@@ -453,13 +453,13 @@ 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 => {
...@@ -479,15 +479,15 @@ Downloads the new version. This API uses an asynchronous callback to return the ...@@ -479,15 +479,15 @@ 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
...@@ -515,20 +515,20 @@ Downloads the new version. This API uses a promise to return the result. ...@@ -515,20 +515,20 @@ 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
...@@ -558,15 +558,15 @@ Resumes download of the new version. This API uses an asynchronous callback to r ...@@ -558,15 +558,15 @@ 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
...@@ -593,20 +593,20 @@ Resumes download of the new version. This API uses a promise to return the resul ...@@ -593,20 +593,20 @@ 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
...@@ -635,15 +635,15 @@ Pauses download of the new version. This API uses an asynchronous callback to re ...@@ -635,15 +635,15 @@ 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
...@@ -670,20 +670,20 @@ Resumes download of the new version. This API uses a promise to return the resul ...@@ -670,20 +670,20 @@ 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
...@@ -712,15 +712,15 @@ Updates the version. This API uses an asynchronous callback to return the result ...@@ -712,15 +712,15 @@ 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
...@@ -747,20 +747,20 @@ Updates the version. This API uses a promise to return the result. ...@@ -747,20 +747,20 @@ 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
...@@ -789,15 +789,15 @@ Clears errors. This API uses an asynchronous callback to return the result. ...@@ -789,15 +789,15 @@ 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
...@@ -824,20 +824,20 @@ Clears errors. This API uses a promise to return the result. ...@@ -824,20 +824,20 @@ 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
...@@ -866,13 +866,13 @@ Obtains the update policy. This API uses an asynchronous callback to return the ...@@ -866,13 +866,13 @@ 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}`);
...@@ -891,13 +891,13 @@ Obtains the update policy. This API uses a promise to return the result. ...@@ -891,13 +891,13 @@ 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}`);
...@@ -918,14 +918,14 @@ Sets the update policy. This API uses an asynchronous callback to return the res ...@@ -918,14 +918,14 @@ 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,
...@@ -948,19 +948,19 @@ Sets the update policy. This API uses a promise to return the result. ...@@ -948,19 +948,19 @@ 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,
...@@ -985,13 +985,13 @@ Terminates the update. This API uses an asynchronous callback to return the resu ...@@ -985,13 +985,13 @@ 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)}`);
}); });
...@@ -1009,13 +1009,13 @@ Terminates the update. This API uses a promise to return the result. ...@@ -1009,13 +1009,13 @@ 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 => {
...@@ -1033,14 +1033,14 @@ Enables listening for update events. This API uses an asynchronous callback to r ...@@ -1033,14 +1033,14 @@ 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: ""
...@@ -1060,14 +1060,14 @@ Disables listening for update events. This API uses an asynchronous callback to ...@@ -1060,14 +1060,14 @@ 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
...@@ -1092,13 +1092,13 @@ Restores factory settings. This API uses an asynchronous callback to return the ...@@ -1092,13 +1092,13 @@ 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
...@@ -1116,13 +1116,13 @@ Restores factory settings. This API uses a promise to return the result. ...@@ -1116,13 +1116,13 @@ 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 => {
...@@ -1144,15 +1144,15 @@ Verifies the update package. This API uses an asynchronous callback to return th ...@@ -1144,15 +1144,15 @@ 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
...@@ -1175,20 +1175,20 @@ Verifies the update package. This API uses a promise to return the result. ...@@ -1175,20 +1175,20 @@ 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
...@@ -1211,14 +1211,14 @@ Installs the update package. This API uses an asynchronous callback to return th ...@@ -1211,14 +1211,14 @@ 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
...@@ -1241,13 +1241,13 @@ Installs the update package. This API uses a promise to return the result. ...@@ -1241,13 +1241,13 @@ 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
...@@ -1268,14 +1268,14 @@ Enables listening for update events. This API uses an asynchronous callback to r ...@@ -1268,14 +1268,14 @@ 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: ""
...@@ -1297,14 +1297,14 @@ Disables listening for update events. This API uses an asynchronous callback to ...@@ -1297,14 +1297,14 @@ 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: ""
...@@ -1323,10 +1323,10 @@ Represents update information. ...@@ -1323,10 +1323,10 @@ 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
...@@ -1334,10 +1334,10 @@ Enumerates update service types. ...@@ -1334,10 +1334,10 @@ 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
...@@ -1345,10 +1345,10 @@ Represents the package check result. ...@@ -1345,10 +1345,10 @@ 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
...@@ -1356,10 +1356,10 @@ Represents information about the new version. ...@@ -1356,10 +1356,10 @@ 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
...@@ -1367,9 +1367,9 @@ Represents version digest information. ...@@ -1367,9 +1367,9 @@ 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
...@@ -1394,10 +1394,10 @@ Represents options of the description file. ...@@ -1394,10 +1394,10 @@ 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
...@@ -1405,10 +1405,10 @@ Represents a component description file. ...@@ -1405,10 +1405,10 @@ 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
...@@ -1416,10 +1416,10 @@ Represents information about the version description file. ...@@ -1416,10 +1416,10 @@ 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
...@@ -1427,11 +1427,11 @@ Represents information about the current version. ...@@ -1427,11 +1427,11 @@ 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
...@@ -1439,10 +1439,10 @@ Represents download options. ...@@ -1439,10 +1439,10 @@ 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
...@@ -1470,9 +1470,9 @@ Represents update options. ...@@ -1470,9 +1470,9 @@ 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
...@@ -1480,9 +1480,9 @@ Represents options for clearing errors. ...@@ -1480,9 +1480,9 @@ 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
...@@ -1490,11 +1490,11 @@ Represents an update policy. ...@@ -1490,11 +1490,11 @@ 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.|
## UpgradePeriod ## UpgradePeriod
...@@ -1502,10 +1502,10 @@ Represents a period for automatic update. ...@@ -1502,10 +1502,10 @@ 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
...@@ -1513,21 +1513,21 @@ Represents task information. ...@@ -1513,21 +1513,21 @@ 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
...@@ -1535,15 +1535,15 @@ Represents task data. ...@@ -1535,15 +1535,15 @@ 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
...@@ -1551,10 +1551,10 @@ Represents an error message. ...@@ -1551,10 +1551,10 @@ 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
...@@ -1562,10 +1562,10 @@ Represents event type information. ...@@ -1562,10 +1562,10 @@ 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
...@@ -1573,22 +1573,22 @@ Represents an update file. ...@@ -1573,22 +1573,22 @@ 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
...@@ -1596,9 +1596,9 @@ Device vendor. ...@@ -1596,9 +1596,9 @@ 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
...@@ -1606,9 +1606,9 @@ Represents an update type. ...@@ -1606,9 +1606,9 @@ 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
...@@ -1616,9 +1616,9 @@ Represents a component type. ...@@ -1616,9 +1616,9 @@ 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
...@@ -1626,10 +1626,10 @@ Represents an update mode. ...@@ -1626,10 +1626,10 @@ 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. |
## EffectiveMode ## EffectiveMode
...@@ -1637,11 +1637,11 @@ Represents an effective mode. ...@@ -1637,11 +1637,11 @@ 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
...@@ -1649,10 +1649,10 @@ Represents a description file type. ...@@ -1649,10 +1649,10 @@ 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. |
## DescriptionFormat ## DescriptionFormat
...@@ -1660,10 +1660,10 @@ Represents a description file format. ...@@ -1660,10 +1660,10 @@ 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
...@@ -1671,13 +1671,13 @@ Enumerates network types. ...@@ -1671,13 +1671,13 @@ 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
...@@ -1685,13 +1685,13 @@ Represents an update command. ...@@ -1685,13 +1685,13 @@ 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
...@@ -1699,18 +1699,18 @@ Enumerates update states. ...@@ -1699,18 +1699,18 @@ 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
...@@ -1718,9 +1718,9 @@ Represents an event type. ...@@ -1718,9 +1718,9 @@ 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
...@@ -1728,22 +1728,22 @@ Enumerates event IDs. ...@@ -1728,22 +1728,22 @@ 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. |
| EVENT_DOWNLOAD_FAIL | 0x01001001 | Indicates that the download failed. | | EVENT_DOWNLOAD_FAIL | 0x01001001 | Indicates that the download failed. |
| EVENT_UPGRADE_WAIT | 0x01001010 | Indicates the state of waiting for the update. | | EVENT_UPGRADE_WAIT | 0x01001010 | Indicates the state of waiting for the update. |
| EVENT_UPGRADE_START | 0x01001011 | Indicates that the update starts. | | EVENT_UPGRADE_START | 0x01001011 | Indicates that the update starts. |
| EVENT_UPGRADE_UPDATE | 0x01001100 | Indicates that the update is in progress. | | EVENT_UPGRADE_UPDATE | 0x01001100 | Indicates that the update is in progress. |
| EVENT_APPLY_WAIT | 0x01001101 | Indicates the state of waiting for applying the update. | | EVENT_APPLY_WAIT | 0x01001101 | Indicates the state of waiting for applying the update. |
| EVENT_APPLY_START | 0x01001110 | Indicates the state of applying the update. | | EVENT_APPLY_START | 0x01001110 | Indicates the state of applying the update. |
| EVENT_UPGRADE_SUCCESS | 0x01001111 | Indicates that the update succeeded. | | EVENT_UPGRADE_SUCCESS | 0x01001111 | Indicates that the update succeeded. |
| EVENT_UPGRADE_FAIL | 0x01010000 | Indicates that the update failed. | | EVENT_UPGRADE_FAIL | 0x01010000 | Indicates that the update failed. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册