提交 ddf5d8ea 编写于 作者: G Gloria

corrected link errors and deleted unnecessary files and attributes

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 c31b2adc
......@@ -92,7 +92,7 @@ After the preceding code is executed, the **startAbility()** API is called to st
- If the Service ability is not running, the system calls **onStart()** to initialize the Service ability, and then calls **onCommand()** on the Service ability.
- If the Service ability is running, the system directly calls **onCommand()** on the Service ability.
The following code snippet shows how to start a Service ability running on the remote device. For details about **getRemoteDeviceId()**, see [Connecting to a Remote Service Ability](#connecting-to-a-remote-service-ability-applying-only-to-system-applications).
The following code snippet shows how to start a Service ability running on the remote device. For details about **getRemoteDeviceId()**, see [Connecting to a Remote Service Ability](#connecting-to-a-remote-service-ability).
```javascript
import featureAbility from '@ohos.ability.featureAbility';
......
......@@ -9,15 +9,15 @@ You can use APIs provided in the following table to obtain the system language a
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.i18n | getSystemLanguage(): string | Obtains the system language. |
| ohos.i18n | getSystemRegion(): string | Obtains the system region. |
| ohos.i18n | getSystemLocale(): string | Obtains the system locale. |
| ohos.i18n | isRTL(locale: string): boolean<sup>7+</sup> | Checks whether the locale uses a right-to-left (RTL) language. |
| ohos.i18n | is24HourClock(): boolean<sup>7+</sup> | Checks whether the system uses a 24-hour clock. |
| ohos.i18n | getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string | Obtains the localized display of a language. |
| ohos.i18n | getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string | Obtains the localized display of a country name. |
| ohos.i18n | getSystemLanguage(): string | Obtains the system language. |
| ohos.i18n | getSystemRegion(): string | Obtains the system region. |
| ohos.i18n | getSystemLocale(): string | Obtains the system locale. |
| ohos.i18n | isRTL(locale: string): boolean<sup>7+</sup> | Checks whether the locale uses a right-to-left (RTL) language. |
| ohos.i18n | is24HourClock(): boolean<sup>7+</sup> | Checks whether the system uses a 24-hour clock. |
| ohos.i18n | getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string | Obtains the localized display of a language. |
| ohos.i18n | getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string | Obtains the localized display of a country name. |
### How to Develop
......@@ -26,7 +26,7 @@ You can use APIs provided in the following table to obtain the system language a
Call the **getSystemLanguage** method to obtain the system language (**i18n** is the name of the imported module).
```js
var language = i18n.getSystemLanguage();
```
......@@ -42,7 +42,7 @@ You can use APIs provided in the following table to obtain the system language a
3. Obtain the system locale.
Call the **getSystemLocale** method to obtain the system locale.
```js
var locale = i18n.getSystemLocale();
```
......@@ -51,7 +51,7 @@ You can use APIs provided in the following table to obtain the system language a
Call the **isRTL** method to check whether the locale's language is RTL.
```js
var rtl = i18n.isRTL("zh-CN");
```
......@@ -67,7 +67,7 @@ You can use APIs provided in the following table to obtain the system language a
6. Obtain the localized display of a language.
Call the **getDisplayLanguage** method to obtain the localized display of a language. **language** indicates the language to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
```js
var language = "en";
var locale = "zh-CN";
......@@ -78,7 +78,7 @@ You can use APIs provided in the following table to obtain the system language a
7. Obtain the localized display of a country.
Call the **getDisplayCountry** method to obtain the localized display of a country name. **country** indicates the country code (a two-letter code in compliance with ISO-3166, for example, CN), **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized.
```js
var country = "US";
var locale = "zh-CN";
......@@ -116,7 +116,7 @@ You can use APIs provided in the following table to obtain the system language a
Call the **getCalendar** method to obtain the time zone object of a specific locale and type (**i18n** is the name of the imported module). **type** indicates the valid calendar type, for example, **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic_civil**, **islamic_tbla**, **islamic_umalqura**, **japanese**, and **persian**. If **type** is left unspecified, the default calendar type of the locale is used.
```js
var calendar = i18n.getCalendar("zh-CN", "gregory");
```
......@@ -135,7 +135,7 @@ You can use APIs provided in the following table to obtain the system language a
3. Set the year, month, day, hour, minute, and second for the **Calendar** object.
Call the **set** method to set the year, month, day, hour, minute, and second for the **Calendar** object.
```js
calendar.set(2021, 12, 21, 6, 0, 0)
```
......@@ -144,7 +144,7 @@ You can use APIs provided in the following table to obtain the system language a
Call the **setTimeZone** and **getTimeZone** methods to set and obtain the time zone for the **Calendar** object. The **setTimeZone** method requires an input string to indicate the time zone to be set.
```js
calendar.setTimeZone("Asia/Shanghai");
var timezone = calendar.getTimeZone();
......@@ -163,7 +163,7 @@ You can use APIs provided in the following table to obtain the system language a
6. Set and obtain the minimum count of days in the first week for the **Calendar** object.
Call the **setMinimalDaysInFirstWeek** and **getMinimalDaysInFirstWeek** methods to set and obtain the minimum count of days in the first week for the **Calendar** object.
```js
calendar.setMinimalDaysInFirstWeek(3);
var minimalDaysInFirstWeek = calendar.getMinimalDaysInFirstWeek();
......@@ -173,7 +173,7 @@ You can use APIs provided in the following table to obtain the system language a
Call the **getDisplayName** method to obtain the localized display of the **Calendar** object.
```js
var localizedName = calendar.getDisplayName("zh-CN");
```
......@@ -196,11 +196,11 @@ You can use APIs provided in the following table to obtain the system language a
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.i18n | constructor(country: string, options?: PhoneNumberFormatOptions)<sup>8+</sup> | Instantiates a **PhoneNumberFormat** object. |
| ohos.i18n | isValidNumber(number: string): boolean<sup>8+</sup> | Checks whether the value of **number** is a phone number in the correct format. |
| ohos.i18n | format(number: string): string<sup>8+</sup> | Formats the value of **number** based on the specified country and style. |
| ohos.i18n | constructor(country: string, options?: PhoneNumberFormatOptions)<sup>8+</sup> | Instantiates a **PhoneNumberFormat** object. |
| ohos.i18n | isValidNumber(number: string): boolean<sup>8+</sup> | Checks whether the value of **number** is a phone number in the correct format. |
| ohos.i18n | format(number: string): string<sup>8+</sup> | Formats the value of **number** based on the specified country and style. |
### How to Develop
......@@ -209,7 +209,7 @@ You can use APIs provided in the following table to obtain the system language a
Call the **PhoneNumberFormat** constructor to instantiate a **PhoneNumberFormat** object. The country code and formatting options of the phone number need to be passed into this constructor. The formatting options are optional, including a style option. Values of this option include: **E164**, **INTERNATIONAL**, **NATIONAL**, and **RFC3966**.
```js
var phoneNumberFormat = new i18n.PhoneNumberFormat("CN", {type: "E164"});
```
......@@ -223,7 +223,7 @@ You can use APIs provided in the following table to obtain the system language a
3. Format a phone number.
Call the **format** method of **PhoneNumberFormat** to format the input phone number.
```js
var formattedNumber = phoneNumberFormat.format("15812341234");
```
......@@ -236,15 +236,15 @@ The **unitConvert** API is provided to help you implement measurement conversion
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.i18n | unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string<sup>8+</sup> | Converts one measurement unit (**fromUnit**) into another (**toUnit**) and formats the unit based on the specified locale and style. |
| ohos.i18n | unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string<sup>8+</sup> | Converts one measurement unit (**fromUnit**) into another (**toUnit**) and formats the unit based on the specified locale and style. |
### How to Develop
1. Convert a measurement unit.
Call the [unitConvert](../reference/apis/js-apis-i18n.md#unitconvert8) method to convert a measurement unit and format the display result.
Call the [unitConvert](../reference/apis/js-apis-i18n.md#unitconvert9) method to convert a measurement unit and format the display result.
```js
......@@ -254,7 +254,7 @@ The **unitConvert** API is provided to help you implement measurement conversion
var locale = "en-US";
var style = "long";
i18n.Util.unitConvert(fromUtil, toUtil, number, locale, style);
```
```
## Alphabet Index
......@@ -278,7 +278,7 @@ The **unitConvert** API is provided to help you implement measurement conversion
Call the **getInstance** method to instantiate an **IndexUtil** object for a specific locale. When the **locale** parameter is empty, instantiate an **IndexUtil** object of the default locale.
```js
var indexUtil = i18n.getInstance("zh-CN");
```
......@@ -294,7 +294,7 @@ The **unitConvert** API is provided to help you implement measurement conversion
3. Add an index.
Call the **addLocale** method to add the alphabet index of a new locale to the current index list.
```js
indexUtil.addLocale("ar")
```
......@@ -302,7 +302,7 @@ The **unitConvert** API is provided to help you implement measurement conversion
4. Obtain the index of a string.
Call the **getIndex** method to obtain the alphabet index of a string.
```js
var text = "access index";
indexUtil.getIndex(text);
......@@ -336,7 +336,7 @@ When a text is displayed in more than one line, [BreakIterator8](../reference/ap
Call the **getLineInstance** method to instantiate a **BreakIterator** object.
```js
var locale = "en-US"
var breakIterator = i18n.getLineInstance(locale);
......@@ -357,7 +357,7 @@ When a text is displayed in more than one line, [BreakIterator8](../reference/ap
Call the **current** method to obtain the current position of the **BreakIterator** object in the text being processed.
```js
var pos = breakIterator.current();
```
......@@ -383,7 +383,9 @@ When a text is displayed in more than one line, [BreakIterator8](../reference/ap
Call the **isBoundary** method to determine whether a position is a break point. If yes, **true** is returned and the **BreakIterator** object is moved to this position. If no, **false** is returned and the **BreakIterator** object is moved to a break point after this position.
```js
var isboundary = breakIterator.isBoundary(5);
```
```
\ No newline at end of file
......@@ -13,13 +13,13 @@ Use [Locale](../reference/apis/js-apis-intl.md#locale) APIs to maximize or minim
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Instantiates a **Locale** object. |
| ohos.intl | constructor(locale?: string, options?: options) | Instantiates a **Locale** object based on the locale parameter and options. |
| ohos.intl | toString(): string | Converts locale information into a string. |
| ohos.intl | maximize(): Locale | Maximizes locale information. |
| ohos.intl | minimize(): Locale | Minimizes locale information. |
| ohos.intl | constructor()<sup>8+</sup> | Instantiates a **Locale** object. |
| ohos.intl | constructor(locale?: string, options?: options) | Instantiates a **Locale** object based on the locale parameter and options. |
| ohos.intl | toString(): string | Converts locale information into a string. |
| ohos.intl | maximize(): Locale | Maximizes locale information. |
| ohos.intl | minimize(): Locale | Minimizes locale information. |
### How to Develop
......@@ -81,13 +81,13 @@ Use [DateTimeFormat](../reference/apis/js-apis-intl.md#datetimeformat) APIs to f
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **DateTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: DateTimeOptions) | Creates a **DateTimeFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(date: Date): string | Calculates the date and time based on the locale and other formatting-related attributes of the **DateTimeFormat** object. |
| ohos.intl | formatRange(startDate: Date, endDate: Date): string | Calculates the period based on the locale and other formatting-related attributes of the **DateTimeFormat** object. |
| ohos.intl | resolvedOptions(): DateTimeOptions | Obtains the related attributes of the **DateTimeFormat** object. |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **DateTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: DateTimeOptions) | Creates a **DateTimeFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(date: Date): string | Calculates the date and time based on the locale and other formatting-related attributes of the **DateTimeFormat** object. |
| ohos.intl | formatRange(startDate: Date, endDate: Date): string | Calculates the period based on the locale and other formatting-related attributes of the **DateTimeFormat** object. |
| ohos.intl | resolvedOptions(): DateTimeOptions | Obtains the related attributes of the **DateTimeFormat** object. |
### How to Develop
......@@ -144,12 +144,12 @@ Use [NumberFormat](../reference/apis/js-apis-intl.md#numberformat) APIs to forma
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **NumberFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: NumberOptions) | Creates a **NumberFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(number: number): string | Calculates the number based on the locale and other formatting-related attributes of the **NumberFormat** object. |
| ohos.intl | resolvedOptions(): NumberOptions | Obtains attributes of the **NumberFormat** object. |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **NumberFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: NumberOptions) | Creates a **NumberFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(number: number): string | Calculates the number based on the locale and other formatting-related attributes of the **NumberFormat** object. |
| ohos.intl | resolvedOptions(): NumberOptions | Obtains attributes of the **NumberFormat** object. |
### How to Develop
......@@ -195,12 +195,12 @@ Use [Collator](../reference/apis/js-apis-intl.md#collator8) APIs to sort strings
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **Collator** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: CollatorOptions)<sup>8+</sup> | Creates a **Collator** object and sets the locale and other related attributes. |
| ohos.intl | compare(first: string, second: string): number<sup>8+</sup> | Calculates the comparison result of two strings based on the locale and other attributes of the **Collator** object. |
| ohos.intl | resolvedOptions(): CollatorOptions<sup>8+</sup> | Obtains attributes of the **Collator** object. |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **Collator** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: CollatorOptions)<sup>8+</sup> | Creates a **Collator** object and sets the locale and other related attributes. |
| ohos.intl | compare(first: string, second: string): number<sup>8+</sup> | Calculates the comparison result of two strings based on the locale and other attributes of the **Collator** object. |
| ohos.intl | resolvedOptions(): CollatorOptions<sup>8+</sup> | Obtains attributes of the **Collator** object. |
### How to Develop
......@@ -214,7 +214,7 @@ Use [Collator](../reference/apis/js-apis-intl.md#collator8) APIs to sort strings
var collator = new intl.Collator();
```
Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md#collatoroptions8).
Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md#collatoroptions9).
```js
var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"});
......@@ -246,11 +246,11 @@ Use [PluralRules](../reference/apis/js-apis-intl.md#pluralrules8) APIs to determ
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **PluralRules** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: PluralRulesOptions)<sup>8+</sup> | Creates a **PluralRules** object and sets the locale and other related attributes. |
| ohos.intl | select(n: number): string<sup>8+</sup> | Determines the singular-plural type based on the locale and other formatting-related attributes of the **PluralRules** object. |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **PluralRules** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: PluralRulesOptions)<sup>8+</sup> | Creates a **PluralRules** object and sets the locale and other related attributes. |
| ohos.intl | select(n: number): string<sup>8+</sup> | Determines the singular-plural type based on the locale and other formatting-related attributes of the **PluralRules** object. |
### How to Develop
......@@ -264,7 +264,7 @@ Use [PluralRules](../reference/apis/js-apis-intl.md#pluralrules8) APIs to determ
var pluralRules = new intl.PluralRules();
```
Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md#pluralrulesoptions8).
Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md#pluralrulesoptions9).
```js
var pluralRules = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"});
......@@ -287,13 +287,13 @@ Use [RelativeTimeFormat](../reference/apis/js-apis-intl.md#relativetimeformat8)
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **RelativeTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: RelativeTimeFormatInputOptions)<sup>8+</sup> | Creates a **RelativeTimeFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(value: number, unit: string): string<sup>8+</sup> | Calculates the relative time format based on the locale and other formatting-related attributes of the **RelativeTimeFormat** object. |
| ohos.intl | formatToParts(value: number, unit: string): Array&lt;object&gt;<sup>8+</sup> | Returns each part of the relative time format based on the locale and other formatting-related attributes of the **RelativeTimeFormat** object. |
| ohos.intl | resolvedOptions(): RelativeTimeFormatResolvedOptions<sup>8+</sup> | Obtains attributes of the **RelativeTimeFormat** object. |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **RelativeTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: RelativeTimeFormatInputOptions)<sup>8+</sup> | Creates a **RelativeTimeFormat** object and sets the locale and other formatting-related attributes. |
| ohos.intl | format(value: number, unit: string): string<sup>8+</sup> | Calculates the relative time format based on the locale and other formatting-related attributes of the **RelativeTimeFormat** object. |
| ohos.intl | formatToParts(value: number, unit: string): Array&lt;object&gt;<sup>8+</sup> | Returns each part of the relative time format based on the locale and other formatting-related attributes of the **RelativeTimeFormat** object. |
| ohos.intl | resolvedOptions(): RelativeTimeFormatResolvedOptions<sup>8+</sup> | Obtains attributes of the **RelativeTimeFormat** object. |
### How to Develop
......@@ -307,7 +307,7 @@ Use [RelativeTimeFormat](../reference/apis/js-apis-intl.md#relativetimeformat8)
var relativeTimeFormat = new intl.RelativeTimeFormat();
```
Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md#relativetimeformatinputoptions8).
Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md#relativetimeformatinputoptions9).
```js
var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"});
......
......@@ -19,5 +19,5 @@ import StartOptions from '@ohos.application.StartOptions';
| Name| Readable| Writable| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- | -------- |
| [windowMode](js-apis-application-abilityConstant.md#AbilityConstant.WindowMode) | Yes| No| number | No| Window mode.|
| [windowMode](js-apis-application-abilityConstant.md#abilityconstantwindowmode) | Yes| No| number | No| Window mode.|
| displayId | Yes| No| number | No| Display ID.|
# Battery Info
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>**NOTE**
>
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The Battery Info module provides APIs for querying the charger type, battery health status, and battery charging status.
......@@ -25,7 +26,7 @@ Describes battery information.
| batterySOC | number | Yes | No | Battery state of charge (SoC) of the current device, in unit of percentage. |
| chargingStatus | [BatteryChargeState](#batterychargestate) | Yes | No | Battery charging state of the current device. |
| healthStatus | [BatteryHealthState](#batteryhealthstate) | Yes | No | Battery health state of the current device. |
| pluggedType | [BatteryPluggedType](#batterypluggertype) | Yes | No | Charger type of the current device. |
| pluggedType | [BatteryPluggedType](#batterypluggedtype) | Yes | No | Charger type of the current device. |
| voltage | number | Yes | No | Battery voltage of the current device, in unit of microvolt. |
| technology | string | Yes | No | Battery technology of the current device. |
| batteryTemperature | number | Yes | No | Battery temperature of the current device, in unit of 0.1°C. |
......@@ -43,12 +44,12 @@ var batterySoc = batteryInfo.batterySOC;
Enumerates charger types.
| Name | Default Value | Description |
| -------- | ------------- | ---------------- |
| NONE | 0 | Unknown type |
| AC | 1 | AC charger |
| USB | 2 | USB charger |
| WIRELESS | 3 | Wireless charger |
| Name | Default Value | Description |
| -------- | ------------- | ----------------- |
| NONE | 0 | Unknown type. |
| AC | 1 | AC charger. |
| USB | 2 | USB charger. |
| WIRELESS | 3 | Wireless charger. |
## BatteryChargeState
......
......@@ -500,6 +500,7 @@ Returns properties reflecting the locale and collation options of a **Collator**
| [CollatorOptions](#collatoroptions) | Properties of the **Collator** object.|
**Example**
```
var collator = new Intl.Collator("zh-Hans");
var options = collator.resolvedOptions();
......
......@@ -29,15 +29,15 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| volumeUuid | string | Yes | UUID of the volume.|
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| volumeUuid | string | Yes | UUID of the volume.|
**Return value**
| Type | Description |
| --------------------- | ---------------- |
| Promise&lt;number&gt; | Promise used to return the total size of the volume.|
| Type | Description |
| --------------------- | ---------------- |
| Promise&lt;number&gt; | Promise used to return the total size of the volume.|
**Example**
......@@ -66,10 +66,10 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| volumeUuid | string | Yes | UUID of the volume. |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total size of the volume.|
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| volumeUuid | string | Yes | UUID of the volume. |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total size of the volume.|
**Example**
......@@ -97,15 +97,15 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| volumeUuid | string | Yes | UUID of the volume.|
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| volumeUuid | string | Yes | UUID of the volume.|
**Return value**
| Type | Description |
| --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the available space of the volume.|
| Type | Description |
| --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the available space of the volume.|
**Example**
......@@ -135,10 +135,10 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | ---------------------------- |
| volumeUuid | string | Yes | UUID of the volume. |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available space of the volume.|
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | ---------------------------- |
| volumeUuid | string | Yes | UUID of the volume. |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available space of the volume.|
**Example**
......@@ -166,15 +166,15 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | -------- |
| packageName | string | Yes | Bundle name of the application.|
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | -------- |
| packageName | string | Yes | Bundle name of the application.|
**Return value**
| Type | Description |
| ------------------------------------------ | -------------------------- |
| Promise&lt;[Bundlestats](#bundlestats)&gt; | Promise used to return the space information obtained.|
| Type | Description |
| ------------------------------------------ | -------------------------- |
| Promise&lt;[Bundlestats](#bundlestats)&gt; | Promise used to return the space information obtained.|
**Example**
......@@ -203,10 +203,10 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| packageName | string | Yes | Bundle name of the application.|
| callback | callback:AsyncCallback&lt;[Bundlestats](#bundlestats)&gt; | Yes | Callback invoked to return the space information obtained.|
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| packageName | string | Yes | Bundle name of the application.|
| callback | callback:AsyncCallback&lt;[Bundlestats](#bundlestats)&gt; | Yes | Callback invoked to return the space information obtained.|
**Example**
......@@ -228,9 +228,9 @@ Asynchronously obtains space information of the current third-party application.
**Return value**
| Type | Description |
| ------------------------------------------ | -------------------------- |
| Promise&lt;[Bundlestats](#bundlestats)&gt; | Promise used to return the space information obtained. |
| Type | Description |
| ------------------------------------------ | -------------------------- |
| Promise&lt;[Bundlestats](#bundlestats)&gt; | Promise used to return the space information obtained. |
**Example**
......@@ -249,9 +249,9 @@ Asynchronously obtains space information of the current third-party application.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| callback | callback:AsyncCallback&lt;[BundleStats](#bundlestats)&gt; | Yes | Callback invoked to return the space information obtained. |
| Name | Type | Mandatory | Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| callback | callback:AsyncCallback&lt;[BundleStats](#bundlestats)&gt; | Yes | Callback invoked to return the space information obtained. |
**Example**
......@@ -294,9 +294,9 @@ This is a system API and cannot be called by third-party applications.
**Return value**
| Type | Description |
| --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the total space of the built-in memory card. |
| Type | Description |
| --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the total space of the built-in memory card. |
**Example**
......@@ -321,9 +321,9 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------ | ---- | ------------------------ |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total space of the built-in memory card.|
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------ | ---- | ------------------------ |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total space of the built-in memory card.|
**Example**
......@@ -351,9 +351,9 @@ This is a system API and cannot be called by third-party applications.
**Return value**
| Type | Description |
| --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the available space of the built-in memory card.|
| Type | Description |
| --------------------- | ------------------ |
| Promise&lt;number&gt; | Promise used to return the available space of the built-in memory card.|
**Example**
......@@ -379,9 +379,9 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | ------------------------- |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available space of the built-in memory card.|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | ------------------------- |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the available space of the built-in memory card.|
**Example**
......@@ -408,9 +408,9 @@ This is a system API and cannot be called by third-party applications.
**Return value**
| Type | Description |
| --------------------- | ---------------- |
| Promise&lt;number&gt; | Promise used to return the system space obtained.|
| Type | Description |
| --------------------- | ---------------- |
| Promise&lt;number&gt; | Promise used to return the system space obtained.|
**Example**
......@@ -438,9 +438,9 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback used to return the system space obtained.|
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| callback | callback:AsyncCallback&lt;number&gt; | Yes | Callback used to return the system space obtained.|
**Example**
......@@ -467,15 +467,15 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| userId | number | No | User ID.<br>Value:<br>-&nbsp; Set this parameter to the ID of the user to be queried.<br>-&nbsp; If no value is specified, information about the current user is queried.|
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| userId | number | No | User ID.<br>Value:<br>-&nbsp; Set this parameter to the ID of the user to be queried.<br>-&nbsp; If no value is specified, information about the current user is queried.|
**Return value**
| Type | Description |
| --------------------- | ---------------- |
| Promise&lt;[StorageStats](#StorageStats)&gt; | Promise used to return the information obtained.|
| Type | Description |
| --------------------- | ---------------- |
| Promise&lt;[StorageStats](#storagestats9)&gt; | Promise used to return the information obtained.|
**Example**
......@@ -504,10 +504,10 @@ This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| userId | number | No | User ID.<br>Value:<br>-&nbsp; Set this parameter to the ID of the user to be queried.<br>-&nbsp; If no value is specified, information about the current user is queried. |
| callback | callback:AsyncCallback&lt;[StorageStats](#StorageStats)&gt; | Yes | Callback invoked to return the information obtained.|
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| userId | number | No | User ID.<br>Value:<br>-&nbsp; Set this parameter to the ID of the user to be queried.<br>-&nbsp; If no value is specified, information about the current user is queried. |
| callback | callback:AsyncCallback&lt;[StorageStats](#storagestats9)&gt; | Yes | Callback invoked to return the information obtained.|
**Example**
......
# animate<a name="EN-US_TOPIC_0000001127125042"></a>
# animate
The **<animate\>** component is used to apply animation to an **<svg\>** component.
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>![](../../public_sys-resources/icon-note.gif) **NOTE**
>
>This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions<a name="section11257113618419"></a>
## Required Permissions
None
## Child Components<a name="section9288143101012"></a>
## Child Components
Not supported
## Attributes<a name="section2907183951110"></a>
## Attributes
<a name="table20633101642315"></a>
<table><thead align="left"><tr id="row663331618238"><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p id="aaf1247770b244944bbcc9f28d9a6f00b"><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a><a name="aaf1247770b244944bbcc9f28d9a6f00b"></a>Name</p>
......@@ -193,7 +194,7 @@ Not supported
</tbody>
</table>
## Example<a name="section360556124815"></a>
## Example
```
<!-- xxx.hml -->
......
# Interpolation Calculation
Interpolation calculation can be implemented to set the animation interpolation curve, which is used to construct the step curve, cubic Bezier curve, and spring curve objects.
> **NOTE**
>
> This event is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```js
import Curves from '@ohos.curves'
```
## Curves.initCurve<sup>9+</sup>
initCurve(curve?: Curve): ICurve
Implements initialization for the interpolation curve, which is used to create an interpolation curve object based on the input parameter.
**Parameters**
| Name| Type | Mandatory| Default Value | Description |
| ------ | ------------------------------------------------------------ | ---- | ------------ | ---------- |
| curve | [Curve](#curve-enums)| No | Curve.Linear | Curve type.|
**Return value**
| Type | Description |
| ---------------------------------- | ---------------- |
| [ICurve](#icurve) | Interpolation object of the curve.|
**Example**
```ts
import Curves from '@ohos.curves'
Curves.initCurve(Curve.EaseIn) // Create an ease-in curve.
```
## Curves.stepsCurve<sup>9+</sup>
stepsCurve(count: number, end: boolean): ICurve
Constructs a step curve object.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------- | ----| ------------------------------------------------------------ |
| count | number | Yes | Number of steps. Must be a positive integer. |
| end | boolean | Yes | Whether the step change occurs at the start or end point of each interval.<br>- **true**: The step change occurs at the end point.<br>- **false**: The step change occurs at the start point.|
**Return value**
| Type | Description |
| ---------------------------------- | ---------------- |
| [ICurve](#icurve) | Curve object.|
**Example**
```ts
import Curves from '@ohos.curves'
Curves.stepsCurve(9, true) // Create a step curve.
```
## Curves.cubicBezierCurve<sup>9+</sup>
cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve
Constructs a third-order Bezier curve object. The curve value must be between 0 and 1.
**Parameters**
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | -------------- |
| x1 | number | Yes | Horizontal coordinate of the first point on the Bezier curve.|
| y1 | number | Yes | Vertical coordinate of the first point on the Bezier curve.|
| x2 | number | Yes | Horizontal coordinate of the second point on the Bezier curve.|
| y2 | number | Yes | Vertical coordinate of the second point on the Bezier curve.|
**Return value**
| Type | Description |
| ---------------------------------- | ---------------- |
| [ICurve](#icurve) | Curve object.|
**Example**
```ts
import Curves from '@ohos.curves'
Curves.cubicBezierCurve(0.1, 0.0, 0.1, 1.0) // Create a cubic Bezier curve.
```
## Curves.springCurve<sup>9+</sup>
springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve
Constructs a spring curve object.
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ----- |
| velocity | number | Yes | Initial velocity. It is a parameter that affects the elastic dynamic effect by external factors. It aims to ensure the smooth transition from the previous motion state to the elastic dynamic effect.|
| mass | number | Yes | Quality. The force object of the elastic system will have inertia effects on the elastic system. The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position.|
| stiffness | number | Yes | Stiffness. It is the degree to which an object deforms by resisting the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the equilibrium position.|
| damping | number | Yes | Damping. It is a pure number and has no real physical meaning. It is used to describe the oscillation and attenuation of the system after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion and the smaller the oscillation amplitude.|
**Return value**
| Type | Description |
| ---------------------------------- | ---------------- |
| [ICurve](#icurve)| Curve object.|
**Example**
```ts
import Curves from '@ohos.curves'
Curves.springCurve(100, 1, 228, 30) // Create a spring curve.
```
## ICurve
### interpolate
interpolate(fraction: number): number
Calculation function of the interpolation curve. Passing a normalized time parameter to this function returns the current interpolation.
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | -------------------------------------------- |
| fraction | number | Yes | Current normalized time. The value ranges from 0 to 1.|
**Return value**
| Type | Description |
| ------ | ------------------------------------ |
| number | The curve interpolation corresponding to the normalized time point is returned.|
**Example**
```ts
import Curves from '@ohos.curves'
let curve = Curves.initCurve(Curve.EaseIn) // Create an ease-in curve.
let value: number = curve.interpolate(0.5) // Calculate the interpolation for half of the time.
```
## Curves.init<sup>(deprecated)</sup>
init(curve?: Curve): string
Implements initialization to create a curve object based on the input parameter. This API is deprecated since API version 9. Use [Curves.initCurve](#curvesinitcurve9) instead.
**Parameters**
| Name| Type | Mandatory| Default Value | Description |
| ------ | ------------------------------------------------------------ | ---- | ------------ | ---------- |
| curve |[Curve](#curve-enums)| No | Curve.Linear | Curve type.|
## Curves.steps<sup>(deprecated)</sup>
steps(count: number, end: boolean): string
Constructs a step curve object. This API is deprecated since API version 9. Use [Curves.stepsCurve](# curvesstepscurve9) instead.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------- | ----| ------------------------------------------------------------ |
| count | number | Yes | Number of steps. Must be a positive integer. |
| end | boolean | Yes | Whether the step change occurs at the start or end of each interval.<br>- **true**: The step change occurs at the end point.<br>- **false**: The step change occurs at the start point.|
## Curves.cubicBezier<sup>(deprecated)</sup>
cubicBezier(x1: number, y1: number, x2: number, y2: number): string
Constructs a cubic Bezier curve object. The curve value must range from 0 to 1. This API is deprecated since API version 9. Use [Curves.cubicBezierCurve](#curvescubicbeziercurve9) instead.
**Parameters**
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | -------------- |
| x1 | number | Yes | Horizontal coordinate of the first point on the Bezier curve.|
| y1 | number | Yes | Vertical coordinate of the first point on the Bezier curve.|
| x2 | number | Yes | Horizontal coordinate of the second point on the Bezier curve.|
| y2 | number | Yes | Vertical coordinate of the second point on the Bezier curve.|
## Curves.spring<sup>(deprecated)</sup>
spring(velocity: number, mass: number, stiffness: number, damping: number): string
Constructs a spring curve object. This API is deprecated since API version 9. Use [Curves.cubicBezierCurve](#curvescubicbeziercurve9) instead.
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ----- |
| velocity | number | Yes | Initial velocity. It is a parameter that affects the elastic dynamic effect by external factors. It aims to ensure the smooth transition from the previous motion state to the elastic dynamic effect.|
| mass | number | Yes | Quality. The force object of the elastic system will have inertia effects on the elastic system. The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position.|
| stiffness | number | Yes | Stiffness. It is the degree to which an object deforms by resisting the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the equilibrium position.|
| damping | number | Yes | Damping. It is a pure number and has no real physical meaning. It is used to describe the oscillation and attenuation of the system after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion and the smaller the oscillation amplitude.|
## Curve
| Name | Description |
| ------------------- | ---------------------------------------- |
| Linear | The animation speed keeps unchanged. |
| Ease | The animation starts slowly, accelerates, and then slows down towards the end. The cubic-bezier curve (0.25, 0.1, 0.25, 1.0) is used.|
| EaseIn | The animation starts at a low speed and then picks up speed until the end. The cubic-bezier curve (0.42, 0.0, 1.0, 1.0) is used.|
| EaseOut | The animation ends at a low speed. The cubic-bezier curve (0.0, 0.0, 0.58, 1.0) is used.|
| EaseInOut | The animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used.|
| FastOutSlowIn | The animation uses the standard cubic-bezier curve (0.4, 0.0, 0.2, 1.0).|
| LinearOutSlowIn | The animation uses the deceleration cubic-bezier curve (0.0, 0.0, 0.2, 1.0).|
| FastOutLinearIn | The animation uses the acceleration cubic-bezier curve (0.4, 0.0, 1.0, 1.0).|
| ExtremeDeceleration | The animation uses the extreme deceleration cubic-bezier curve (0.0, 0.0, 0.0, 1.0).|
| Sharp | The animation uses the sharp cubic-bezier curve (0.33, 0.0, 0.67, 1.0).|
| Rhythm | The animation uses the rhythm cubic-bezier curve (0.7, 0.0, 0.2, 1.0).|
| Smooth | The animation uses the smooth cubic-bezier curve (0.4, 0.0, 0.4, 1.0).|
| Friction | The animation uses the friction cubic-bezier curve (0.2, 0.0, 0.2, 1.0).|
## Example
```ts
// xxx.ets
import Curves from '@ohos.curves'
@Entry
@Component
struct ImageComponent {
@State widthSize: number = 200
@State heightSize: number = 200
build() {
Column() {
Text()
.margin({top:100})
.width(this.widthSize)
.height(this.heightSize)
.backgroundColor(Color.Red)
.onClick(()=> {
let curve = Curves.cubicBezierCurve(0.25, 0.1, 0.25, 1.0);
this.widthSize = curve.interpolate(0.5) * this.widthSize;
this.heightSize = curve.interpolate(0.5) * this.heightSize;
})
.animation({duration: 2000 , curve: Curves.stepsCurve(9, true)})
}.width("100%").height("100%")
}
}
```
![en-us_image_0000001212058456](figures/en-us_image_0000001212058456.gif)
# Matrix Transformation
Matrix transformation enables you to rotate, scale, skew, or translate an image.
> **NOTE**
>
> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```ts
import matrix4 from '@ohos.matrix4'
```
## matrix4.init
init(array: Array&lt;number&gt;): Matrix4Transit
Matrix constructor, which is used to create a 4x4 matrix by using the input parameter. Column-major order is used.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------- | ---- | ------------------------------------------------------------ |
| array | Array&lt;number&gt; | Yes | A number array whose length is 16 (4 x 4). For details, see **array**.<br>Default value:<br>[1, 0, 0, 0,<br>0, 1, 0, 0,<br>0, 0, 1, 0,<br>0, 0, 0, 1] |
**Return value**
| Type | Description |
| -------------- | ---------------------------- |
| Matrix4Transit | 4x4 matrix object created based on the input parameter.|
**array**
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | -------------------- |
| m00 | number | Yes | Scaling value of the x-axis. Defaults to **1** for the identity matrix. |
| m01 | number | Yes | The second value, which is affected by the rotation of the x, y, and z axes. |
| m02 | number | Yes | The third value, which is affected by the rotation of the x, y, and z axes. |
| m03 | number | Yes | Meaningless. |
| m10 | number | Yes | The fifth value, which is affected by the rotation of the x, y, and z axes. |
| m11 | number | Yes | Scaling value of the y-axis. Defaults to **1** for the identity matrix. |
| m12 | number | Yes | The seventh value, which is affected by the rotation of the x, y, and z axes. |
| m13 | number | Yes | Meaningless. |
| m20 | number | Yes | The ninth value, which is affected by the rotation of the x, y, and z axes. |
| m21 | number | Yes | The tenth value, which is affected by the rotation of the x, y, and z axes. |
| m22 | number | Yes | Scaling value of the z-axis. Defaults to **1** for the identity matrix. |
| m23 | number | Yes | Meaningless. |
| m30 | number | Yes | Translation value of the x-axis, in px. Defaults to **0** for the identity matrix.|
| m31 | number | Yes | Translation value of the y-axis, in px. Defaults to **0** for the identity matrix.|
| m32 | number | Yes | Translation value of the z-axis, in px. Defaults to **0** for the identity matrix.|
| m33 | number | Yes | Valid in homogeneous coordinates, presenting the perspective projection effect. |
**Example**
```ts
import matrix4 from '@ohos.matrix4'
// Create a 4x4 matrix.
let matrix = matrix4.init([1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0])
@Entry
@Component
struct Tests {
build() {
Column() {
Image($r("app.media.zh"))
.width("40%")
.height(100)
.transform(matrix)
}
}
}
```
## matrix4.identity
identity(): Matrix4Transit
Matrix initialization function. Can return an identity matrix object.
**Return value**
| Type | Description |
| -------------- | -------------- |
| Matrix4Transit | Identity matrix object.|
**Example**
```ts
// The effect of matrix 1 is the same as that of matrix 2.
import matrix4 from '@ohos.matrix4'
let matrix1 = matrix4.init([1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0])
let matrix2 = matrix4.identity()
@Entry
@Component
struct Tests {
build() {
Column() {
Image($r("app.media.zh"))
.width("40%")
.height(100)
.transform(matrix1)
Image($r("app.media.zh"))
.width("40%")
.height(100)
.margin({ top: 150 })
.transform(matrix2)
}
}
}
```
## matrix4.copy
copy(): Matrix4Transit
Matrix copy function, which is used to copy the current matrix object.
**Return value**
| Type | Description |
| -------------- | -------------------- |
| Matrix4Transit | Copy object of the current matrix.|
**Example**
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
private matrix1 = Matrix4.identity().translate({x:100})
private matrix2 = this.matrix1.copy().scale({x:2})
build() {
Column() {
Image($r("app.media.bg1"))
.width("40%")
.height(100)
.transform(this.matrix1)
Image($r("app.media.bg2"))
.width("40%")
.height(100)
.margin({top:50})
.transform(this.matrix2)
}
}
}
```
![en-us_image_0000001256858419](figures/en-us_image_0000001256858419.png)
## Matrix4
### combine
combine(matrix: Matrix4): Matrix4Transit
Matrix overlay function, which is used to overlay the effects of two matrices to generate a new matrix object.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------ |
| matrix | Matrix4 | Yes | Matrix object to be overlaid.|
**Return value**
| Type | Description |
| -------------- | ------------------ |
| Matrix4Transit | Object after matrix overlay.|
**Example**
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
private matrix1 = matrix4.identity().translate({x:200}).copy()
private matrix2 = matrix4.identity().scale({x:2}).copy()
build() {
Column() {
// Before matrix transformation
Image($r("app.media.icon"))
.width("40%")
.height(100)
.margin({top:50})
// Translate the x-axis by 200px, and then scale down the x-axis twice.
Image($r("app.media.icon"))
.transform(this.matrix1.combine(this.matrix2))
.width("40%")
.height(100)
.margin({top:50})
}
}
}
```
![en-us_image_0000001212378428](figures/en-us_image_0000001212378428.png)
### invert
invert(): Matrix4Transit
Matrix inverse function. Can return an inverse matrix of the current matrix object, that is, get an opposite effect.
**Return value**
| Type | Description |
| -------------- | ---------------------- |
| Matrix4Transit | Inverse matrix object of the current matrix.|
**Example**
```ts
import matrix4 from '@ohos.matrix4'
// The effect of matrix 1 (width scaled up by 2x) is opposite to that of matrix 2 (width scaled down by 2x).
let matrix1 = matrix4.identity().scale({x:2})
let matrix2 = matrix1.invert()
@Entry
@Component
struct Tests {
build() {
Column() {
Image($r("app.media.zh"))
.width(200)
.height(100)
.transform(matrix1)
.margin({ top: 100 })
Image($r("app.media.zh"))
.width(200)
.height(100)
.margin({ top: 150 })
.transform(matrix2)
}
}
}
```
### translate
translate({x?: number, y?: number, z?: number}): Matrix4Transit
Matrix translation function, which is used to add the translation effect to the x, y, and z axes of the current matrix.
**Parameter**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------- |
| x | number | No | Translation distance of the x-axis, in px.<br>Default value: **0**|
| y | number | No | Translation distance of the y-axis, in px.<br>Default value: **0**|
| z | number | No | Translation distance of the z-axis, in px.<br>Default value: **0**|
**Return value**
| Type | Description |
| -------------- | ---------------------------- |
| Matrix4Transit | Matrix object after the translation effect is added.|
**Example**
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
private matrix1 = matrix4.identity().translate({x:100, y:200, z:30})
build() {
Column() {
Image($r("app.media.bg1")).transform(this.matrix1)
.width("40%")
.height(100)
}
}
}
```
![en-us_image_0000001212058494](figures/en-us_image_0000001212058494.png)
### scale
scale({x?: number, y?: number, z?: number, centerX?: number, centerY?: number}): Matrix4Transit
Matrix scaling function, which is used to add the scaling effect to the x, y, and z axes of the current matrix.
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- | --------------------------------- |
| x | number | No | Scaling multiple of the x-axis.<br>Default value: **1** |
| y | number | No | Scaling multiple of the y-axis.<br>Default value: **1** |
| z | number | No | Scaling multiple of the z-axis.<br>Default value: **1** |
| centerX | number | No | X coordinate of the center point.<br>Default value: **0**|
| centerY | number | No | Y coordinate of the center point.<br>Default value: **0**|
**Return value**
| Type | Description |
| -------------- | ---------------------------- |
| Matrix4Transit | Matrix object after the scaling effect is added.|
**Example**
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
private matrix1 = matrix4.identity().scale({x:2, y:3, z:4, centerX:50, centerY:50})
build() {
Column() {
Image($r("app.media.bg1")).transform(this.matrix1)
.width("40%")
.height(100)
}
}
}
```
![zh-cn_image_0000001219864131](figures/zh-cn_image_0000001219864131.png)
### rotate
rotate({x?: number, y?: number, z?: number, angle?: number, centerX?: Length, centerY?: Length}): Matrix4Transit
Matrix rotation function, which is used to add the rotation effect to the x, y, and z axes of the current matrix.
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- | --------------------------------- |
| x | number | No | X coordinate of the rotation axis vector.<br>Default value: **1** |
| y | number | No | Y coordinate of the rotation axis vector.<br>Default value: **1** |
| z | number | No | Z coordinate of the rotation axis vector.<br>Default value: **1** |
| angle | number | No | Rotation angle.<br>Default value: **0** |
| centerX | number | No | X coordinate of the center point.<br>Default value: **0**|
| centerY | number | No | Y coordinate of the center point.<br>Default value: **0**|
**Return value**
| Type | Description |
| -------------- | ---------------------------- |
| Matrix4Transit | Matrix object after the rotation effect is added.|
**Example**
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
private matrix1 = matrix4.identity().rotate({x:1, y:1, z:2, angle:30})
build() {
Column() {
Image($r("app.media.bg1")).transform(this.matrix1)
.width("40%")
.height(100)
}.width("100%").margin({top:50})
}
}
```
![en-us_image_0000001211898504](figures/en-us_image_0000001211898504.png)
### transformPoint
transformPoint(point: Point): Point
Matrix point transformation function, which is used to apply the current transformation effect to a coordinate point.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ----- | ---- | ------------------ |
| point | Point | Yes | Point to be transformed.|
**Return value**
| Type | Description |
| ----- | ---------------- |
| Point | Point object after matrix transformation|
**Example**
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
import prompt from '@system.prompt'
@Entry
@Component
struct Test {
private matrix1 = matrix4.identity().transformPoint([100, 10])
build() {
Column() {
Button("get Point")
.onClick(() => {
prompt.showToast({message:JSON.stringify(this.matrix1),duration:2000})
}).backgroundColor(0x2788D9)
}.width("100%").padding(50)
}
}
```
![en-us_image_0000001212218464](figures/en-us_image_0000001212218464.gif)
......@@ -4,31 +4,31 @@
The framework provides four pixel units, with vp as the reference data unit.
| Name | Description |
| Name | Description |
| -------- | -------- |
| px | Physical pixel unit of the screen. |
| vp | Pixels specific to the screen density, which are converted into physical pixels of the screen based on the screen pixel density. |
| fp | Font pixel, which is similar to vp and varies according to the system font size. |
| lpx | Logical pixel unit of the window. It is the ratio of the actual screen width to the logical width (configured by [designWidth](../ui/ts-framework-js-tag.md)). For example, if designWidth is set to 720, then 1lpx is equal to 2px for a screen with an actual width of 1440 physical pixels. |
| px | Physical pixel unit of the screen. |
| vp | Pixels specific to the screen density, which are converted into physical pixels of the screen based on the screen pixel density. |
| fp | Font pixel, which is similar to vp and varies according to the system font size. |
| lpx | Logical pixel unit of the window. It is the ratio of the actual screen width to the logical width (configured by [designWidth](../quick-start/package-structure.md)). For example, if designWidth is set to 720, then 1lpx is equal to 2px for a screen with an actual width of 1440 physical pixels. |
## Pixel Unit Conversion
Conversion from other pixel units to px is supported.
| API | Description |
| API | Description |
| -------- | -------- |
| vp2px(value : number) : number | Converts a value in units of vp to a value in units of px. |
| px2vp(value : number) : number | Converts a value in units of px to a value in units of vp. |
| fp2px(value : number) : number | Converts a value in units of fp to a value in units of px. |
| px2fp(value : number) : number | Converts a value in units of px to a value in units of fp. |
| lpx2px(value : number) : number | Converts a value in units of lpx to a value in units of px. |
| px2lpx(value : number) : number | Converts a value in units of px to a value in units of lpx. |
| vp2px(value : number) : number | Converts a value in units of vp to a value in units of px. |
| px2vp(value : number) : number | Converts a value in units of px to a value in units of vp. |
| fp2px(value : number) : number | Converts a value in units of fp to a value in units of px. |
| px2fp(value : number) : number | Converts a value in units of px to a value in units of fp. |
| lpx2px(value : number) : number | Converts a value in units of lpx to a value in units of px. |
| px2lpx(value : number) : number | Converts a value in units of px to a value in units of lpx. |
## Example
```ts
// xxx.ets
@Entry
......
# Code of Conduct<a name="EN-US_TOPIC_0000001055368056"></a>
# Code of Conduct
The OpenHarmony community complies with the code of conduct specified in [Contributor Covenant](https://contributor-covenant.org/) of the open source community. For details, see [https://www.contributor-covenant.org/version/1/4/code-of-conduct/](https://www.contributor-covenant.org/version/1/4/code-of-conduct/).
......
# How to Contribute<a name="EN-US_TOPIC_0000001055208082"></a>
# How to Contribute
## Contributing Code<a name="en-us_topic_0000001053868136_section10170447161315"></a>
## Contributing Code
## Before You Start<a name="en-us_topic_0000001053868136_section2734837154520"></a>
## Before You Start
**Signing the Developer Certificate of Origin**
......@@ -12,25 +12,25 @@ Click [here](https://dco.openharmony.cn/#/sign) to sign the DCO, and click [here
**Code of Conduct**
OpenHarmony is an open source community that relies entirely on the friendly, welcoming environment of the community. Read and abide by the community's [Code of Conduct](code-of-conduct.md#EN-US_TOPIC_0000001055368056) before contributing to the community.
OpenHarmony is an open source community that relies entirely on the friendly, welcoming environment of the community. Read and abide by the community's [Code of Conduct](code-of-conduct.md) before contributing to the community.
## **Finding the SIG Group You Are Interested**
For details about how to participate in Special Interest Group (SIG), see **SIG Governance**.
## Starting Contributing<a name="en-us_topic_0000001053868136_section184321756134618"></a>
## Starting Contributing
For details about how to contribute to code, see [Code Contributing ](code-contribution.md).
For details about how to contribute to code, see [Code Contributing ](code-contribution.md).
## Auto-Test
For details about how to develop test cases based on test requirements, see [Test Subsystem](../readme/test.md).
## Contributing Documents<a name="en-us_topic_0000001053868136_section11234185012131"></a>
## Contributing Documents
For details, see [Documentation Contribution](documentation-contribution.md).
For details, see [Documentation Contribution](documentation-contribution.md).
## Communication in Community<a name="en-us_topic_0000001053868136_section98614457153"></a>
## Communication in Community
For details, see [Communication in Community](communication-in-community.md#EN-US_TOPIC_0000001054608107).
For details, see [Communication in Community](communication-in-community.md).
......@@ -96,7 +96,7 @@ import call from '@ohos.telephony.call';
| Name | Type | Readable| Writable| Description |
| ---------------- | ----------------------------------------- | ---- | ---- | ------------------------------------------ |
| pluggedType | [BatteryPluggedType](#batterypluggedtype) | Yes | No | Charger type of the current device. |
| pluggedType | [BatteryPluggedType]\(#batterypluggedtype) | Yes | No | Charger type of the current device. |
| isBatteryPresent | boolean | Yes | No | Whether the battery is supported or present.|
## Methods
......@@ -270,7 +270,7 @@ The following is an example of the custom type of a key-value pair.
| Name | Type | Readable| Writable| Description |
| ------------ | ------------------- | ---- | ---- | ------------------------------------------------------------ |
| parameterUrl | string | Yes | Yes | Media output URI. Supported:<br>1. Relative path whose protocol type is `internal`. Example: <br/>Temporary directory: internal://cache/test.mp4<br>2. Absolute path. Example:<br/>file:///data/data/ohos.xxx.xxx/files/test.mp4|
| parameterOne | [CustomEnum](#Enumeration)| Yes | Yes | Describe the attributes. The requirements are similar to those for the parameter description. |
| parameterOne | [CustomEnum](#enums) | Yes | Yes | Describe the attributes. The requirements are similar to those for the parameter description. |
## Change History
| Change Description| Date|
......
# Video Recording<a name="EN-US_TOPIC_0000001054754827"></a>
## When to Use<a name="en-us_topic_0000001051451869_section186634310418"></a>
Use the camera module APIs to capture video streams.
## Available APIs<a name="en-us_topic_0000001051451869_section125479541744"></a>
For details, see the available APIs described in development guidelines on photographing.
## Limitations and Constraints<a name="en-us_topic_0000001051451869_section1165911177314"></a>
None
## How to Develop<a name="en-us_topic_0000001051451869_section1196016315516"></a>
1. Perform step 1 through step 4 described in development guidelines on photographing.
2. Obtain the **FrameConfig** instance for audio recording.
```
/* Obtain the surface from the recorder. */
Surface *surface = recorder_->GetSurface(0);
surface->SetWidthAndHeight(1920, 1080);
surface->SetQueueSize(3);
surface->SetSize(1024 * 1024);
/* Add the surface to the FrameConfig instance. */
FrameConfig *fc = new FrameConfig(FRAME_CONFIG_RECORD);
fc->AddSurface(*surface);
```
3. Start and stop video recording.
```
stateCallback->camera_->TriggerLoopingCapture(*fc); // Start recording.
stateCallback->camera_->StopLoopingCapture(); // Stop recording.
```
# Use Case<a name="EN-US_TOPIC_0000001055686082"></a>
- For details about the development board, compilation, burning, and image running, see [Quick Start](../quick-start/Readme-EN.md). A compilation result file of sample code is stored in **out/ipcamera\_hi3518ev300/dev\_tools/bin/camera\_sample**. You can copy the file to a TF card, or modify the compilation script of **camera\_sample** to copy the result to **rootfs.img**.
Modify **output\_dir** in **applications/sample/camera/media/BUILD.gn**.
- Before: **output\_dir = "$root\_out\_dir/dev\_tools"**
- After: **output\_dir = "$root\_out\_dir/"**
Recompile the source code repository and burn the code into the development board. Then you can find the **camera\_sample** file in the **bin** directory of the board.
- The sample code for camera development is stored in **applications/sample/camera/media/camera\_sample.cpp**.
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>You should insert a TF card \(maximum capacity: 128 GB\) for photographing and video recording functions. After the system is started, the TF card is automatically mounted to the **/sdcard** directory. If the TF card is inserted after the system is started, you have to manually mount the TF card. To view the photos and videos in the TF card, copy the content to a computer. The preview function does not require a TF card.
1. Run the **cd** command to go to the end path of the executable program and start **camera\_sample** by running the command in the following figure.
**Figure 1** Starting camera\_sample<a name="en-us_topic_0000001055301733_fig380985885020"></a>
![](figures/starting-camera_sample.png "starting-camera_sample")
The control commands are displayed as shown in the preceding figure. Press **S** to stop the current operation \(including video recording and preview\), and press **Q** to exit the program.
2. Press **1** to take a photo in JPG format. The photo is saved in the **/sdcard** directory and named **Capture\***.
**Figure 2** Serial port logs displayed after the photographing command is executed<a name="en-us_topic_0000001055301733_fig17819185018384"></a>
![](figures/serial-port-logs-displayed-after-the-photographing-command-is-executed.png "serial-port-logs-displayed-after-the-photographing-command-is-executed")
To view the saved file, exit the program and enter the file system. To start the program again, return to the previous step.
**Figure 3** Saved files<a name="en-us_topic_0000001055301733_fig166391743154619"></a>
![](figures/saved-files.png "saved-files")
3. Press **2** to start recording. The video file is in MP4 format and saved in the **/sdcard** directory with the name **Record\***. Press **S** to stop recording.
**Figure 4** Serial port logs displayed after the recording command is executed<a name="en-us_topic_0000001055301733_fig6340814174317"></a>
![](figures/serial-port-logs-displayed-after-the-recording-command-is-executed.png "serial-port-logs-displayed-after-the-recording-command-is-executed")
4. Press **Q** to exit.
**Figure 5** Serial port logs displayed after the exit command is executed<a name="en-us_topic_0000001055301733_fig1755682174514"></a>
![](figures/serial-port-logs-displayed-after-the-exit-command-is-executed.png "serial-port-logs-displayed-after-the-exit-command-is-executed")
# Camera Control Overview<a name="EN-US_TOPIC_0000001055366100"></a>
This document describes how to use the IoT camera development board and the built-in camera of the development kit to implement photographing and video recording.
You can perform operations provided in [Use Case](device-iotcamera-control-example.md) to learn more about development board peripheral control and then develop devices such as cameras.
If you want to view the sample effect first, see [Use Case](device-iotcamera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the next section.
For details about basic concepts for camera development, see [Camera Overview](../subsystems/subsys-multimedia-camera-overview.md).
# Kernel Coding Specification<a name="EN-US_TOPIC_0000001079036432"></a>
# Kernel Coding Specification
This kernel coding specification is developed based on the general programming specifications in the industry. It defines the programming styles for kernel developers to follow.
......
......@@ -94,7 +94,7 @@ For device with 128 KB to 128 MB of memory, the OpenHarmony lite kernel is recom
- Secure boot must be enabled, and the trusted root must be in the chip and cannot be modified. In addition, you must consider the impact of secure upgrade (if available) on secure boot, that is, the signature or hash value of an image file must be updated after a secure upgrade.
## Data security
## Data Security
### Security Mechanism
......
# Privacy Protection<a name="EN-US_TOPIC_0000001083754024"></a>
# Privacy Protection
## Overview<a name="section13200134331414"></a>
## Overview
Personal data plays an increasingly important role in social economy and daily life along with the development of the Internet and informatization. Meanwhile, personal data leakage risks are increasing. As consumer product developers, you shall take more effective measures to protect users' personal data and improve their trust in your products. To protect consumers' privacy and improve their experience on privacy, you should set high-level privacy protection policies for your product.
......@@ -49,7 +49,7 @@ Personal data plays an increasingly important role in social economy and daily l
- Users provide information proactively, such as scenarios where a user enters their identification number and bank card number to bind the bank card.
## Data Classification<a name="section2371104991511"></a>
## Data Classification
Data is classified into five levels: very high, high, moderate, low, and public based on the data protection objectives and consequences \(the impact of legal risks caused by data leakage or damage on individuals, organizations, or the public\).
......@@ -116,7 +116,7 @@ Data is classified into five levels: very high, high, moderate, low, and public
Note: For details about the definitions of privacy protection and data classification, see GDPR.
## General Privacy Design Rules<a name="section10354102411162"></a>
## General Privacy Design Rules
To help you better complete privacy design for OpenHarmony products, we sort out general privacy design requirements.
......@@ -133,7 +133,7 @@ When collecting personal data, clearly and explicitly notify users of the data t
Guided by the preceding principles, we have designed some examples for your reference. The figures below are examples of a privacy notice and a privacy statement, respectively.
**Figure 1** Examples of a privacy notice and a privacy statement<a name="fig1611815442274"></a>
**Figure 1** Examples of a privacy notice and a privacy statement
![](figure/privacy-notice.png)![](figure/privacy-statement.png)
......@@ -190,9 +190,9 @@ You shall obtain consent from users and comply with applicable laws and regulati
Data processing security shall be ensured in technical terms, which include encrypted data storage and secure data transfer. Security mechanisms or measures shall be enabled by default for a system.
- A protection mechanism shall be available for personal data access, including identity authentication and access control. Identity authentication \(such as username and password\) allows only authenticated users to access data in multi-user scenarios. Access control \(for example, [permission control](security-guidelines-overall.md#section852593153614)\) can be applied to restrict access to applications.
- A protection mechanism shall be available for personal data access, including identity authentication and access control. Identity authentication \(such as username and password\) allows only authenticated users to access data in multi-user scenarios. Access control \(for example, [permission control](../security/security-guidelines-overall.md)\) can be applied to restrict access to applications.
- Secure storage of personal data on distributed devices must meet Huawei Universal Keystore \(HUKS\) requirements, including secure storage of keys and data.
- The transfer of personal data between distributed devices must meet the trust binding relationship between devices and security requirements of data transmission channels. For details, see [Security Guidelines](security-guidelines-overall.md#section26153183616).
- The transfer of personal data between distributed devices must meet the trust binding relationship between devices and security requirements of data transmission channels. For details, see [Device Interconnection Security](../security/security-guidelines-overall.md#device-interconnection-security).
- Authentication data \(such as passwords and fingerprints\) shall be encrypted before being stored.
**Localization**
......@@ -203,7 +203,7 @@ User data shall be preferentially processed on the local device. Data that canno
If your product is designed for minors or you can identify, based on the collected user age data, that the end user is a minor, you shall particularly analyze issues related to minors' personal data protection based on relevant national laws in the target market. Your product shall obtain explicit consent from the holders of parental responsibility over minors.
## **Privacy Protection Requirements for Special Categories**<a name="section118861450201618"></a>
## **Privacy Protection Requirements for Special Categories**
In addition to these general privacy requirements, consumer hardware products have the following requirements for special categories. You shall comply with these requirements during product design.
......
# AI Framework Development Guide
# AI Framework Development
## **Overview**
......
# HiTraceChain Development<a name="EN-US_TOPIC_0000001186134310"></a>
# HiTraceChain Development
## Overview<a name="section3986195420436"></a>
## Overview
HiTraceChain tracks the call chain with the same **traceid** throughout the inter-device, inter-process, and inter-thread service processes. It associates and displays the call relationship and various output information during the entire process, helping you analyze and locate faults and optimize the system.
## Use Cases<a name="section134561822574"></a>
## Use Cases
HiTraceChain can be used for the following purposes:
......@@ -14,32 +14,36 @@ HiTraceChain can be used for the following purposes:
- Works with the IDE to debug the detailed service process and time consumption distribution for system optimization.
**Figure 1** Use cases of HiTraceChain<a name="fig179241023125715"></a>
**Figure 1** Use cases of HiTraceChain
![](figure/use-cases-of-hitrace.png "use-cases-of-hitrace")
### Usage Example<a name="section63861653124417"></a>
### Usage Example
**Figure 2** Service calling process \(inter-device and inter-process synchronous call\)
**Figure 2** Service calling process \(inter-device and inter-process synchronous call\)<a name="fig173491014145819"></a>
![](figure/service-calling-process-(inter-device-and-inter-process-synchronous-call).png "service-calling-process-(inter-device-and-inter-process-synchronous-call)")
1. Display the call relationship in the service process, analyze key paths and function dependency, and determine the time consumption and call frequency at each call point to detect performance bottlenecks.
1. Display the call relationship in the service process, analyze key paths and function dependency, and determine the time consumption and call frequency at each call point to detect performance bottlenecks.
**Figure 3** Service calling process
**Figure 3** Service calling process<a name="fig205051834145813"></a>
![](figure/service-calling-process.png "service-calling-process")
![](figure/service-calling-process.png "service-calling-process")
**Figure 4** Time delay in the service calling process<a name="fig1212812422586"></a>
![](figure/time-delay-in-the-service-calling-process.png "time-delay-in-the-service-calling-process")
**Figure 4** Time delay in the service calling process
![](figure/time-delay-in-the-service-calling-process.png "time-delay-in-the-service-calling-process")
2. Add **traceid** to logs and events automatically to facilitate comprehensive analysis and quick fault location.
## Available APIs<a name="section1517945334617"></a>
## Available APIs
HiTraceChain provides C++ and C APIs. The upper-layer services mainly use HiTraceChain to start and stop call chain tracing.
HiTraceChain is implemented at layer C. It works by transferring **traceid** throughout the service calling process. Before service processing, HiTraceChain sets **traceid** in the thread local storage \(TLS\) of the calling thread. During service processing, HiTraceChain obtains **traceid** from the contextual TLS of the calling thread and automatically adds it to the log and event information. After service processing is complete, HiTraceChain clears **traceid** from the TLS of the calling thread.
### Java, C++, and C APIs<a name="section932504474"></a>
### Java, C++, and C APIs
**Table 1** Description of C++ and C APIs
......@@ -195,7 +199,7 @@ HiTraceChain is implemented at layer C. It works by transferring **traceid** t
</tbody>
</table>
### Parameters of C++ APIs<a name="section2514638125"></a>
### Parameters of C++ APIs
**Table 2** Parameters of C++ APIs
......@@ -428,7 +432,7 @@ HiTraceChain is implemented at layer C. It works by transferring **traceid** t
</tbody>
</table>
## Call Chain Processing<a name="section11257133933"></a>
## Call Chain Processing
Inter-device, inter-process, and inter-thread calls are implemented through the communication mechanism. **HiTraceChain** requires transfer of **traceid** in the communication mechanism.
......@@ -438,7 +442,8 @@ The following figure shows the process of transferring **traceid** in synchron
Extended communication mechanisms can also follow this implementation.
**Figure 5** Call chain tracing in synchronous communication<a name="fig36822045171020"></a>
**Figure 5** Call chain tracing in synchronous communication
![](figure/call-chain-tracing-in-synchronous-communication.png "call-chain-tracing-in-synchronous-communication")
The process is as follows:
......@@ -471,9 +476,9 @@ The process is as follows:
8. The service module on the client processes the transact reply response.
9. When the process ends, the service module on the client calls the **end\(\)** function to stop call chain tracing.
## How to Develop<a name="section14310412491"></a>
## How to Develop
### C++<a name="section114916381509"></a>
### C++
1. Develop the source code.
......@@ -499,7 +504,7 @@ The process is as follows:
```
### C<a name="section108292107514"></a>
### C
1. Develop the source code.
......
# Telephony Development<a name="EN-US_TOPIC_0000001167051994"></a>
# Telephony Development
## Initializing a Modem Vendor Library<a name="section211mcpsimp"></a>
## Initializing a Modem Vendor Library
### When to Use<a name="section213mcpsimp"></a>
### When to Use
Initializing a modem vendor library means to implement **const HRilOps \*RilInitOps\(const struct HRilReport \*reportOps\)** function in the vendor library. This function is mainly used to:
......@@ -10,17 +10,17 @@ Initializing a modem vendor library means to implement **const HRilOps \*RilInit
- Create a thread for reading modem nodes. In this thread, the data reported by the modem is read cyclically and parsed as a specific service event for reporting.
- Return the function pointer of the service request API to RIL Adapter.
### Available APIs<a name="section811343241215"></a>
### Available APIs
The following table describes the API for initializing a modem vendor library.
**Table 1** API for initializing a modem vendor library
| API | Description |
| API | Description |
| -------- | -------- |
| const&nbsp;HRilOps&nbsp;\*RilInitOps(const&nbsp;struct&nbsp;HRilReport&nbsp;\*&nbsp;reportOps) | Provides an entry for running a modem vendor library.<br>Input parameter:<br>**reportOps**: Specifies the pointer to the event callback function, which is passed by RIL Adapter.<br/>Return result: function pointer of the service request API. |
| const&nbsp;HRilOps&nbsp;\*RilInitOps(const&nbsp;struct&nbsp;HRilReport&nbsp;\*&nbsp;reportOps) | Provides an entry for running a modem vendor library.<br>Input parameter:<br>**reportOps**: Specifies the pointer to the event callback function, which is passed by RIL Adapter.<br/>Return result: function pointer of the service request API. |
### How to Develop<a name="section51031144122"></a>
### How to Develop
1. Set the event callback function pointers passed by RIL Adapter through **RilInitOps**.
......@@ -37,7 +37,7 @@ The following table describes the API for initializing a modem vendor library.
```
1. Create the **g\_reader** main thread to enable message looping.
2. Create the **g\_reader** main thread to enable message looping.
```
pthread_attr_t t;
......@@ -47,7 +47,7 @@ The following table describes the API for initializing a modem vendor library.
```
1. In the **g\_eventListeners** thread, use **open\(\)** to open a modem node and then create the **g\_reader** thread to read and process messages reported by the modem.
3. In the **g\_eventListeners** thread, use **open\(\)** to open a modem node and then create the **g\_reader** thread to read and process messages reported by the modem.
```
g_fd = open(g_devicePath, O_RDWR); // Open the device node specified by g_devicePath.
......@@ -57,7 +57,7 @@ The following table describes the API for initializing a modem vendor library.
```
1. Return the function pointer of the service request API.
4. Return the function pointer of the service request API.
```
// Structure for the service request API of the call module
......@@ -105,9 +105,9 @@ The following table describes the API for initializing a modem vendor library.
```
### Debugging and Verification<a name="section5351151517132"></a>
### Debugging and Verification
1. Use the [hdc\_std](../subsystems/subsys-toolchain-hdc-guide.md#preparations) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device. For details about how to integrate a library file, see [Integrating Modem Vendor Libraries](#section590mcpsimp).
1. Use the [hdc\_std](../subsystems/subsys-toolchain-hdc-guide.md#how-to-obtain) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device. For details about how to integrate a library file, see [Integrating Modem Vendor Libraries](#integrating-modem-vendor-libraries).
```
hdc_std file send libril_vendor.z.so /system/lib/
......@@ -128,24 +128,24 @@ The following table describes the API for initializing a modem vendor library.
```
## Responding to Modem Service Requests<a name="section295mcpsimp"></a>
## Responding to Modem Service Requests
### When to Use<a name="section297mcpsimp"></a>
### When to Use
After receiving a specific telephony service request, RIL Adapter calls the target function pointer obtained in modem vendor library initialization to send a specific service request to the vendor library. Then, the vendor library processes the request based on the request ID.
### Available APIs<a name="section9503155219134"></a>
### Available APIs
The following table describes the APIs for responding to modem service requests, with the dial module as an example.
**Table 2** APIs for responding to modem service requests
| API | Description |
| API | Description |
| -------- | -------- |
| void&nbsp;ReqDial(ReqDataInfo&nbsp;\*requestInfo,&nbsp;const&nbsp;void&nbsp;\*data,&nbsp;size_t&nbsp;dataLen); | Processes number dial requests.<br>Input parameters:<br>**requestInfo**: request type<br/>**data**: called number<br/>**dataLen**: data length<br/>Return value: none |
| void&nbsp;(\*OnCallReport)(struct&nbsp;ReportInfo&nbsp;reportInfo,&nbsp;const&nbsp;void&nbsp;\*data,&nbsp;size_t&nbsp;dataLen); | Reports the execution result of a service request to RIL Adapter.<br>Input parameters:<br>**reportInfo**: request type<br/>**data**: called number<br/>**dataLen**: data length<br/>Return value: none |
| void&nbsp;ReqDial(ReqDataInfo&nbsp;\*requestInfo,&nbsp;const&nbsp;void&nbsp;\*data,&nbsp;size_t&nbsp;dataLen); | Processes number dial requests.<br>Input parameters:<br>**requestInfo**: request type<br/>**data**: called number<br/>**dataLen**: data length<br/>Return value: none |
| void&nbsp;(\*OnCallReport)(struct&nbsp;ReportInfo&nbsp;reportInfo,&nbsp;const&nbsp;void&nbsp;\*data,&nbsp;size_t&nbsp;dataLen); | Reports the execution result of a service request to RIL Adapter.<br>Input parameters:<br>**reportInfo**: request type<br/>**data**: called number<br/>**dataLen**: data length<br/>Return value: none |
### How to Develop<a name="section17190412101414"></a>
### How to Develop
1. Implement processing of dial requests in the **ReqDial\(\)** API.
......@@ -199,9 +199,9 @@ The following table describes the APIs for responding to modem service requests,
```
### Debugging and Verification<a name="section10207938171413"></a>
### Debugging and Verification
1. Use the [hdc\_std](../subsystems/subsys-toolchain-hdc-guide.md#preparations) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device.
1. Use the [hdc\_std](../subsystems/subsys-toolchain-hdc-guide.md#how-to-obtain) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device.
```
hdc_std file send libril_vendor.z.so /system/lib/
......@@ -242,23 +242,23 @@ The following table describes the APIs for responding to modem service requests,
```
## Reporting Modem Events<a name="section390mcpsimp"></a>
## Reporting Modem Events
### When to Use<a name="section401mcpsimp"></a>
### When to Use
A modem node thread reads the messages reported by the modem cyclically, parses the messages into specific events, and then reports the events to RIL Adapter.
### Available APIs<a name="section191193791518"></a>
### Available APIs
The following table describes the API for reporting modem events.
**Table 3** API for reporting modem events
| API | Description |
| API | Description |
| -------- | -------- |
| void&nbsp;OnNotifyOps(const&nbsp;char&nbsp;\*s,&nbsp;const&nbsp;char&nbsp;\*smsPdu) | Distributes the events reported by the modem.<br>Input parameters:<br/>**s**: AT command prefix<br/>**smsPdu**: PDU of the SMS message<br/>Return value: none |
| void&nbsp;OnNotifyOps(const&nbsp;char&nbsp;\*s,&nbsp;const&nbsp;char&nbsp;\*smsPdu) | Distributes the events reported by the modem.<br>Input parameters:<br/>**s**: AT command prefix<br/>**smsPdu**: PDU of the SMS message<br/>Return value: none |
### How to Develop<a name="section16394112401512"></a>
### How to Develop
1. Call **OnNotifyOps\(\)** in the g\_reader thread of the modem device node to parse reported modem events. On determining the command type, call **OnXxxReport\(\)** to report the parsed module events to the hril layer.
......@@ -290,7 +290,7 @@ The following table describes the API for reporting modem events.
```
1. Distribute the reported events from the **hril** layer to the Telephony Service layer.
2. Distribute the reported events from the **hril** layer to the Telephony Service layer.
```
// Report the call status proactively.
......@@ -316,9 +316,9 @@ The following table describes the API for reporting modem events.
```
### Debugging and Verification<a name="section16999174401516"></a>
### Debugging and Verification
1. Use the [hdc\_std](../subsystems/subsys-toolchain-hdc-guide.md#preparations) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device.
1. Use the [hdc\_std](../subsystems/subsys-toolchain-hdc-guide.md#how-to-obtain) tool to connect to a debugging device. Then, run the following command to send the generated **libril\_vendor.z.so** library file to the **/system/lib/** directory of the device.
```
hdc_std file send libril_vendor.z.so /system/lib/
......@@ -370,18 +370,18 @@ The following table describes the API for reporting modem events.
```
### Development Examples<a name="section33444350167"></a>
### Development Examples
- **Outgoing Call**
The following figure shows the API calling for an outgoing call.
**Figure 1** Time sequence of API calling for an outgoing call<a name="fig494mcpsimp"></a>
![](figure/en-us_image_0000001171507146.png)
When an application initiates an outgoing call, RIL Adapter receives a call request, and the **hril** layer invokes the **ReqDial\(\)** function. In **ReqDial\(\)**, the data passed by the Telephony Service is encapsulated as an AT command and sent to the modem. After executing the dial command, the modem reports the execution result to RIL Adapter through **OnCallReport\(\)**.
When an application initiates an outgoing call, RIL Adapter receives a call request, and the **hril** layer invokes the **ReqDial\(\)** function. In **ReqDial\(\)**, the data passed by the Telephony Service is encapsulated as an AT command and sent to the modem. After executing the dial command, the modem reports the execution result to RIL Adapter through **OnCallReport\(\)**.
```
// Callback function pointer of the call module
......@@ -456,13 +456,13 @@ The following table describes the API for reporting modem events.
The following figure shows the API calling of an incoming call.
**Figure 2** Time sequence of API calling for an incoming call<a name="fig556mcpsimp"></a>
![](figure/en-us_image_0000001214727595.png)
The **g\_reader** thread cyclically reads the messages reported by the modem. When the modem receives an incoming call event, it actively reports the information about the incoming call.
The **g\_reader** thread cyclically reads the messages reported by the modem. When the modem receives an incoming call event, it actively reports the information about the incoming call.
The **g\_reader** thread calls **OnNotifyOps\(\)** to parse the reported information. If the parsed data reported by the modem starts with characters such as **+CRING** or **RING**, it indicates that an incoming call event exists. In this case, the event is reported to RIL Adapter through **OnCallReport\(reportInfo, NULL, 0\)**.
The **g\_reader** thread calls **OnNotifyOps\(\)** to parse the reported information. If the parsed data reported by the modem starts with characters such as **+CRING** or **RING**, it indicates that an incoming call event exists. In this case, the event is reported to RIL Adapter through **OnCallReport\(reportInfo, NULL, 0\)**.
```
// Parse the data reported by the modem as events proactively reported by the corresponding module.
......@@ -492,11 +492,11 @@ The following table describes the API for reporting modem events.
```
## Integrating Modem Vendor Libraries<a name="section590mcpsimp"></a>
## Integrating Modem Vendor Libraries
### Configuring Compilation Information<a name="section592mcpsimp"></a>
### Configuring Compilation Information
Compile the modem vendor library into a dynamic library by using **BUILD.gn**. Upon startup, RIL Adapter loads the dynamic library to the system in dlopen mode and then initializes the library. For details about how to implement vendor library initialization, see [Initializing a Modem Vendor Library](#section211mcpsimp). The following is an example of **BUILD.gn**:
Compile the modem vendor library into a dynamic library by using **BUILD.gn**. Upon startup, RIL Adapter loads the dynamic library to the system in dlopen mode and then initializes the library. For details about how to implement vendor library initialization, see [Initializing a Modem Vendor Library](#initializing-a-modem-vendor-library). The following is an example of **BUILD.gn**:
```
import("//build/ohos.gni")
......@@ -523,7 +523,7 @@ ohos_shared_library("ril_vendor") { // Modem vendor library
}
```
### Debugging and Verification<a name="section620mcpsimp"></a>
### Debugging and Verification
1. Compile the code.
2. Check whether **libril\_vendor.z.so** exists in the **/out/{device_name}/telephony/ril\_adapter** directory. If yes, the integration is successful. Otherwise, correct the error and perform debugging and verification again.
......
......@@ -395,6 +395,7 @@
- [Doubly Linked List](kernel/kernel-small-apx-dll.md)
- [Bitwise Operation](kernel/kernel-small-apx-bitwise.md)
- [Standard Library](kernel/kernel-small-apx-library.md)
- [Kernel Coding Specification](kernel/kernel-mini-appx-code.md)
- Kernel for Standard Systems
- [Linux Kernel Overview](kernel/kernel-standard-overview.md)
- [Applying Patches on OpenHarmony Development Boards](kernel/kernel-standard-patch.md)
......@@ -450,6 +451,7 @@
- Peripheral Driver Usage
- [Audio](driver/driver-peripherals-audio-des.md)
- [Camera](driver/driver-peripherals-camera-des.md)
- [Codec](driver/driver-peripherals-codec-des.md)
- [Facial Authentication](driver/driver-peripherals-face_auth-des.md)
- [Fingerprint Authentication](driver/driver-peripherals-fingerprint_auth-des.md)
- [LCD](driver/driver-peripherals-lcd-des.md)
......@@ -502,21 +504,7 @@
- [Utils Overview](subsystems/subsys-utils-overview.md)
- [Utils Development](subsystems/subsys-utils-guide.md)
- [Utils FAQ](subsystems/subsys-utils-faqs.md)
- AI Framework
- [AI Engine Framework](subsystems/subsys-aiframework-guide.md)
- [Development Environment](subsystems/subsys-aiframework-envbuild.md)
- Technical Specifications
- [Code Management](subsystems/subsys-aiframework-tech-codemanage.md)
- [Naming](subsystems/subsys-aiframework-tech-name.md)
- [API Development](subsystems/subsys-aiframework-tech-interface.md)
- Development Guidelines
- [SDK](subsystems/subsys-aiframework-devguide-sdk.md)
- [Plug-in](subsystems/subsys-aiframework-devguide-plugin.md)
- [Configuration File](subsystems/subsys-aiframework-devguide-conf.md)
- Development Examples
- [KWS SDK](subsystems/subsys-aiframework-demo-sdk.md)
- [KWS Plug-in](subsystems/subsys-aiframework-demo-plugin.md)
- [KWS Configuration File](subsystems/subsys-aiframework-demo-conf.md)
- [AI Framework Development](subsystems/subsys-ai-aiframework-devguide.md)
- Data Management
- RDB
- [RDB Overview](subsystems/subsys-data-relational-database-overview.md)
......@@ -547,7 +535,7 @@
- [Development on Application Permission Management](subsystems/subsys-security-rightmanagement.md)
- [Development on IPC Authentication](subsystems/subsys-security-communicationverify.md)
- [Development on Device Security Level Management](subsystems/subsys-security-devicesecuritylevel.md)
- [Development on HUKS](subsystems/subsys-security-huks-guide.md)
- Startup
- [Startup](subsystems/subsys-boot-overview.md)
- init Module
......@@ -561,11 +549,11 @@
- [bootstrap Module](subsystems/subsys-boot-bootstrap.md)
- [FAQs](subsystems/subsys-boot-faqs.md)
- [Reference](subsystems/subsys-boot-ref.md)
- DFX
- DFX
- [DFX](subsystems/subsys-dfx-overview.md)
- [HiLog Development](subsystems/subsys-dfx-hilog-rich.md)
- [HiLog\_Lite Development](subsystems/subsys-dfx-hilog-lite.md)
- [HiTrace Development](subsystems/subsys-dfx-hitrace.md)
- [HiTraceChain Development](subsystems/subsys-dfx-hitracechain.md)
- [HiCollie Development](subsystems/subsys-dfx-hicollie.md)
- HiSysEvent Development
- [HiSysEvent Logging Configuration](subsystems/subsys-dfx-hisysevent-logging-config.md)
......@@ -577,7 +565,7 @@
- [HiChecker Development](subsystems/subsys-dfx-hichecker.md)
- [FaultLogger Development](subsystems/subsys-dfx-faultlogger.md)
- [Hiview Development](subsystems/subsys-dfx-hiview.md)
- Featured Topics
- HPM Part
- [HPM Part Overview](hpm-part/hpm-part-about.md)
......@@ -592,13 +580,6 @@
- WLAN-connected Products
- [LED Peripheral Control](guide/device-wlan-led-control.md)
- [Third-Party SDK Integration](guide/device-wlan-sdk.md)
- Cameras Without a Screen
- Camera Control
- [Overview](guide/device-iotcamera-control-overview.md)
- Development Guidelines
- [Photographing](guide/device-iotcamera-control-demo-photodevguide.md)
- [Video Recording](guide/device-iotcamera-control-demo-videodevguide.md)
- [Use Case](guide/device-iotcamera-control-example.md)
- Cameras with a Screen
- Screen and Camera Control
- [Overview](guide/device-camera-control-overview.md)
......@@ -643,11 +624,7 @@
- [Kernel](faqs/faqs-kernel.md)
- [Porting](faqs/faqs-porting.md)
- [Startup](faqs/faqs-startup.md)
- [System Applications](faqs/faqs-system-applications.md)
- [System Applications](faqs/faqs-system-applications.md)
......
# Startup<a name="EN-US_TOPIC_0000001124561621"></a>
# Startup
## Introduction<a name="section11660541593"></a>
## Introduction
The startup subsystem is responsible for starting key system processes and services after the kernel is started and before applications are started. The subsystem consists of the following modules:
......@@ -8,7 +8,7 @@ The startup subsystem is responsible for starting key system processes and servi
This module can be used on platforms powered by LiteOS Cortex-A or Linux kernel.
The module starts system service processes from the time the kernel loads the first user-space process to the time the first application is started. In addition to loading key system processes, it needs to configure their permissions during the startup and keep the specified process alive after sub-processes are started. If a key process exits abnormally, the module needs to perform a system restart. For details, see [init Module](../device-dev/subsystems/subsys-boot-init.md).
The module starts system service processes from the time the kernel loads the first user-space process to the time the first application is started. In addition to loading key system processes, it needs to configure their permissions during the startup and keep the specified process alive after sub-processes are started. If a key process exits abnormally, the module needs to perform a system restart. For details, see [init Module](../device-dev/subsystems/subsys-boot-init-cfg.md).
- appspawn
......@@ -27,58 +27,22 @@ The startup subsystem is responsible for starting key system processes and servi
This module obtains and sets system attributes.
The module can be used on all platforms. Supported system attributes consist of default, OEM-specified, and custom system attributes. OEM-specified system attributes provide only default values. The specific values need to be adjusted as required. For details, see [syspara Module](../device-dev/subsystems/subsys-boot-syspara.md).
The module can be used on all platforms. Supported system attributes consist of default, OEM-specified, and custom system attributes. OEM-specified system attributes provide only default values. The specific values need to be adjusted as required. For details, see [syspara Module](../device-dev/subsystems/subsys-boot-init-sysparam.md).
## Directory Structure<a name="section161941989596"></a>
## Directory Structure
**Table 1** Directory structure of the source code for the startup subsystem
<a name="table2977131081412"></a>
<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="20.880000000000003%" id="mcps1.2.4.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>Directory</p>
</th>
<th class="cellrowborder" valign="top" width="65.2%" id="mcps1.2.4.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>Description</p>
</th>
<th class="cellrowborder" valign="top" width="13.919999999999998%" id="mcps1.2.4.1.3"><p id="p101617019356"><a name="p101617019356"></a><a name="p101617019356"></a>Applicable Platform</p>
</th>
</tr>
</thead>
<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>base/startup/appspawn_lite</p>
</td>
<td class="cellrowborder" valign="top" width="65.2%" headers="mcps1.2.4.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>appspawn module of the Lite edition for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them.</p>
</td>
<td class="cellrowborder" valign="top" width="13.919999999999998%" headers="mcps1.2.4.1.3 ">Platforms using the LiteOS Cortex-A kernel
</td>
</tr>
<tr id="row17977171010144"><td class="cellrowborder" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>base/startup/appspawn_standard</p>
</td>
<td class="cellrowborder" valign="top" width="65.2%" headers="mcps1.2.4.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>appspawn module of the Standard version for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them.</p>
</td>
<td class="cellrowborder" valign="top" width="13.919999999999998%" headers="mcps1.2.4.1.3 ">Platforms using the Linux kernel
</td>
</tr>
<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p37931659101311"><a name="p37931659101311"></a><a name="p37931659101311"></a>base/startup/bootstrap_lite</p>
</td>
<td class="cellrowborder" valign="top" width="65.2%" headers="mcps1.2.4.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>bootstrap module for starting all services except core system services.</p>
</td>
<td class="cellrowborder" valign="top" width="13.919999999999998%" headers="mcps1.2.4.1.3 ">Platforms using the LiteOS Cortex-M kernel
</td>
</tr>
<tr id="row6978201031415"><td class="cellrowborder" align="left" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p117935599130"><a name="p117935599130"></a><a name="p117935599130"></a>base/startup/init_lite</p>
</td>
<td class="cellrowborder" valign="top" width="65.2%" headers="mcps1.2.4.1.2 "><p id="p0793185971316"><a name="p0793185971316"></a><a name="p0793185971316"></a>init_lite module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in **/etc/init.cfg**. Based on the parsing result, the process then starts other key system processes and grants required permissions to them.</p>
</td>
<td class="cellrowborder" valign="top" width="13.919999999999998%" headers="mcps1.2.4.1.3 ">Platforms using the LiteOS Cortex-A or Linux kernel</td>
</tr>
<tr id="row1897841071415"><td class="cellrowborder" valign="top" width="20.880000000000003%" headers="mcps1.2.4.1.1 "><p id="p469782418557"><a name="p469782418557"></a><a name="p469782418557"></a>base/startup/syspara_lite</p>
</td>
<td class="cellrowborder" valign="top" width="65.2%" headers="mcps1.2.4.1.2 "><p id="p15697102412558"><a name="p15697102412558"></a><a name="p15697102412558"></a>syspara module that provides APIs to obtain device information, including the product name, brand name, category name, and manufacturer name.</p>
</td>
<td class="cellrowborder" valign="top" width="13.919999999999998%" headers="mcps1.2.4.1.3 ">All platforms</td>
</tr>
</tbody>
</table>
| Directory | Description | Applicable Platform |
| ------------------------------ | ------------------------------------------------------------ | --------------------------------------------------- |
| base/startup/appspawn_lite | appspawn module of the Lite edition for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them. | Platforms using the LiteOS Cortex-A kernel |
| base/startup/appspawn_standard | appspawn module of the Standard version for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them. | Platforms using the Linux kernel |
| base/startup/bootstrap_lite | bootstrap module for starting all services except core system services. | Platforms using the LiteOS Cortex-M kernel |
| base/startup/init_lite | init_lite module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in **/etc/init.cfg**. Based on the parsing result, the process then starts other key system processes and grants required permissions to them. | Platforms using the LiteOS Cortex-A or Linux kernel |
| base/startup/syspara_lite | syspara module that provides APIs to obtain device information, including the product name, brand name, category name, and manufacturer name. | All platforms |
```
......@@ -111,7 +75,7 @@ base/startup/
└── simulator # Simulator adaptation
```
## Repositories Involved<a name="section1371113476307"></a>
## Repositories Involved
[Startup subsystem](../device-dev/subsystems/subsys-boot-overview.md)
......@@ -123,4 +87,4 @@ base/startup/
[startup_init_lite](https://gitee.com/openharmony/startup_init_lite)
[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite)
[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册