提交 8ae2e76e 编写于 作者: G Gloria

Update docs against 9119+9027+8203+9368+9699+9689+9557+9667

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 11a50470
# WantAgent Development
## When to Use
The **WantAgent** class encapsulates want information that specifies a particular action, which can be starting an ability or publishing a common event. You can either call **wantAgent.trigger** to trigger a **WantAgent** directly or add a **WantAgent** to a notification so that it will be triggered when users tap the notification.
The **WantAgent** class encapsulates want information that specifies a particular action, which can be starting an ability or publishing a common event. You can either call **wantAgent.trigger** to trigger a **WantAgent** directly or add a **WantAgent** to a notification so that it will be triggered when users tap the notification.
## Available APIs
| API | Description|
......@@ -21,7 +23,7 @@ The **WantAgent** class encapsulates want information that specifies a particula
```
private wantAgentObj = null // Save the WantAgent object created. It will be used to complete the trigger operations.
//wantAgentInfo
// wantAgentInfo
var wantAgentInfo = {
wants: [
{
......@@ -45,7 +47,7 @@ The **WantAgent** class encapsulates want information that specifies a particula
```
private wantAgentObj = null // Save the WantAgent object created. It will be used to complete the trigger operations.
//wantAgentInfo
// wantAgentInfo
var wantAgentInfo = {
wants: [
{
......
......@@ -16,7 +16,7 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
| ohos.vibrator | vibrate(duration: number, callback?: AsyncCallback&lt;void&gt;): void | Triggers vibration with the specified duration. This API uses a callback to return the result. |
| ohos.vibrator | vibrate(effectId: EffectId): Promise&lt;void&gt; | Triggers vibration with the specified effect. This API uses a promise to return the result. |
| ohos.vibrator | vibrate(effectId: EffectId, callback?: AsyncCallback&lt;void&gt;): void | Triggers vibration with the specified effect. This API uses a callback to return the result.|
| ohos.vibrator | stop(stopMode: VibratorStopMode): Promise&lt;void&gt; | Stops vibration. This API uses a promise to return the result. |
| ohos.vibrator | stop(stopMode: VibratorStopMode): Promise&lt;void&gt;| Stops vibration. This API uses a promise to return the result. |
| ohos.vibrator | stop(stopMode: VibratorStopMode, callback?: AsyncCallback&lt;void&gt;): void | Stops vibration. This API uses a callback to return the result. |
......@@ -55,7 +55,7 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
],
"when": "inuse"
}
},
}
]
```
......
......@@ -5,7 +5,8 @@
You can search for common development resources on [DevEco Marketplace](https://repo.harmonyos.com) and import required resources to your projects through dependencies. If you cannot find the desired resources there, develop the resources on your own and publish them in the form of an HPM Part. To develop HPM Parts, install the hpm-cli tool first.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**
>
> You are advised to perform the following operations on Ubuntu 18.04 or later.
......@@ -180,36 +181,36 @@ The following uses the **bundle.json** file as an example. In this example, the
```
{
"name": "@your/dist_name",
"version": "2.2.0",
"publishAs": "distribution",
"description": "describe it",
"scripts": {
"config_hb": "hb set -root $DEP_BUNDLE_BASE",
"dist": "PATH=/root/.local/bin:${DEP_OHOS_gn}:${DEP_OHOS_ninja}/ninja:${DEP_OHOS_llvm}/llvm/bin:${DEP_OHOS_hc_gen}/hc-gen:${PATH} && ./scripts/dist.sh"
},
"envs": {
"debug": false
},
"dirs": {
"scripts": "scripts/*"
},
"dependencies": {
"@ohos/build_lite": "2.2.0",
"@ohos/gn": "1.1.1",
"@ohos/llvm": "1.1.1",
"@ohos/hc_gen": "1.1.0",
"@ohos/ninja": "1.1.0",
......
},
"ohos": {
"os": "2.2-Beta",
"board": "hi3516",
"kernel": "liteos-a"
},
"keywords": [ "hispark", "hi3516" ],
"repository": "https://gitee.com/openharmony/your-project",
"license": "Apache V2"
"name": "@your/dist_name",
"version": "2.2.0",
"publishAs": "distribution",
"description": "describe it",
"scripts": {
"config_hb": "hb set -root $DEP_BUNDLE_BASE",
"dist": "PATH=/root/.local/bin:${DEP_OHOS_gn}:${DEP_OHOS_ninja}/ninja:${DEP_OHOS_llvm}/llvm/bin:${DEP_OHOS_hc_gen}/hc-gen:${PATH} && ./scripts/dist.sh"
},
"envs": {
"debug": false
},
"dirs": {
"scripts": "scripts/*"
},
"dependencies": {
"@ohos/build_lite": "2.2.0",
"@ohos/gn": "1.1.1",
"@ohos/llvm": "1.1.1",
"@ohos/hc_gen": "1.1.0",
"@ohos/ninja": "1.1.0",
......
},
"ohos": {
"os": "2.2-Beta",
"board": "hi3516",
"kernel": "liteos-a"
},
"keywords": ["hispark", "hi3516"],
"repository": "https://gitee.com/openharmony/your-project",
"license": "Apache V2"
}
```
......@@ -258,9 +259,10 @@ executable("hello_world") {
}
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**
>
> - **executable** is a built-in template of gn. You can run the **gn help executable** command to view how to use this template.
>
>
> - **sources** represents the source code path, and **include_dirs** represents the header file path.
......@@ -320,11 +322,12 @@ In the directory where the HPM Part is located, run the following command to pac
hpm publish
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**
>
> - To avoid HPM Part name conflicts, name an HPM Part in the format of **\@org_name/bundle_name**.
>
>
> - Your account must also be a member of **org_name** so that you can publish or update HPM Parts in the organization.
>
>
> - The published HPM Parts take effect only after security and content reviews.
......@@ -371,7 +374,7 @@ Open the **bundle.json** file. You will see that the HPM Part has been introduce
```
{
"dependencies": {
"dependencies": {
"@scope/the_bundle": "^1.0.0"
}
}
......@@ -382,7 +385,7 @@ You can edit the dependencies of multiple HPM Parts in this file.
```
{
"dependencies": {
"dependencies": {
"@scope/the_bundle1": "^1.0.0",
"@scope/the_bundle2": "^2.0.0",
"@scope/the_bundle3": "^3.0.0",
......@@ -398,13 +401,13 @@ Run the **hpm install** command again to download and install all HPM Parts that
If the referenced HPM Part is shared by multiple projects, for example, the compiler toolchain, you can install it globally.
Run the following command in your project. Make sure that the project directory contains the **bundle.json** file.
Run the following command in your project. Make sure that the project directory contains the **bundle.json** file.
```
$ hpm install -g @scope/the_tool
```
The referenced HPM Part will be installed in the directory specified by the **globalRepo** parameter of the **hpm config** command.
The referenced HPM Part will be installed in the directory specified by the **globalRepo** parameter of the **hpm config** command.
```
~\.hpm\global\ohos_bundles
......@@ -412,31 +415,32 @@ $ hpm install -g @scope/the_tool
│ └─ the_tool # <--- Referenced HPM Part
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**
>
> - For an HPM Part installed in a project, you can reference it using the environment variable **DEP_SCOPE_bundle_name** when running the hpm build command.
> For example, after you run **hpm i \@opensource/gn** to install an HPM Part, edit the build script in the **bundle.json** file as follows:
>
> ```
> "scripts": {
> "build": "${DEP_OPENSOURCE_gn}/gn --version"
> },
> ```
>
> Then, you can run the **hpm build** command to call gn functions.
>
> For example, after you run **hpm i \@opensource/gn** to install an HPM Part, edit the build script in the **bundle.json** file as follows:
>
> ```
> "scripts": {
> "build": "${DEP_OPENSOURCE_gn}/gn --version"
> },
> ```
>
> Then, you can run the **hpm build** command to call gn functions.
>
> - For a globally installed HPM Part, you can directly call the HPM Part using an environment variable or reference the HPM Part using the **${key}/tool_name** parameter in the **hpm config set key value** command. Example:
>
> ```
> hpm i -g @ohos/opensource/gn
> hpm config BUILD_SYS_GN ~/.hpm/global/ohos_bundles/opensource/gn
> ```
>
> You can edit the build script in the **bundle.json** file as follows:
>
> ```
> "scripts": {
> "build": "${BUILD_SYS_GN}/gn --version"
> },
> ```
>
> Then, you can run the **hpm build** command to call gn functions.
>
> ```
> hpm i -g @ohos/opensource/gn
> hpm config BUILD_SYS_GN ~/.hpm/global/ohos_bundles/opensource/gn
> ```
>
> You can edit the build script in the **bundle.json** file as follows:
>
> ```
> "scripts": {
> "build": "${BUILD_SYS_GN}/gn --version"
> },
> ```
>
> Then, you can run the **hpm build** command to call gn functions.
......@@ -77,7 +77,7 @@ On each development board, you need to partition the memory to store the precedi
- Initializes hardware such as the ROM and RAM, and loads the partition table information.
- Loads the **boot.img** file based on the partition table and parses and loads the **ramdisk.img** file to the memory.
- Prepares the partition table information and ramdisk address and enters the kernel, so that the kernel loads the the ramdisk image and starts the init process.
- Prepares the partition table information and ramdisk address and enters the kernel, so that the kernel loads the ramdisk image and starts the init process.
- Waits until the init process prepares the initial file system and mounts **required.fstab** (including **system.img** and **vendor.img**) to the file system.
- Scans the boot scripts in the **etc/init** directory in **system.img** and **vendor.img** and runs each boot command.
......@@ -89,7 +89,7 @@ On each development board, you need to partition the memory to store the precedi
- **boot.img** format
**boot.img** building and loading varies depending on the platform. The implementation on mainstream OpenHarmony platforms is as follows:
**boot.img** building and loading vary depending on the platform. The implementation on mainstream OpenHarmony platforms is as follows:
- Hi3516D V300
......@@ -200,7 +200,7 @@ On each development board, you need to partition the memory to store the precedi
if (access(fstabFile, F_OK) != 0) {
fstabFile = "/system/etc/fstab.required";
}
INIT_ERROR_CHECK(access(fstabFile, F_OK) == 0, abort(), "Failed get fstab.required");
INIT_ERROR_CHECK(access(fstabFile, F_OK) == 0, abort(), "Failed to get fstab.required");
fstab = ReadFstabFromFile(fstabFile, false);
}
return fstab;
......@@ -313,22 +313,22 @@ On each development board, you need to partition the memory to store the precedi
Therefore, when "Mount required partitions" is displayed, the required partition device is ready for mounting. During the mounting process, the following key information is printed:
```
BEGET_LOGE("Unsupported file system \" %s \"", item->fsType);
The current file system type is not supported.
// The current file system type is not supported.
BEGET_LOGE("Cannot get stat of \" %s \", err = %d", target, errno);
Failed to obtain the mount point directory.
// Failed to obtain the mount point directory.
BEGET_LOGE("Failed to create dir \" %s \", err = %d", target, errno);
Failed to create the mount point directory.
// Failed to create the mount point directory.
BEGET_LOGI("Mount %s to %s successful", item->deviceName, item->mountPoint);
The device is successfully mounted. The output also contains the name of the mounted device and information about the mount point.
// The device is successfully mounted. The output also contains the name of the mounted device and information about the mount point.
```
- Mounting of vendor partitions
​ After mounting required partitions, the init process scans each script file in the **vendor** partition. The initialization scripts related to the chip or development board is named in the format of **/vendor/etc/init.{ohos.boot.hardware}.cfg**. Wherein, **/vendor/etc/fstab.{ohos.boot.hardware}** represents the extended mount partition file; **hardware** is sourced from **bootargs**, which is passed from the bootloader to the kernel.
After mounting required partitions, the init process scans each script file in the **vendor** partition. The initialization scripts related to the chip or development board are named in the format of **/vendor/etc/init.{ohos.boot.hardware}.cfg**. Wherein, **/vendor/etc/fstab.{ohos.boot.hardware}** represents the extended mount partition file; **hardware** is sourced from **bootargs**, which is passed from the bootloader to the kernel.
### Boot Loading Without ramdisk
......
# Audio/Video Overview<a name="EN-US_TOPIC_0000001051770578"></a>
# Audio/Video Overview
OpenHarmony multimedia services help you to develop for audio and video playback and recording.
- The media playback module facilitates the development of audio and video playback, including media file and stream playback, volume control, and playback progress control.
- The media recording module supports the development of audio and video recording and provides functions to set the size of captured video, encoding bit rate, encoder type, video frame rate, audio sampling rate, and output file format.
## Basic Concepts<a name="section967213571204"></a>
## Basic Concepts
It is considered good practice that you understand the following concepts before starting development:
......@@ -27,52 +27,17 @@ It is considered good practice that you understand the following concepts before
The sampling rate is the number of samples per second taken from continuous signals to form discrete signals. The unit is hertz \(Hz\).
## Encoding and Decoding<a name="section1582020483111"></a>
## Encoding and Decoding
Available audio and video encoding and decoding capabilities vary depending on device types. The following table lists supported specifications for available development boards.
**Table 1** Encoding and decoding specifications for different development boards
<a name="table1611142712535"></a>
<table><thead align="left"><tr id="row5129278531"><th class="cellrowborder" valign="top" width="7.520752075207521%" id="mcps1.2.5.1.1"><p id="p163711594517"><a name="p163711594517"></a><a name="p163711594517"></a>Device Type</p>
</th>
<th class="cellrowborder" valign="top" width="8.24082408240824%" id="mcps1.2.5.1.2"><p id="p1112727195316"><a name="p1112727195316"></a><a name="p1112727195316"></a>Development Board</p>
</th>
<th class="cellrowborder" valign="top" width="40.82408240824083%" id="mcps1.2.5.1.3"><p id="p14124279538"><a name="p14124279538"></a><a name="p14124279538"></a>Decoding</p>
</th>
<th class="cellrowborder" valign="top" width="43.41434143414341%" id="mcps1.2.5.1.4"><p id="p812132715535"><a name="p812132715535"></a><a name="p812132715535"></a>Encoding</p>
</th>
</tr>
</thead>
<tbody><tr id="row712427195316"><td class="cellrowborder" valign="top" width="7.520752075207521%" headers="mcps1.2.5.1.1 "><p id="p19371179459"><a name="p19371179459"></a><a name="p19371179459"></a>Cameras with a screen</p>
</td>
<td class="cellrowborder" valign="top" width="8.24082408240824%" headers="mcps1.2.5.1.2 "><p id="p1312182713535"><a name="p1312182713535"></a><a name="p1312182713535"></a>Hi3516</p>
</td>
<td class="cellrowborder" valign="top" width="40.82408240824083%" headers="mcps1.2.5.1.3 "><a name="ul178862023587"></a><a name="ul178862023587"></a><ul id="ul178862023587"><li>Audio: MPEG-4 AAC Profile (AAC LC), MPEG Audio Layer 3 (MP3), mono and dual channels, MPEG-4 (.mp4 and .m4a), and MP3 (.mp3) are supported.</li><li>Video: The H.265 (HEVC) and H.264 (AVC) (for streams encoded using a chip of the same type) and the MPEG-4 (.mp4) container format are supported.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="43.41434143414341%" headers="mcps1.2.5.1.4 "><a name="ul5101301882"></a><a name="ul5101301882"></a><ul id="ul5101301882"><li>Audio: AAC-LC encoding, mono and dual channels, and the MPEG-4 (.mp4) container format are supported.</li><li>Video: H.264 and H.265 encoding and the MPEG-4 (.mp4) container format are supported.</li></ul>
</td>
</tr>
<tr id="row01212273532"><td class="cellrowborder" valign="top" width="7.520752075207521%" headers="mcps1.2.5.1.1 "><p id="p33711914515"><a name="p33711914515"></a><a name="p33711914515"></a>Cameras without a screen</p>
</td>
<td class="cellrowborder" valign="top" width="8.24082408240824%" headers="mcps1.2.5.1.2 "><p id="p51202713531"><a name="p51202713531"></a><a name="p51202713531"></a>Hi3518</p>
</td>
<td class="cellrowborder" valign="top" width="40.82408240824083%" headers="mcps1.2.5.1.3 "><a name="ul11786193316820"></a><a name="ul11786193316820"></a><ul id="ul11786193316820"><li>Audio: MPEG-4 AAC Profile (AAC LC), MPEG Audio Layer 3 (MP3), mono and dual channels, MPEG-4 (.mp4 and .m4a), and MP3 (.mp3) are supported.</li><li>Video: none</li></ul>
</td>
<td class="cellrowborder" valign="top" width="43.41434143414341%" headers="mcps1.2.5.1.4 "><a name="ul816485812814"></a><a name="ul816485812814"></a><ul id="ul816485812814"><li>Audio: AAC-LC encoding, mono and dual channels, and the MPEG-4 (.mp4) container format are supported.</li><li>Video: H.264 and H.265 encoding and the MPEG-4 (.mp4) container format are supported.</li></ul>
</td>
</tr>
<tr id="row1812172713534"><td class="cellrowborder" valign="top" width="7.520752075207521%" headers="mcps1.2.5.1.1 "><p id="p6371594514"><a name="p6371594514"></a><a name="p6371594514"></a>WLAN connecting devices</p>
</td>
<td class="cellrowborder" valign="top" width="8.24082408240824%" headers="mcps1.2.5.1.2 "><p id="p1212927165318"><a name="p1212927165318"></a><a name="p1212927165318"></a>Hi3861</p>
</td>
<td class="cellrowborder" valign="top" width="40.82408240824083%" headers="mcps1.2.5.1.3 "><p id="p9122271537"><a name="p9122271537"></a><a name="p9122271537"></a>N/A</p>
</td>
<td class="cellrowborder" valign="top" width="43.41434143414341%" headers="mcps1.2.5.1.4 "><p id="p2012122713531"><a name="p2012122713531"></a><a name="p2012122713531"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
| Device Type | Development Board | Decoding | Encoding |
| ------------------------ | ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| Cameras with a screen | Hi3516 | - Audio: MPEG-4 AAC Profile (AAC LC), MPEG Audio Layer 3 (MP3), mono and dual channels, MPEG-4 (.mp4 and .m4a), and MP3 (.mp3) are supported.<br>- Video: The H.265 (HEVC) and H.264 (AVC) (for streams encoded using a chip of the same type) and the MPEG-4 (.mp4) container format are supported. | - Audio: AAC-LC encoding, mono and dual channels, and the MPEG-4 (.mp4) container format are supported.<br/>- Video: H.264 and H.265 encoding and the MPEG-4 (.mp4) container format are supported.</li></ul> |
| Cameras without a screen | Hi3518 | - Audio: MPEG-4 AAC Profile (AAC LC), MPEG Audio Layer 3 (MP3), mono and dual channels, MPEG-4 (.mp4 and .m4a), and MP3 (.mp3) are supported.<br/>- Video: none | <ul><li>Audio: AAC-LC encoding, mono and dual channels, and the MPEG-4 (.mp4) container format are supported.<br/>- Video: H.264 and H.265 encoding and the MPEG-4 (.mp4) container format are supported. |
| WLAN connecting devices | Hi3861 | N/A | N/A |
For details about the encoding and decoding specifications of Hi3516 and Hi3518, refer to their documentation.
# Pan-Sensor<a name="EN-US_TOPIC_0000001078062432"></a>
# Pan-Sensor
## Introduction<a name="section11660541593"></a>
## Introduction
The pan-sensor service subsystem provides a lightweight sensor service framework, through which you can perform the following operations:
......@@ -11,11 +11,9 @@ The pan-sensor service subsystem provides a lightweight sensor service framework
The following figure shows the architecture of the pan-sensor service framework.
**Figure1** Pan-sensor service architecture
![](figures/en-us_image_0000001106694563.png)
## Directory Structure<a name="section161941989596"></a>
## Directory Structure
```
/base/sensors
......@@ -26,7 +24,7 @@ The following figure shows the architecture of the pan-sensor service framework.
└── miscdevice_lite # Misc device directory
```
## Usage<a name="section1312121216216"></a>
## Usage
The following modules work cooperatively to implement pan-sensor capabilities: Sensor API, Sensor Framework, and Sensor Service.
......@@ -34,7 +32,7 @@ The following modules work cooperatively to implement pan-sensor capabilities: S
- Sensor Framework: manages sensor data subscription, creates and destroys data channels, subscribes to or unsubscribes from sensor data, and implements communication with the Sensor Service module.
- Sensor Service: interacts with the HDF module to receive, parse, and distribute data, manages sensor services and sensor data reporting, and controls sensor permissions.
## Repositories Involved<a name="section1371113476307"></a>
## Repositories Involved
**Pan-sensor subsystem**
......
......@@ -10,11 +10,11 @@ The table below lists the APIs changes of the web subsystem in OpenHarmony 3.2 B
| ohos.web | WebDataBase | static getHttpAuthCredentials(host: string, realm: string): Array\<string>; | Added|
| ohos.web | WebDataBase | static deleteHttpAuthCredentials(): void; | Added|
| ohos.web | WebDataBase | static existHttpAuthCredentials(): boolean; | Added|
| ohos.web | WebStorage | static getOriginUsage(origin : string) : Promise\<number> ;<br>static getOriginUsage(origin : string, callback : AsyncCallback\<number>) : void; | Added|
| ohos.web | WebStorage | static getOriginQuota(origin : string) : Promise\<number>;<br>static getOriginQuota(origin : string, callback : AsyncCallback\<number>) : void; | Added|
| ohos.web | WebStorage | static getOrigins() : Promise\<Array\<WebStorageOrigin>>;<br>static getOrigins(callback: AsyncCallback\<Array\<WebStorageOrigin>>) : void; | Added|
| ohos.web | WebStorage | static deleteOrigin(origin : string): void; | Added|
| ohos.web | WebStorage | static deleteAllData() : void; | Added|
| ohos.web | WebStorage | static getOriginUsage(origin: string): Promise\<number> ;<br>static getOriginUsage(origin: string, callback: AsyncCallback\<number>): void; | Added|
| ohos.web | WebStorage | static getOriginQuota(origin: string): Promise\<number>;<br>static getOriginQuota(origin: string, callback: AsyncCallback\<number>): void; | Added|
| ohos.web | WebStorage | static getOrigins(): Promise\<Array\<WebStorageOrigin>>;<br>static getOrigins(callback: AsyncCallback\<Array\<WebStorageOrigin>>): void; | Added|
| ohos.web | WebStorage | static deleteOrigin(origin: string): void; | Added|
| ohos.web | WebStorage | static deleteAllData(): void; | Added|
| ohos.web | WebStorageOrigin | quota: number; | Added|
| ohos.web | WebStorageOrigin | usage: number; | Added|
| ohos.web | WebStorageOrigin | origin: string; | Added|
......
......@@ -30,7 +30,7 @@
- API Differences
- OpenHamrony 3.2 Beta2
- OpenHarmony 3.2 Beta2
- JS API Differences
- [Ability framework](release-notes/api-change/v3.2-beta2/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-accessibility.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册