diff --git a/en/application-dev/IDL/idl-guidelines.md b/en/application-dev/IDL/idl-guidelines.md
index 661b2532c49d36c79855c3e0530326ef590c7cd2..5b3a5d7990d4dfe55ddef2ad77ef7dab84033a2e 100644
--- a/en/application-dev/IDL/idl-guidelines.md
+++ b/en/application-dev/IDL/idl-guidelines.md
@@ -7,7 +7,7 @@ To ensure successful communications between the client and server, interfaces re
![IDL-interface-description](./figures/IDL-interface-description.png)
-IDL provides the following functions:
+**IDL provides the following functions:**
- Declares interfaces provided by system services for external systems, and based on the interface declaration, generates C, C++, JS, or TS code for inter-process communication (IPC) or remote procedure call (RPC) proxies and stubs during compilation.
@@ -17,7 +17,7 @@ IDL provides the following functions:
![IPC-RPC-communication-model](./figures/IPC-RPC-communication-model.png)
-IDL has the following advantages:
+**IDL has the following advantages:**
- Services are defined in the form of interfaces in IDL. Therefore, you do not need to focus on implementation details.
@@ -433,7 +433,7 @@ export default {
console.log('ServiceAbility want:' + JSON.stringify(want));
console.log('ServiceAbility want name:' + want.bundleName)
} catch(err) {
- console.log("ServiceAbility error:" + err)
+ console.log('ServiceAbility error:' + err)
}
console.info('ServiceAbility onConnect end');
return new IdlTestImp('connect');
@@ -455,13 +455,13 @@ import featureAbility from '@ohos.ability.featureAbility';
function callbackTestIntTransaction(result: number, ret: number): void {
if (result == 0 && ret == 124) {
- console.log("case 1 success ");
+ console.log('case 1 success');
}
}
function callbackTestStringTransaction(result: number): void {
if (result == 0) {
- console.log("case 2 success ");
+ console.log('case 2 success');
}
}
@@ -472,17 +472,17 @@ var onAbilityConnectDone = {
testProxy.testStringTransaction('hello', callbackTestStringTransaction);
},
onDisconnect:function (elementName) {
- console.log("onDisconnectService onDisconnect");
+ console.log('onDisconnectService onDisconnect');
},
onFailed:function (code) {
- console.log("onDisconnectService onFailed");
+ console.log('onDisconnectService onFailed');
}
};
function connectAbility: void {
let want = {
- "bundleName":"com.example.myapplicationidl",
- "abilityName": "com.example.myapplicationidl.ServiceAbility"
+ bundleName: 'com.example.myapplicationidl',
+ abilityName: 'com.example.myapplicationidl.ServiceAbility'
};
let connectionId = -1;
connectionId = featureAbility.connectAbility(want, onAbilityConnectDone);
@@ -495,7 +495,7 @@ function connectAbility: void {
You can send a class from one process to another through IPC interfaces. However, you must ensure that the peer can use the code of this class and this class supports the **marshalling** and **unmarshalling** methods. OpenHarmony uses **marshalling** and **unmarshalling** to serialize and deserialize objects into objects that can be identified by each process.
-To create a class that supports the sequenceable type, perform the following operations:
+**To create a class that supports the sequenceable type, perform the following operations:**
1. Implement the **marshalling** method, which obtains the current state of the object and serializes the object into a **Parcel** object.
2. Implement the **unmarshalling** method, which deserializes the object from a **Parcel** object.
@@ -595,7 +595,7 @@ export default class IdlTestServiceProxy implements IIdlTestService {
let _reply = new rpc.MessageParcel();
_data.writeInt(data);
this.proxy.sendRequest(IdlTestServiceProxy.COMMAND_TEST_INT_TRANSACTION, _data, _reply, _option).then(function(result) {
- if (result.errCode === 0) {
+ if (result.errCode == 0) {
let _errCode = result.reply.readInt();
if (_errCode != 0) {
let _returnValue = undefined;
@@ -605,7 +605,7 @@ export default class IdlTestServiceProxy implements IIdlTestService {
let _returnValue = result.reply.readInt();
callback(_errCode, _returnValue);
} else {
- console.log("sendRequest failed, errCode: " + result.errCode);
+ console.log('sendRequest failed, errCode: ' + result.errCode);
}
})
}
@@ -617,11 +617,11 @@ export default class IdlTestServiceProxy implements IIdlTestService {
let _reply = new rpc.MessageParcel();
_data.writeString(data);
this.proxy.sendRequest(IdlTestServiceProxy.COMMAND_TEST_STRING_TRANSACTION, _data, _reply, _option).then(function(result) {
- if (result.errCode === 0) {
+ if (result.errCode == 0) {
let _errCode = result.reply.readInt();
callback(_errCode);
} else {
- console.log("sendRequest failed, errCode: " + result.errCode);
+ console.log('sendRequest failed, errCode: ' + result.errCode);
}
})
}
@@ -644,12 +644,12 @@ import nativeMgr from 'nativeManager';
function testIntTransactionCallback(errCode: number, returnValue: number)
{
- console.log("errCode: " + errCode + " returnValue: " + returnValue);
+ console.log('errCode: ' + errCode + ' returnValue: ' + returnValue);
}
function testStringTransactionCallback(errCode: number)
{
- console.log("errCode: " + errCode);
+ console.log('errCode: ' + errCode);
}
function jsProxyTriggerCppStub()
@@ -660,6 +660,6 @@ function jsProxyTriggerCppStub()
tsProxy.testIntTransaction(10, testIntTransactionCallback);
// Call testStringTransaction.
- tsProxy.testStringTransaction("test", testIntTransactionCallback);
+ tsProxy.testStringTransaction('test', testIntTransactionCallback);
}
```
diff --git a/en/application-dev/device/device-location-info.md b/en/application-dev/device/device-location-info.md
index f3572352e718bb77493d7dd2d097d2d7a82058c9..a153f69fbfe2b71362a4b7e5808fe57c1b7a4216 100644
--- a/en/application-dev/device/device-location-info.md
+++ b/en/application-dev/device/device-location-info.md
@@ -66,7 +66,7 @@ To learn more about the APIs for obtaining device location information, see [Geo
If your application needs to access the device location information when running on the background, it must be configured to be able to run on the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background.
- You can declare the required permission in your application's configuration file. For details, see [Application Package Structure Configuration File](../quick-start/stage-structure.md).
+ You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../security/accesstoken-guidelines.md).
2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities.
diff --git a/en/application-dev/media/audio-playback.md b/en/application-dev/media/audio-playback.md
index 5227f6cdd1b9ec89818b0d1762c99267ec7eba97..92aa1cd4fc35a4b64ad9b1044c1a7bd59f24453d 100644
--- a/en/application-dev/media/audio-playback.md
+++ b/en/application-dev/media/audio-playback.md
@@ -1,25 +1,35 @@
# Audio Playback Development
-## When to Use
+## Introduction
-You can use audio playback APIs to convert audio data into audible analog signals, play the signals using output devices, and manage playback tasks.
+You can use audio playback APIs to convert audio data into audible analog signals and play the signals using output devices. You can also manage playback tasks. For example, you can start, suspend, stop playback, release resources, set the volume, seek to a playback position, and obtain track information.
-**Figure 1** Playback status
+## Working Principles
+
+The following figures show the audio playback status changes and the interaction with external modules for audio playback.
+
+**Figure 1** Audio playback state transition
![en-us_image_audio_state_machine](figures/en-us_image_audio_state_machine.png)
-**Note**: If the status is **Idle**, setting the **src** attribute does not change the status. In addition, after the **src** attribute is set successfully, you must call **reset()** before setting it to another value.
+**NOTE**: If the status is **Idle**, setting the **src** attribute does not change the status. In addition, after the **src** attribute is set successfully, you must call **reset()** before setting it to another value.
-**Figure 2** Layer 0 diagram of audio playback
+**Figure 2** Interaction with external modules for audio playback
![en-us_image_audio_player](figures/en-us_image_audio_player.png)
+**NOTE**: When a third-party application calls the JS interface provided by the JS interface layer to implement a feature, the framework layer invokes the audio component through the media service of the native framework and outputs the audio data decoded by the software to the audio HDI of the hardware interface layer to implement audio playback.
+
## How to Develop
For details about the APIs, see [AudioPlayer in the Media API](../reference/apis/js-apis-media.md#audioplayer).
+> **NOTE**
+>
+> The method for obtaining the path in the FA model is different from that in the stage model. **pathDir** used in the sample code below is an example. You need to obtain the path based on project requirements. For details about how to obtain the path, see [Application Sandbox Path Guidelines](../reference/apis/js-apis-fileio.md#guidelines).
+
### Full-Process Scenario
The full audio playback process includes creating an instance, setting the URI, playing audio, seeking to the playback position, setting the volume, pausing playback, obtaining track information, stopping playback, resetting the player, and releasing resources.
@@ -99,8 +109,9 @@ async function audioPlayerDemo() {
setCallBack(audioPlayer); // Set the event callbacks.
// 2. Set the URI of the audio file.
let fdPath = 'fd://'
- // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
- let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
+ let pathDir = "/data/storage/el2/base/haps/entry/files" // The method for obtaining pathDir in the FA model is different from that in the stage model. For details, see NOTE just below How to Develop. You need to obtain pathDir based on project requirements.
+ // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el2/100/base/ohos.acts.multimedia.audio.audioplayer/haps/entry/files" command.
+ let path = pathDir + '/01.mp3'
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
console.info('open fd success fd is' + fdPath);
@@ -118,6 +129,7 @@ async function audioPlayerDemo() {
```js
import media from '@ohos.multimedia.media'
import fileIO from '@ohos.fileio'
+
export class AudioDemo {
// Set the player callbacks.
setCallBack(audioPlayer) {
@@ -139,8 +151,9 @@ export class AudioDemo {
let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
this.setCallBack(audioPlayer); // Set the event callbacks.
let fdPath = 'fd://'
- // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
- let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
+ let pathDir = "/data/storage/el2/base/haps/entry/files" // The method for obtaining pathDir in the FA model is different from that in the stage model. For details, see NOTE just below How to Develop. You need to obtain pathDir based on project requirements.
+ // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el2/100/base/ohos.acts.multimedia.audio.audioplayer/haps/entry/files" command.
+ let path = pathDir + '/01.mp3'
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
console.info('open fd success fd is' + fdPath);
@@ -159,6 +172,7 @@ export class AudioDemo {
```js
import media from '@ohos.multimedia.media'
import fileIO from '@ohos.fileio'
+
export class AudioDemo {
// Set the player callbacks.
private isNextMusic = false;
@@ -185,8 +199,9 @@ export class AudioDemo {
async nextMusic(audioPlayer) {
this.isNextMusic = true;
let nextFdPath = 'fd://'
- // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\02.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
- let nextpath = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/02.mp3';
+ let pathDir = "/data/storage/el2/base/haps/entry/files" // The method for obtaining pathDir in the FA model is different from that in the stage model. For details, see NOTE just below How to Develop. You need to obtain pathDir based on project requirements.
+ // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\02.mp3 /data/app/el2/100/base/ohos.acts.multimedia.audio.audioplayer/haps/entry/files" command.
+ let nextpath = pathDir + '/02.mp3'
await fileIO.open(nextpath).then((fdNumber) => {
nextFdPath = nextFdPath + '' + fdNumber;
console.info('open fd success fd is' + nextFdPath);
@@ -202,8 +217,9 @@ export class AudioDemo {
let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
this.setCallBack(audioPlayer); // Set the event callbacks.
let fdPath = 'fd://'
- // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
- let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
+ let pathDir = "/data/storage/el2/base/haps/entry/files" // The method for obtaining pathDir in the FA model is different from that in the stage model. For details, see NOTE just below How to Develop. You need to obtain pathDir based on project requirements.
+ // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el2/100/base/ohos.acts.multimedia.audio.audioplayer/haps/entry/files" command.
+ let path = pathDir + '/01.mp3'
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
console.info('open fd success fd is' + fdPath);
@@ -222,6 +238,7 @@ export class AudioDemo {
```js
import media from '@ohos.multimedia.media'
import fileIO from '@ohos.fileio'
+
export class AudioDemo {
// Set the player callbacks.
setCallBack(audioPlayer) {
@@ -239,8 +256,9 @@ export class AudioDemo {
let audioPlayer = media.createAudioPlayer(); // Create an AudioPlayer instance.
this.setCallBack(audioPlayer); // Set the event callbacks.
let fdPath = 'fd://'
- // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile" command.
- let path = '/data/app/el1/bundle/public/ohos.acts.multimedia.audio.audioplayer/ohos.acts.multimedia.audio.audioplayer/assets/entry/resources/rawfile/01.mp3';
+ let pathDir = "/data/storage/el2/base/haps/entry/files" // The method for obtaining pathDir in the FA model is different from that in the stage model. For details, see NOTE just below How to Develop. You need to obtain pathDir based on project requirements.
+ // The stream in the path can be pushed to the device by running the "hdc file send D:\xxx\01.mp3 /data/app/el2/100/base/ohos.acts.multimedia.audio.audioplayer/haps/entry/files" command.
+ let path = pathDir + '/01.mp3'
await fileIO.open(path).then((fdNumber) => {
fdPath = fdPath + '' + fdNumber;
console.info('open fd success fd is' + fdPath);
diff --git a/en/application-dev/media/audio-recorder.md b/en/application-dev/media/audio-recorder.md
index f465db2b88118b77c9a4e64307170da07c3e8918..78650a61d0a803811394e623ab0bc46155438ba9 100644
--- a/en/application-dev/media/audio-recorder.md
+++ b/en/application-dev/media/audio-recorder.md
@@ -1,8 +1,12 @@
# Audio Recording Development
-## When to Use
+## Introduction
-During audio recording, audio signals are captured, encoded, and saved to files. You can specify parameters such as the sampling rate, number of audio channels, encoding format, encapsulation format, and file path for audio recording.
+During audio recording, audio signals are captured, encoded, and saved to files. You can specify parameters such as the sampling rate, number of audio channels, encoding format, encapsulation format, and output file path for audio recording.
+
+## Working Principles
+
+The following figures show the audio recording state transition and the interaction with external modules for audio recording.
**Figure 1** Audio recording state transition
@@ -10,10 +14,16 @@ During audio recording, audio signals are captured, encoded, and saved to files.
-**Figure 2** Layer 0 diagram of audio recording
+**Figure 2** Interaction with external modules for audio recording
![en-us_image_audio_recorder_zero](figures/en-us_image_audio_recorder_zero.png)
+**NOTE**: When a third-party recording application or recorder calls the JS interface provided by the JS interface layer to implement a feature, the framework layer invokes the audio component through the media service of the native framework to obtain the audio data captured through the audio HDI. The framework layer then encodes the audio data through software and saves the encoded and encapsulated audio data to a file to implement audio recording.
+
+## Constraints
+
+Before developing audio recording, configure the **ohos.permission.MICROPHONE** permission for your application. For details about the configuration, see [Permission Application Guide](../security/accesstoken-guidelines.md).
+
## How to Develop
For details about the APIs, see [AudioRecorder in the Media API](../reference/apis/js-apis-media.md#audiorecorder).
diff --git a/en/application-dev/media/video-playback.md b/en/application-dev/media/video-playback.md
index 6ee5cf660069294f717c5cac614ed707db9f1a8c..b324f19b3cf0f3621bd74809c4f1a2d0b57d0abd 100644
--- a/en/application-dev/media/video-playback.md
+++ b/en/application-dev/media/video-playback.md
@@ -1,17 +1,23 @@
# Video Playback Development
-## When to Use
+## Introduction
-You can use video playback APIs to convert video data into visible signals, play the signals using output devices, and manage playback tasks. This document describes development for the following video playback scenarios: full-process, normal playback, video switching, and loop playback.
+You can use video playback APIs to convert audio data into audible analog signals and play the signals using output devices. You can also manage playback tasks. For example, you can start, suspend, stop playback, release resources, set the volume, seek to a playback position, set the playback speed, and obtain track information. This document describes development for the following video playback scenarios: full-process, normal playback, video switching, and loop playback.
+
+## Working Principles
+
+The following figures show the video playback state transition and the interaction with external modules for video playback.
**Figure 1** Video playback state transition
![en-us_image_video_state_machine](figures/en-us_image_video_state_machine.png)
-**Figure 2** Layer 0 diagram of video playback
+**Figure 2** Interaction with external modules for video playback
![en-us_image_video_player](figures/en-us_image_video_player.png)
+**NOTE**: When a third-party application calls a JS interface provided by the JS interface layer, the framework layer invokes the audio component through the media service of the native framework to output the audio data decoded by the software to the audio HDI. The graphics subsystem outputs the image data decoded by the codec HDI at the hardware interface layer to the display HDI. In this way, video playback is implemented.
+
*Note: Video playback requires hardware capabilities such as display, audio, and codec.*
1. A third-party application obtains a surface ID from the XComponent.
diff --git a/en/application-dev/media/video-recorder.md b/en/application-dev/media/video-recorder.md
index 62e81cf05c384a7cd1a780c562697be046153d05..bef55899bcb51359a6b6d68ef6d7894d70e435ae 100644
--- a/en/application-dev/media/video-recorder.md
+++ b/en/application-dev/media/video-recorder.md
@@ -1,17 +1,27 @@
# Video Recording Development
-## When to Use
+## Introduction
-During video recording, audio and video signals are captured, encoded, and saved to files. You can specify parameters such as the encoding format, encapsulation format, and file path for video recording.
+You can use video recording APIs to capture audio and video signals, encode them, and save them to files. You can start, suspend, resume, and stop recording, and release resources. You can also specify parameters such as the encoding format, encapsulation format, and file path for video recording.
+
+## Working Principles
+
+The following figures show the video recording state transition and the interaction with external modules for video recording.
**Figure 1** Video recording state transition
![en-us_image_video_recorder_state_machine](figures/en-us_image_video_recorder_state_machine.png)
-**Figure 2** Layer 0 diagram of video recording
+**Figure 2** Interaction with external modules for video recording
![en-us_image_video_recorder_zero](figures/en-us_image_video_recorder_zero.png)
+**NOTE**: When a third-party camera application or system camera calls a JS interface provided by the JS interface layer, the framework layer uses the media service of the native framework to invoke the audio component. Through the audio HDI, the audio component captures audio data, encodes the audio data through software, and saves the encoded audio data to a file. The graphics subsystem captures image data through the video HDI, encodes the image data through the video codec HDI, and saves the encoded image data to a file. In this way, video recording is implemented.
+
+## Constraints
+
+Before developing video recording, configure the permissions **ohos.permission.MICROPHONE** and **ohos.permission.CAMERA** for your application. For details about the configuration, see [Permission Application Guide](../security/accesstoken-guidelines.md).
+
## How to Develop
For details about the APIs, see [VideoRecorder in the Media API](../reference/apis/js-apis-media.md#videorecorder9).
@@ -147,3 +157,4 @@ export class VideoRecorderDemo {
}
}
```
+
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index 754d30b06c7dda42dbe16203be2342bf6f70fc2a..6e564f2518cf3ce6f083da66d8d72c0b8310f650 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -215,6 +215,7 @@
- [@ohos.geolocation](js-apis-geolocation.md)
- [@ohos.multimodalInput.inputConsumer](js-apis-inputconsumer.md)
- [@ohos.multimodalInput.inputDevice](js-apis-inputdevice.md)
+ - [@ohos.multimodalInput.inputDeviceCooperate](js-apis-cooperate.md)
- [@ohos.multimodalInput.inputEvent](js-apis-inputevent.md)
- [@ohos.multimodalInput.inputEventClient](js-apis-inputeventclient.md)
- [@ohos.multimodalInput.inputMonitor](js-apis-inputmonitor.md)
diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md
index 34fe47f45abe436abf986da809e343fd638540d7..a04f49f6d46bd886af5b23c01e65ce7d0b689e85 100644
--- a/en/application-dev/reference/apis/js-apis-call.md
+++ b/en/application-dev/reference/apis/js-apis-call.md
@@ -796,7 +796,7 @@ call.reject(rejectMessageOptions, (err, data) => {
## call.reject7+
-reject(callId: number, callback: AsyncCallback):
+reject(callId: number, callback: AsyncCallback\): void
Rejects a call based on the specified call ID. This API uses an asynchronous callback to return the result.
@@ -811,16 +811,11 @@ This is a system API.
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
-**Return value**
-
-| Type | Description |
-| ------------------- | --------------------------- |
-| Promise<void> | Promise used to return the result.|
**Example**
```js
-call.reject(1, (error, data) => {
+call.reject(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
@@ -1621,8 +1616,8 @@ This is a system API.
**Example**
```js
-call.on('callDetailsChange', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.on('callDetailsChange', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1646,8 +1641,8 @@ This is a system API.
**Example**
```js
-call.on('callEventChange', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.on('callEventChange', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1671,8 +1666,8 @@ This is a system API.
**Example**
```js
-call.on('callDisconnectedCause', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.on('callDisconnectedCause', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1696,8 +1691,8 @@ This is a system API.
**Example**
```js
-call.on('mmiCodeResult', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.on('mmiCodeResult', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1721,8 +1716,8 @@ This is a system API.
**Example**
```js
-call.off('callDetailsChange', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.off('callDetailsChange', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1746,8 +1741,8 @@ This is a system API.
**Example**
```js
-call.off('callEventChange', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.off('callEventChange', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1771,8 +1766,8 @@ This is a system API.
**Example**
```js
-call.off('callDisconnectedCause', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.off('callDisconnectedCause', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -1796,8 +1791,8 @@ This is a system API.
**Example**
```js
-call.off('mmiCodeResult', (err, data) => {
- console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
+call.off('mmiCodeResult', data => {
+ console.log(`callback: data->${JSON.stringify(data)}`);
});
```
@@ -2386,7 +2381,7 @@ This is a system API.
let audioDeviceOptions={
bluetoothAddress: "IEEE 802-2014"
}
-call.setAudioDevice(1, audioDeviceOptions, (err, value) => {
+call.setAudioDevice(1, audioDeviceOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
diff --git a/en/application-dev/reference/apis/js-apis-cooperate.md b/en/application-dev/reference/apis/js-apis-cooperate.md
new file mode 100644
index 0000000000000000000000000000000000000000..96fa3ebc9ff8fadf13097fd6042339ad202f186c
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-cooperate.md
@@ -0,0 +1,390 @@
+# Screen Hopping
+
+The Screen Hopping module enables two or more networked devices to share the keyboard and mouse for collaborative operations.
+
+> **Description**
+>
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import inputDeviceCooperate from '@ohos.multimodalInput.inputDeviceCooperate'
+```
+
+## inputDeviceCooperate.enable
+
+enable(enable: boolean, callback: AsyncCallback<void>): void
+
+Specifies whether to enable screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ------------------------- | ---- | --------------------------- |
+| enable | boolean | Yes | Whether to enable screen hopping.|
+| callback | AsyncCallback<void> | Yes |Callback used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.enable(true, (error) => {
+ if (error) {
+ console.log(`Keyboard mouse crossing enable failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Keyboard mouse crossing enable success.`);
+ });
+} catch (error) {
+ console.log(`Keyboard mouse crossing enable failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.enable
+
+enable(enable: boolean): Promise<void>
+
+Specifies whether to enable screen hopping. This API uses a promise to return the result.
+
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| --------- | ------- | ---- | ------------------------------------------------------------------- |
+| enable | boolean | Yes | Whether to enable screen hopping. |
+
+
+
+**Return value**
+
+| Name | Description |
+| ------------------- | ------------------------------- |
+| Promise<void> | Promise used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.enable(true).then(() => {
+ console.log(`Keyboard mouse crossing enable success.`);
+ }, (error) => {
+ console.log(`Keyboard mouse crossing enable failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ });
+} catch (error) {
+ console.log(`Keyboard mouse crossing enable failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.start
+
+start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCallback\): void
+
+Starts screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| sinkDeviceDescriptor | string | Yes | Descriptor of the target device for screen hopping. |
+| srcInputDeviceId | number | Yes | ID of the target device for screen hopping. |
+| callback | AsyncCallback\ | Yes | Callback used to return the result.|
+
+**Error codes**
+
+For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcodes-multimodalinput.md).
+
+| ID| Error Message|
+| -------- | ---------------------------------------- |
+| 4400001 | This error code is reported if an invalid device descriptor is passed to the screen hopping API. |
+| 4400002 | This error code is reported if the screen hopping status is abnormal when the screen hopping API is called. |
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.start(sinkDeviceDescriptor, srcInputDeviceId, (error) => {
+ if (error) {
+ console.log(`Start Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Start Keyboard mouse crossing success.`);
+ });
+} catch (error) {
+ console.log(`Start Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.start
+
+start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise\
+
+Starts screen hopping. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| sinkDeviceDescriptor | string | Yes | Descriptor of the target device for screen hopping. |
+| srcInputDeviceId | number | Yes | ID of the target device for screen hopping. |
+
+
+
+**Return value**
+
+| Name | Description |
+| ---------------------- | ------------------------------- |
+| Promise\ | Promise used to return the result. |
+
+**Error codes**
+
+For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcodes-multimodalinput.md).
+
+| ID| Error Message|
+| -------- | ---------------------------------------- |
+| 4400001 | This error code is reported if an invalid device descriptor is passed to the screen hopping API. |
+| 4400002 | This error code is reported if the screen hopping status is abnormal when the screen hopping API is called. |
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.start(sinkDeviceDescriptor, srcInputDeviceId).then(() => {
+ console.log(`Start Keyboard mouse crossing success.`);
+ }, (error) => {
+ console.log(`Start Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ });
+} catch (error) {
+ console.log(`Start Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.stop
+
+stop(callback: AsyncCallback\): void
+
+Stops screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| callback | AsyncCallback\ | Yes | Callback used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.stop((error) => {
+ if (error) {
+ console.log(`Stop Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Stop Keyboard mouse crossing success.`);
+ });
+} catch (error) {
+ console.log(`Stop Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.stop
+
+stop(): Promise\
+
+Stops screen hopping. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Description |
+| -------- | ---------------------------- |
+| Promise\ | Promise used to return the result. |
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.stop().then(() => {
+ console.log(`Stop Keyboard mouse crossing success.`);
+ }, (error) => {
+ console.log(`Stop Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ });
+} catch (error) {
+ console.log(`Stop Keyboard mouse crossing failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.getState
+
+getState(deviceDescriptor: string, callback: AsyncCallback<{ state: boolean }>): void
+
+Checks whether screen hopping is enabled. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | --------- | ---- | ---------------------------- |
+| deviceDescriptor | string | Yes | Descriptor of the target device for screen hopping. |
+| callback | AsyncCallback<{ state: boolean }> | Yes | Callback used to return the result. |
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.getState(deviceDescriptor, (error, data) => {
+ if (error) {
+ console.log(`Get the status failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Get the status success, data: ${JSON.stringify(data)}`);
+ });
+} catch (error) {
+ console.log(`Get the status failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## inputDeviceCooperate.getState
+
+getState(deviceDescriptor: string): Promise<{ state: boolean }>
+
+Checks whether screen hopping is enabled. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | --------- | ---- | ---------------------------- |
+| deviceDescriptor | string | Yes | Descriptor of the target device for screen hopping. |
+
+
+
+**Return value**
+
+| Name | Description |
+| ------------------- | ------------------------------- |
+| Promise<{ state: boolean }>| Promise used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.getState(deviceDescriptor).then((data) => {
+ console.log(`Get the status success, data: ${JSON.stringify(data)}`);
+ }, (error) => {
+ console.log(`Get the status failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ });
+} catch (error) {
+ console.log(`Get the status failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## on('cooperation')
+
+on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, eventMsg: EventMsg }>): void
+
+Enables listening for screen hopping events.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| type | string | Yes | Event type. The value is **cooperation**. |
+| callback | AsyncCallback<{ deviceDescriptor: string, eventMsg: [EventMsg](#eventmsg) }> | Yes | Callback used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ inputDeviceCooperate.on('cooperation', (data) => {
+ console.log(`Keyboard mouse crossing event: ${JSON.stringify(data)}`);
+ });
+} catch (err) {
+ console.log(`Register failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## off('cooperation')
+
+off(type: 'cooperation', callback?: AsyncCallback\): void
+
+Disables listening for screen hopping events.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| type | string | Yes | Event type. The value is **cooperation**. |
+| callback | AsyncCallback | No | Callback to be unregistered. If this parameter is not specified, all callbacks registered by the current application will be unregistered.|
+
+
+
+**Example**
+
+```js
+// Unregister a single callback.
+callback: function(event) {
+ console.log(`Keyboard mouse crossing event: ${JSON.stringify(event)}`);
+ return false;
+},
+try {
+ inputDeviceCooperate.on('cooperation', this.callback);
+ inputDeviceCooperate.off("cooperation", this.callback);
+} catch (error) {
+ console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+```js
+// Unregister all callbacks.
+callback: function(event) {
+ console.log(`Keyboard mouse crossing event: ${JSON.stringify(event)}`);
+ return false;
+},
+try {
+ inputDeviceCooperate.on('cooperation', this.callback);
+ inputDeviceCooperate.off("cooperation");
+} catch (error) {
+ console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## EventMsg
+
+Enumerates screen hopping event.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate
+
+| Name | Value | Description |
+| -------- | --------- | ----------------- |
+| MSG_COOPERATE_INFO_START | 200 | Screen hopping starts. |
+| MSG_COOPERATE_INFO_SUCCESS | 201 | Screen hopping succeeds. |
+| MSG_COOPERATE_INFO_FAIL | 202 | Screen hopping fails. |
+| MSG_COOPERATE_STATE_ON | 500 | Screen hopping is enabled. |
+| MSG_COOPERATE_STATE_OFF | 501 | Screen hopping is disabled. |
diff --git a/en/application-dev/reference/apis/js-apis-inputconsumer.md b/en/application-dev/reference/apis/js-apis-inputconsumer.md
index 8c85faa1eee7abbbc888e11cd5c12f2a308905c7..373fbf8faee9549ab17b5fbe462997f8cb3eaa30 100644
--- a/en/application-dev/reference/apis/js-apis-inputconsumer.md
+++ b/en/application-dev/reference/apis/js-apis-inputconsumer.md
@@ -38,12 +38,16 @@ This is a system API.
**Example**
```
-let keyOptions = {preKeys: [], finalKey: 3, isFinalKeyDown: true, finalKeyDownDuration: 0}
-let callback = function(keyOptions) {
- console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey,
- "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration)
+let keyOptions = { preKeys: [], finalKey: 18, isFinalKeyDown: true, finalKeyDownDuration: 0 }
+let callback = function (keyOptions) {
+ console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey,
+ "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration)
+}
+try {
+ inputConsumer.on(inputConsumer.SubscribeType.KEY, keyOptions, callback);
+} catch (error) {
+ console.info(`inputConsumer.on, error.code=${JSON.stringify(error.code)}, error.msg=${JSON.stringify(error.message)}`);
}
-inputConsumer.on('key', keyOptions, callback);
```
@@ -68,12 +72,16 @@ This is a system API.
**Example**
```
-let keyOptions = {preKeys: [], finalKey: 18, isFinalKeyDown: true, finalKeyDownDuration: 0}
-let callback = function(keyOptions) {
- console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey,
- "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration)
+let keyOptions = { preKeys: [], finalKey: 18, isFinalKeyDown: true, finalKeyDownDuration: 0 }
+let callback = function (keyOptions) {
+ console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey,
+ "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration)
+}
+try {
+ inputConsumer.off(inputConsumer.SubscribeType.KEY, keyOptions, callback);
+} catch (error) {
+ console.info(`inputConsumer.off, error.code=${JSON.stringify(error.code)}, error.msg=${JSON.stringify(error.message)}`);
}
-inputConsumer.off('key', keyOptions, callback);
```
diff --git a/en/application-dev/reference/apis/js-apis-inputdevice.md b/en/application-dev/reference/apis/js-apis-inputdevice.md
index 2f4986f90f431852a7b2e76d8f58e24ba8469ed9..f5cf9b1af9502462bd906302bee23fcff28780b4 100644
--- a/en/application-dev/reference/apis/js-apis-inputdevice.md
+++ b/en/application-dev/reference/apis/js-apis-inputdevice.md
@@ -15,6 +15,130 @@ The Input Device module implements listening for connection, disconnection, and
```js
import inputDevice from '@ohos.multimodalInput.inputDevice';
```
+## inputDevice.getDeviceList9+
+
+getDeviceList(callback: AsyncCallback<Array<number>>): void
+
+Obtains the IDs of all input devices. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------------------------- | ---- | ---------- |
+| callback | AsyncCallback<Array<number>> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+try {
+ inputDevice.getDeviceList((error, ids) => {
+ if (error) {
+ console.log(`Failed to get device list.
+ error code=${JSON.stringify(err.code)} msg=${JSON.stringify(err.message)}`);
+ return;
+ }
+ this.data = ids;
+ console.log("The device ID list is: " + ids);
+ });
+} catch (error) {
+ console.info("getDeviceList " + error.code + " " + error.message);
+}
+```
+
+## inputDevice.getDeviceList9+
+
+getDeviceList(): Promise<Array<number>>
+
+Obtains the IDs of all input devices. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
+
+**Return value**
+
+| Name | Description |
+| ---------------------------------- | ------------------------------- |
+| Promise<Array<number>> | Promise used to return the result.|
+
+**Example**
+
+```js
+try {
+ inputDevice.getDeviceList().then((ids) => {
+ console.log("The device ID list is: " + ids);
+ });
+} catch (error) {
+ console.info("getDeviceList " + error.code + " " + error.message);
+}
+```
+
+## inputDevice.getDeviceInfo9+
+
+getDeviceInfo(deviceId: number, callback: AsyncCallback<InputDeviceData>): void
+
+Obtains information about an input device. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | -------------------------------------------------------- | ---- | --------------------------------------- |
+| deviceId | number | Yes | ID of the input device. |
+| callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | Yes | Callback used to return the result, which is an **InputDeviceData** object.|
+
+**Example**
+
+```js
+// Obtain the name of the device whose ID is 1.
+try {
+ inputDevice.getDeviceInfo(1, (error, inputDevice) => {
+ if (error) {
+ console.log(`Failed to get device information.
+ error code=${JSON.stringify(err.code)} msg=${JSON.stringify(err.message)}`);
+ return;
+ }
+ console.log("The device name is: " + inputDevice.name);
+ });
+} catch (error) {
+ console.info("getDeviceInfo " + error.code + " " + error.message);
+}
+```
+
+## inputDevice.getDeviceInfo9+
+
+getDeviceInfo(deviceId: number): Promise<InputDeviceData>
+
+Obtains information about an input device. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------ | ---- | ---------------------- |
+| deviceId | number | Yes | ID of the input device.|
+
+**Return value**
+
+| Name | Description |
+| -------------------------------------------------- | ------------------------------- |
+| Promise<[InputDeviceData](#inputdevicedata)> | Promise used to return the result.|
+
+**Example**
+
+```js
+// Obtain the name of the device whose ID is 1.
+try {
+ inputDevice.getDeviceInfo(id).then((inputDevice) => {
+ console.log("The device name is: " + inputDevice.name);
+ });
+} catch (error) {
+ console.info("getDeviceInfo " + error.code + " " + error.message);
+}
+```
+
## inputDevice.on9+
@@ -35,20 +159,24 @@ Enables listening for hot swap events of an input device.
```js
let isPhysicalKeyboardExist = true;
-inputDevice.on("change", (data) => {
+try {
+ inputDevice.on("change", (data) => {
console.log("type: " + data.type + ", deviceId: " + data.deviceId);
inputDevice.getKeyboardType(data.deviceId, (err, ret) => {
- console.log("The keyboard type of the device is: " + ret);
- if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') {
- // The physical keyboard is connected.
- isPhysicalKeyboardExist = true;
- } else if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') {
- // The physical keyboard is disconnected.
- isPhysicalKeyboardExist = false;
- }
+ console.log("The keyboard type of the device is: " + ret);
+ if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') {
+ // The physical keyboard is connected.
+ isPhysicalKeyboardExist = true;
+ } else if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') {
+ // The physical keyboard is disconnected.
+ isPhysicalKeyboardExist = false;
+ }
});
-});
-// Check whether the soft keyboard is open based on the value of isPhysicalKeyboardExist.
+ });
+ // Check whether the soft keyboard is open based on the value of isPhysicalKeyboardExist.
+} catch (error) {
+ console.info("oninputdevcie " + error.code + " " + error.message);
+}
```
## inputDevice.off9+
@@ -69,24 +197,43 @@ Disables listening for hot swap events of an input device.
**Example**
```js
-function listener(data) {
- console.log("type: " + data.type + ", deviceId: " + data.deviceId);
+callback: function(data) {
+ console.log("type: " + data.type + ", deviceId: " + data.deviceId);
}
+try {
+ inputDevice.on("change", this.callback);
+} catch (error) {
+ console.info("oninputdevcie " + error.code + " " + error.message)
+}
+
+// Enable listening for hot swap events of an input device.
+inputDevice.on("change", listener);
+
// Disable this listener.
-inputDevice.off("change", listener);
+try {
+ inputDevice.off("change", this.callback);
+} catch (error) {
+ console.info("offinputdevcie " + error.code + " " + error.message)
+}
// Disable all listeners.
-inputDevice.off("change");
+try {
+ inputDevice.off("change");
+} catch (error) {
+ console.info("offinputdevcie " + error.code + " " + error.message);
+}
// By default, the soft keyboard is closed when listening is disabled.
```
-## inputDevice.getDeviceIds
+## inputDevice.getDeviceIds(deprecated)
getDeviceIds(callback: AsyncCallback<Array<number>>): void
Obtains the IDs of all input devices. This API uses an asynchronous callback to return the result.
+This API is deprecated since API version 9. You are advised to use [inputDevice.getDeviceList](#inputdevicegetdevicelist9) instead.
+
**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
**Parameters**
@@ -103,12 +250,14 @@ inputDevice.getDeviceIds((ids)=>{
});
```
-## inputDevice.getDeviceIds
+## inputDevice.getDeviceIds(deprecated)
getDeviceIds(): Promise<Array<number>>
Obtains the IDs of all input devices. This API uses a promise to return the result.
+This API is deprecated since API version 9. You are advised to use [inputDevice.getDeviceList](#inputdevicegetdevicelist9) instead.
+
**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
**Return value**
@@ -125,12 +274,14 @@ inputDevice.getDeviceIds().then((ids)=>{
});
```
-## inputDevice.getDevice
+## inputDevice.getDevice(deprecated)
getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): void
Obtains information about an input device. This API uses an asynchronous callback to return the result.
+This API is deprecated since API version 9. You are advised to use [inputDevice.getDeviceInfo](#inputdevicegetdeviceinfo9) instead.
+
**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
**Parameters**
@@ -149,12 +300,14 @@ inputDevice.getDevice(1, (inputDevice)=>{
});
```
-## inputDevice.getDevice
+## inputDevice.getDevice(deprecated)
getDevice(deviceId: number): Promise<InputDeviceData>
Obtains information about an input device. This API uses a promise to return the result.
+This API is deprecated since API version 9. You are advised to use [inputDevice.getDeviceInfo](#inputdevicegetdeviceinfo9) instead.
+
**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
**Parameters**
@@ -198,9 +351,13 @@ Obtains the key codes supported by the input device. This API uses an asynchrono
```js
// Check whether the input device whose ID is 1 supports key codes 17, 22, and 2055.
-inputDevice.supportKeys(1, [17, 22, 2055], (ret)=>{
+try {
+ inputDevice.supportKeys(1, [17, 22, 2055], (error, ret) => {
console.log("The query result is as follows: " + ret);
-});
+ });
+} catch (error) {
+ console.info("supportKeys " + error.code + " " + error.message);
+}
```
## inputDevice.supportKeys9+
@@ -228,9 +385,13 @@ Obtains the key codes supported by the input device. This API uses a promise to
```js
// Check whether the input device whose ID is 1 supports key codes 17, 22, and 2055.
-inputDevice.supportKeys(1, [17, 22, 2055]).then((ret)=>{
+try {
+ inputDevice.supportKeys(1, [17, 22, 2055]).then((ret) => {
console.log("The query result is as follows: " + ret);
-})
+ });
+} catch (error) {
+ console.info("supportKeys " + error.code + " " + error.message);
+}
```
## inputDevice.getKeyboardType9+
@@ -252,9 +413,18 @@ Obtains the keyboard type of an input device. This API uses an asynchronous call
```js
// Query the keyboard type of the input device whose ID is 1.
-inputDevice.getKeyboardType(1, (ret)=>{
- console.log("The keyboard type of the device is: " + ret);
-});
+try {
+ inputDevice.getKeyboardType(1, (error, number) => {
+ if (error) {
+ console.log(`Failed to get keyboardtype.
+ error code=${JSON.stringify(err.code)} msg=${JSON.stringify(err.message)}`);
+ return;
+ }
+ console.log("The keyboard type of the device is: " + number);
+ });
+} catch (error) {
+ console.info("getKeyboardType " + error.code + " " + error.message);
+}
```
## inputDevice.getKeyboardType9+
@@ -275,14 +445,18 @@ Obtains the keyboard type of an input device. This API uses a promise to return
```js
// Query the keyboard type of the input device whose ID is 1.
-inputDevice.getKeyboardType(1).then((ret)=>{
- console.log("The keyboard type of the device is: " + ret);
-})
+try {
+ inputDevice.getKeyboardType(1).then((number) => {
+ console.log("The keyboard type of the device is: " + number);
+ });
+} catch (error) {
+ console.info("getKeyboardType " + error.code + " " + error.message);
+}
```
## DeviceListener9+
-Defines the information about an input device.
+Defines the listener for hot swap events of an input device.
**System capability**: SystemCapability.MultimodalInput.Input.InputDevice
diff --git a/en/application-dev/reference/apis/js-apis-inputeventclient.md b/en/application-dev/reference/apis/js-apis-inputeventclient.md
index c38734f143bed4fd8288df7672d721caf4696025..695a7a5bf4b611270ff32acb8aab17cc6f802aa3 100644
--- a/en/application-dev/reference/apis/js-apis-inputeventclient.md
+++ b/en/application-dev/reference/apis/js-apis-inputeventclient.md
@@ -36,13 +36,24 @@ This is a system API.
**Example**
```js
-let keyEvent = {
+try {
+ var keyEvent = {
isPressed: true,
keyCode: 2,
keyDownDuration: 0,
isIntercepted: false
+ }
+ inputEventClient.injectKeyEvent({ KeyEvent: keyEvent });
+ var keyEvent1 = {
+ isPressed: false,
+ keyCode: 2,
+ keyDownDuration: 0,
+ isIntercepted: false
+ };
+ inputEventClient.injectKeyEvent({ KeyEvent: keyEvent1 });
+} catch (error) {
+ console.info("injectKeyEvent " + error.code + " " + error.message);
}
-let res = inputEventClient.injectEvent({KeyEvent: keyEvent});
```
diff --git a/en/application-dev/reference/apis/js-apis-inputmonitor.md b/en/application-dev/reference/apis/js-apis-inputmonitor.md
index 9fdcb88e96a336e19a87efab9c9856af746df558..315e2d81f718bff6f6f1bc9b0ce813df11850da5 100644
--- a/en/application-dev/reference/apis/js-apis-inputmonitor.md
+++ b/en/application-dev/reference/apis/js-apis-inputmonitor.md
@@ -43,10 +43,14 @@ This is a system API.
**Example**
```js
-inputMonitor.off("touch", (event) => {
- // A touch event is consumed.
- return false;
-});
+try {
+ inputMonitor.on("touch", (data)=> {
+ console.info(`monitorOnTouchEvent success ${JSON.stringify(data)}`);
+ return false;
+ });
+} catch (error) {
+ console.info("onMonitor " + error.code + " " + error.message)
+}
```
on(type: "mouse", receiver: Callback<MouseEvent>): void
@@ -69,13 +73,16 @@ This is a system API.
**Example**
```js
-inputMonitor.off("mouse", (event) => {
- // A mouse event is consumed.
-});
+try {
+ inputMonitor.on("mouse", (data)=> {
+ console.info(`monitorOnMouseEvent success ${JSON.stringify(data)}`);
+ return false;
+ });
+} catch (error) {
+ console.info("onMonitor " + error.code + " " + error.message)
+}
```
-
-
## inputMonitor.off
off(type: "touch", receiver?: TouchEventReceiver): void
@@ -98,7 +105,26 @@ This is a system API.
**Example**
```js
-inputMonitor.off("touch");
+// Disable listening globally.
+try {
+ inputMonitor.off("touch");
+} catch (error) {
+ console.info("offMonitor " + error.code + " " + error.message)
+}
+// Disable listening for this receiver.
+callback:function(data) {
+ console.info(`call success ${JSON.stringify(data)}`);
+},
+try {
+ inputMonitor.on("touch", this.callback);
+} catch (error) {
+ console.info("onTouchMonitor " + error.code + " " + error.message)
+},
+try {
+ inputMonitor.off("touch",this.callback);
+} catch (error) {
+ console.info("offTouchMonitor " + error.code + " " + error.message)
+}
```
off(type: "mouse", receiver?:Callback\):void
@@ -121,7 +147,26 @@ This is a system API.
**Example**
```js
-inputMonitor.off("mouse");
+// Disable listening globally.
+try {
+ inputMonitor.off("mouse");
+} catch (error) {
+ console.info("offMonitor " + error.code + " " + error.message)
+}
+// Disable listening for this receiver.
+callback:function(data) {
+ console.info(`call success ${JSON.stringify(data)}`);
+},
+try {
+ inputMonitor.on("mouse", this.callback);
+} catch (error) {
+ console.info("onMouseMonitor " + error.code + " " + error.message)
+},
+try {
+ inputMonitor.off("mouse", this.callback);
+} catch (error) {
+ console.info("offMouseMonitor " + error.code + " " + error.message)
+}
```
@@ -149,9 +194,13 @@ This is a system API.
**Example**
```js
-inputMonitor.on("touch", (event) => {
- // A touch event is consumed.
- return false;
-});
-inputMonitor.off("touch");
+try {
+ inputMonitor.on("touch", (event) => {
+ // If true is returned, all subsequent events of this operation will be consumed by the listener, instead of being distributed to the window.
+ return false;
+ });
+ inputMonitor.off("touch");
+} catch (error) {
+ console.info("offMonitor " + error.code + " " + error.message)
+}
```
diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md
index b29a380a5b1b2e8afb4d41687a659dc29db4344c..8c4dd734fbdbe5d2a3d2bbd621f04f54ed20d883 100644
--- a/en/application-dev/reference/apis/js-apis-media.md
+++ b/en/application-dev/reference/apis/js-apis-media.md
@@ -1,7 +1,6 @@
# Media
> **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 multimedia subsystem provides a set of simple and easy-to-use APIs for you to access the system and use media resources.
@@ -53,7 +52,7 @@ Creates a **VideoPlayer** instance. This API uses an asynchronous callback to re
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------- | ---- | ------------------------------ |
-| callback | AsyncCallback<[VideoPlayer](#videoplayer8)> | Yes | Callback used to return the **VideoPlayer** instance, which can be used to manage and play video media.|
+| callback | AsyncCallback<[VideoPlayer](#videoplayer8)> | Yes | Callback used to return the result. If the operation is successful, the **VideoPlayer** instance is returned; otherwise, **null** is returned. The instance can be used to manage and play video media.|
**Example**
@@ -80,9 +79,9 @@ Creates a **VideoPlayer** instance. This API uses a promise to return the result
**Return value**
-| Type | Description |
-| ------------------------------------- | ----------------------------------- |
-| Promise<[VideoPlayer](#videoplayer8)> | Promise used to return the **VideoPlayer** instance, which can be used to manage and play video media.|
+| Type | Description |
+| ------------------------------------- | ------------------------------------------------------------ |
+| Promise<[VideoPlayer](#videoplayer8)> | Promise used to return the result. If the operation is successful, the **VideoPlayer** instance is returned; otherwise, **null** is returned. The instance can be used to manage and play video media.|
**Example**
@@ -112,9 +111,9 @@ Only one **AudioRecorder** instance can be created per device.
**Return value**
-| Type | Description |
-| ------------------------------- | ----------------------------------------- |
-| [AudioRecorder](#audiorecorder) | Returns the **AudioRecorder** instance if the operation is successful; returns **null** otherwise.|
+| Type | Description |
+| ------------------------------- | ------------------------------------------------------------ |
+| [AudioRecorder](#audiorecorder) | Returns the **AudioRecorder** instance if the operation is successful; returns **null** otherwise. The instance can be used to record audio media.|
**Example**
@@ -135,7 +134,7 @@ Only one **AudioRecorder** instance can be created per device.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------- | ---- | ------------------------------ |
-| callback | AsyncCallback<[VideoRecorder](#videorecorder9)> | Yes | Callback used to return the **VideoRecorder** instance, which can be used to record video media.|
+| callback | AsyncCallback<[VideoRecorder](#videorecorder9)> | Yes | Callback used to return the result. If the operation is successful, the **VideoRecorder** instance is returned; otherwise, **null** is returned. The instance can be used to record video media.|
**Example**
@@ -163,9 +162,9 @@ Only one **AudioRecorder** instance can be created per device.
**Return value**
-| Type | Description |
-| ----------------------------------------- | ----------------------------------- |
-| Promise<[VideoRecorder](#videorecorder9)> | Promise used to return the **VideoRecorder** instance, which can be used to record video media.|
+| Type | Description |
+| ----------------------------------------- | ------------------------------------------------------------ |
+| Promise<[VideoRecorder](#videorecorder9)> | Promise used to return the result. If the operation is successful, the **VideoRecorder** instance is returned; otherwise, **null** is returned. The instance can be used to record video media.|
**Example**
@@ -263,7 +262,7 @@ Enumerates the buffering event types.
| BUFFERING_START | 1 | Buffering starts. |
| BUFFERING_END | 2 | Buffering ends. |
| BUFFERING_PERCENT | 3 | Buffering progress, in percent. |
-| CACHED_DURATION | 4 | Cache duration, in milliseconds.|
+| CACHED_DURATION | 4 | Cache duration, in ms.|
## AudioPlayer
@@ -362,9 +361,9 @@ Seeks to the specified playback position.
**Parameters**
-| Name| Type | Mandatory| Description |
-| ------ | ------ | ---- | ------------------------------------ |
-| timeMs | number | Yes | Position to seek to, in milliseconds.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ----------------------------------------------------------- |
+| timeMs | number | Yes | Position to seek to, in ms. The value range is [0, duration].|
**Example**
@@ -427,9 +426,9 @@ Obtains the audio track information. This API uses an asynchronous callback to r
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------------------------------ | ---- | -------------------------- |
-| callback | AsyncCallback> | Yes | Callback used to return the audio track information obtained.|
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------ |
+| callback | AsyncCallback> | Yes | Callback used to return a **MediaDescription** array, which records the audio track information.|
**Example**
@@ -463,9 +462,9 @@ Obtains the audio track information. This API uses a promise to return the resul
**Return value**
-| Type | Description |
-| ------------------------------------------------------ | ------------------------------- |
-| Promise> | Promise used to return the audio track information obtained.|
+| Type | Description |
+| ------------------------------------------------------ | ----------------------------------------------- |
+| Promise> | Promise used to return a **MediaDescription** array, which records the audio track information.|
**Example**
@@ -497,7 +496,7 @@ for (let i = 0; i < arrayDescription.length; i++) {
on(type: 'bufferingUpdate', callback: (infoType: [BufferingInfoType](#bufferinginfotype8), value: number) => void): void
-Subscribes to the audio buffering update event.
+Subscribes to the audio buffering update event. Only network playback supports this subscription.
**System capability**: SystemCapability.Multimedia.Media.AudioPlayer
@@ -594,7 +593,7 @@ audioPlayer.src = fdPath; // Set the src attribute and trigger the 'dataLoad' e
on(type: 'timeUpdate', callback: Callback\): void
-Subscribes to the **'timeUpdate'** event.
+Subscribes to the **'timeUpdate'** event. This event is reported every second when the audio playback is in progress.
**System capability**: SystemCapability.Multimedia.Media.AudioPlayer
@@ -1014,10 +1013,10 @@ Seeks to the specified playback position. The next key frame at the specified po
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------- | ---- | ------------------------------------ |
-| timeMs | number | Yes | Position to seek to, in milliseconds.|
-| callback | function | Yes | Callback used to return the result. |
+| Name | Type | Mandatory| Description |
+| -------- | -------- | ---- | ------------------------------------------------------------ |
+| timeMs | number | Yes | Position to seek to, in ms. The value range is [0, duration].|
+| callback | function | Yes | Callback used to return the result. |
**Example**
@@ -1042,11 +1041,11 @@ Seeks to the specified playback position. This API uses an asynchronous callback
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------- | ---- | ------------------------------------ |
-| timeMs | number | Yes | Position to seek to, in milliseconds.|
-| mode | [SeekMode](#seekmode8) | Yes | Seek mode. |
-| callback | function | Yes | Callback used to return the result. |
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ------------------------------------------------------------ |
+| timeMs | number | Yes | Position to seek to, in ms. The value range is [0, duration].|
+| mode | [SeekMode](#seekmode8) | Yes | Seek mode. |
+| callback | function | Yes | Callback used to return the result. |
**Example**
@@ -1072,16 +1071,16 @@ Seeks to the specified playback position. If **mode** is not specified, the next
**Parameters**
-| Name| Type | Mandatory| Description |
-| ------ | ---------------------- | ---- | ------------------------------------ |
-| timeMs | number | Yes | Position to seek to, in milliseconds.|
-| mode | [SeekMode](#seekmode8) | No | Seek mode. |
+| Name| Type | Mandatory| Description |
+| ------ | ---------------------- | ---- | ------------------------------------------------------------ |
+| timeMs | number | Yes | Position to seek to, in ms. The value range is [0, duration].|
+| mode | [SeekMode](#seekmode8) | No | Seek mode. |
**Return value**
-| Type | Description |
-| -------------- | ----------------------------------- |
-| Promise\ | Promise used to return the result.|
+| Type | Description |
+| -------------- | ------------------------------------------- |
+| Promise\ | Promise used to return the playback position, in ms.|
**Example**
@@ -1220,9 +1219,9 @@ Obtains the video track information. This API uses an asynchronous callback to r
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------------------------------ | ---- | -------------------------- |
-| callback | AsyncCallback> | Yes | Callback used to return the video track information obtained.|
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------ |
+| callback | AsyncCallback> | Yes | Callback used to return a **MediaDescription** array, which records the video track information.|
**Example**
@@ -1256,9 +1255,9 @@ Obtains the video track information. This API uses a promise to return the resul
**Return value**
-| Type | Description |
-| ------------------------------------------------------ | ------------------------------- |
-| Promise> | Promise used to return the video track information obtained.|
+| Type | Description |
+| ------------------------------------------------------ | ----------------------------------------------- |
+| Promise> | Promise used to return a **MediaDescription** array, which records the video track information.|
**Example**
@@ -1332,9 +1331,9 @@ Sets the video playback speed. This API uses a promise to return the result.
**Return value**
-| Type | Description |
-| ---------------- | ------------------------- |
-| Promise\ | Promise used to return the result.|
+| Type | Description |
+| ---------------- | ------------------------------------------------------------ |
+| Promise\ | Promise used to return playback speed. For details, see [PlaybackSpeed](#playbackspeed8).|
**Example**
@@ -1389,13 +1388,13 @@ Selects a bit rate from available ones, which can be obtained by calling [availa
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- | -------------------------------------------- |
-| bitrate | number | Yes | Bit rate to select, which is used in the HLS multi-bit rate scenario. The unit is bit/s.|
+| bitrate | number | Yes | Bit rate, which is used in the HLS multi-bit rate scenario. The unit is bit/s.|
**Return value**
-| Type | Description |
-| ---------------- | ------------------------- |
-| Promise\ | Promise used to return the result.|
+| Type | Description |
+| ---------------- | --------------------------- |
+| Promise\ | Promise used to return the bit rate.|
**Example**
@@ -1435,7 +1434,7 @@ videoPlayer.on('playbackCompleted', () => {
on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void
-Subscribes to the video buffering update event.
+Subscribes to the video buffering update event. Only network playback supports this subscription.
**System capability**: SystemCapability.Multimedia.Media.VideoPlayer
diff --git a/en/application-dev/reference/apis/js-apis-net-connection.md b/en/application-dev/reference/apis/js-apis-net-connection.md
index 4502b4cd9601bf0ae050f972a674028fb271a86a..31414ab325572d7ed25a31b1b3a78a725dce39e6 100644
--- a/en/application-dev/reference/apis/js-apis-net-connection.md
+++ b/en/application-dev/reference/apis/js-apis-net-connection.md
@@ -309,6 +309,8 @@ reportNetConnected(netHandle: NetHandle, callback: AsyncCallback<void>): v
Reports connection of the data network. This API uses an asynchronous callback to return the result.
+If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module.
+
**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core
@@ -337,6 +339,8 @@ reportNetConnected(netHandle: NetHandle): Promise<void>
Reports connection of the data network. This API uses a promise to return the result.
+If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module.
+
**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core
@@ -351,7 +355,7 @@ Reports connection of the data network. This API uses a promise to return the re
| Type| Description|
| -------- | -------- |
-| Promise<void> | Promise used to return the result.|
+| Promise<void> | Promise that returns no value.|
**Example**
@@ -370,6 +374,8 @@ reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback<void>)
Reports disconnection of the data network. This API uses an asynchronous callback to return the result.
+If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module.
+
**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core
@@ -398,6 +404,8 @@ reportNetDisconnected(netHandle: NetHandle): Promise<void>
Reports disconnection of the data network. This API uses a promise to return the result.
+If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module.
+
**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core
@@ -412,7 +420,7 @@ Reports disconnection of the data network. This API uses a promise to return the
| Type| Description|
| -------- | -------- |
-| Promise<void> | Promise used to return the result.|
+| Promise<void> | Promise that returns no value.|
**Example**
@@ -521,7 +529,7 @@ This is a system API.
| Type | Description |
| ------------------------------------------- | ----------------------------- |
-| Promise\ | Promise used to return the result.|
+| Promise\ | Promise that returns no value.|
**Example**
@@ -570,7 +578,7 @@ This is a system API.
| Type | Description |
| ------------------------------------------- | ----------------------------- |
-| Promise\ | Promise used to return the result.|
+| Promise\ | Promise that returns no value.|
**Example**
@@ -888,7 +896,7 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses
| Type | Description |
| -------------- | ---------------------- |
-| Promise\ | Promise used to return the result.|
+| Promise\ | Promise that returns no value.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-pointer.md b/en/application-dev/reference/apis/js-apis-pointer.md
index 97429f0dee1df4f12487cce5d361182ba660fe87..ea2d452000bb542e55232a29456d3811fd24526c 100644
--- a/en/application-dev/reference/apis/js-apis-pointer.md
+++ b/en/application-dev/reference/apis/js-apis-pointer.md
@@ -12,7 +12,7 @@ The mouse pointer module provides APIs related to pointer attribute management.
import pointer from '@ohos.multimodalInput.pointer';
```
-## pointer.setPointerVisibele
+## pointer.setPointerVisible9+
setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void
@@ -22,24 +22,28 @@ Sets the visible status of the mouse pointer. This API uses an asynchronous call
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------- | ---- | ------------------------------------------------------------------- |
-| visible | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the mouse pointer is visible, and the value **false** indicates the opposite.|
-| callback | AysncCallback<void> | Yes | Callback used to return the result. |
+| Name | Type | Mandatory | Description |
+| -------- | ------------------------- | ---- | ---------------------------------------- |
+| visible | boolean | Yes | Whether the mouse pointer is visible.|
+| callback | AsyncCallback<void> | Yes | Callback used to return the result.|
**Example**
```js
-pointer.setPointerVisible(true, (err, data) => {
- if (err) {
- console.log(`set pointer visible failed. err=${JSON.stringify(err)}`);
- return;
+try {
+ pointer.setPointerVisible(true, (error) => {
+ if (error) {
+ console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
}
- console.log(`set pointer visible success.`);
-);
+ console.log(`Set pointer visible success`);
+ });
+} catch (error) {
+ console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
```
-## pointer.setPointerVisible
+## pointer.setPointerVisible9+
setPointerVisible(visible: boolean): Promise<void>
@@ -49,66 +53,400 @@ Sets the visible status of the mouse pointer. This API uses a promise to return
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------- | ------- | ---- | ------------------------------------------------------------------- |
-| visible | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the mouse pointer is visible, and the value **false** indicates the opposite.|
+| Name | Type | Mandatory | Description |
+| ------- | ------- | ---- | ---------------------------------------- |
+| visible | boolean | Yes | Whether the mouse pointer is visible.|
**Return value**
-| Parameter | Description |
-| ------------------- | ------------------------------- |
+| Name | Description |
+| ------------------- | ------------------- |
| Promise<void> | Promise used to return the result.|
**Example**
```js
-pointer.setPointerVisible(false).then( data => {
- console.log(`set mouse pointer visible success`);
- }, data => {
- console.log(`set mouse pointer visible failed err=${JSON.stringify(data)}`);
-});
+try {
+ pointer.setPointerVisible(false).then(() => {
+ console.log(`Set pointer visible success`);
+ });
+} catch (error) {
+ console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
```
-## pointer.isPointerVisible
+## pointer.isPointerVisible9+
isPointerVisible(callback: AsyncCallback<boolean>): void
-Checks the visible status of the mouse pointer. This API uses an asynchronous callback to return the result.
+Checks the visible status of the mouse pointer. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------- | ---- | ---------------------------- |
-| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.|
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | -------------- |
+| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.|
**Example**
```js
-pointer.isPointerVisible((visible)=>{
- console.log("The mouse pointer visible attributes is " + visible);
-});
+try {
+ pointer.isPointerVisible((error, visible) => {
+ if (error) {
+ console.log(`Get pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Get pointer visible success, visible: ${JSON.stringify(visible)}`);
+ });
+} catch (error) {
+ console.log(`Get pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
```
-## pointer.isPointerVisible
+## pointer.isPointerVisible9+
isPointerVisible(): Promise<boolean>
-Checks the visible status of the mouse pointer. This API uses a promise to return the result.
+Checks the visible status of the mouse pointer. This API uses a promise to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
**Return value**
-| Parameter | Description |
-| ---------------------- | ------------------------------- |
+| Name | Description |
+| ---------------------- | ------------------- |
| Promise<boolean> | Promise used to return the result.|
**Example**
```js
-pointer.isPointerVisible().then( data => {
- console.log(`isPointerThen success data=${JSON.stringify(data)}`);
+pointer.isPointerVisible().then((visible) => {
+ console.log(`Get pointer visible success, visible: ${JSON.stringify(visible)}`);
});
```
+
+## pointer.setPointerSpeed9+
+
+setPointerSpeed(speed: number, callback: AsyncCallback<void>): void
+
+Sets the mouse movement speed. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ------------------------- | ---- | ------------------------------------- |
+| speed | number | Yes | Mouse movement speed. The value ranges from **1** to **11**. The default value is **5**. |
+| callback | AysncCallback<void> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+try {
+ pointer.setPointerSpeed(5, (error) => {
+ if (error) {
+ console.log(`Set pointer speed failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Set pointer speed success`);
+ });
+} catch (error) {
+ console.log(`Set pointer speed failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## pointer.setPointerSpeed9+
+
+setPointerSpeed(speed: number): Promise<void>
+
+Sets the mouse movement speed. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ----- | ------ | ---- | ----------------------------------- |
+| speed | number | Yes | Mouse movement speed. The value ranges from **1** to **11**. The default value is **5**.|
+
+**Return value**
+
+| Name | Description |
+| ------------------- | ---------------- |
+| Promise<void> | Promise used to return the result.|
+
+**Example**
+
+```js
+try {
+ pointer.setPointerSpeed(5).then(() => {
+ console.log(`Set pointer speed success`);
+ });
+} catch (error) {
+ console.log(`Set pointer speed failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## pointer.getPointerSpeed9+
+
+getPointerSpeed(callback: AsyncCallback<number>): void
+
+Obtains the mouse movement speed. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | --------------------------- | ---- | -------------- |
+| callback | AsyncCallback<number> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+try {
+ pointer.getPointerSpeed((error, speed) => {
+ if (error) {
+ console.log(`Get pointer speed failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Get pointer speed success, speed: ${JSON.stringify(speed)}`);
+ });
+} catch (error) {
+ console.log(`Get pointer speed failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## pointer.getPointerSpeed9+
+
+getPointerSpeed(): Promise<number>
+
+Obtains the mouse movement speed. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Return value**
+
+| Name | Description |
+| --------------------- | ------------------- |
+| Promise<number> | Promise used to return the result.|
+
+**Example**
+
+```js
+try {
+ pointer.getPointerSpeed().then(speed => {
+ console.log(`Get pointer speed success, speed: ${JSON.stringify(speed)}`);
+ });
+} catch (error) {
+ console.log(`Get pointer speed failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## pointer.getPointerStyle9+
+
+getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): void
+
+Obtains the mouse pointer style. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------------------- | ---- | -------------- |
+| windowId | number | Yes | Window ID. |
+| callback | AsyncCallback<[PointerStyle](#pointerstyle9)> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+import window from '@ohos.window';
+
+window.getTopWindow((error, win) => {
+ win.getProperties((error, properties) => {
+ var windowId = properties.id;
+ if (windowId < 0) {
+ console.log(`Invalid windowId`);
+ return;
+ }
+ try {
+ pointer.getPointerStyle(windowId, (error, style) => {
+ console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
+ });
+ } catch (error) {
+ console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ }
+ });
+});
+```
+
+## pointer.getPointerStyle9+
+
+getPointerStyle(windowId: number): Promise<PointerStyle>
+
+Obtains the mouse pointer style. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------ | ---- | -------- |
+| windowId | number | Yes | Window ID.|
+
+**Return value**
+
+| Name | Description |
+| ---------------------------------------- | ------------------- |
+| Promise<[PointerStyle](#pointerstyle9)> | Promise used to return the result.|
+
+**Example**
+
+```js
+import window from '@ohos.window';
+
+window.getTopWindow((error, win) => {
+ win.getProperties((error, properties) => {
+ var windowId = properties.id;
+ if (windowId < 0) {
+ console.log(`Invalid windowId`);
+ return;
+ }
+ try {
+ pointer.getPointerStyle(windowId).then((style) => {
+ console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
+ });
+ } catch (error) {
+ console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ }
+ });
+});
+```
+
+## pointer.setPointerStyle9+
+
+setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback<void>): void
+
+Sets the mouse pointer style. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------------ | ------------------------------ | ---- | ----------------------------------- |
+| windowId | number | Yes | Window ID. |
+| pointerStyle | [PointerStyle](#pointerstyle9) | Yes | Mouse pointer style ID. |
+| callback | AysncCallback<void> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+import window from '@ohos.window';
+
+window.getTopWindow((error, win) => {
+ win.getProperties((error, properties) => {
+ var windowId = properties.id;
+ if (windowId < 0) {
+ console.log(`Invalid windowId`);
+ return;
+ }
+ try {
+ pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS, error => {
+ console.log(`Set pointer style success`);
+ });
+ } catch (error) {
+ console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ }
+ });
+});
+```
+## pointer.setPointerStyle9+
+
+setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise<void>
+
+Sets the mouse pointer style. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------------------- | ------------------------------ | ---- | ---------------- |
+| windowId | number | Yes | Window ID. |
+| pointerStyle | [PointerStyle](#pointerstyle9) | Yes | Mouse pointer style ID. |
+| Promise<void> | void | Yes | Promise used to return the result.|
+
+**Example**
+
+```js
+import window from '@ohos.window';
+
+window.getTopWindow((error, win) => {
+ win.getProperties((error, properties) => {
+ var windowId = properties.id;
+ if (windowId < 0) {
+ console.log(`Invalid windowId`);
+ return;
+ }
+ try {
+ pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS).then(() => {
+ console.log(`Set pointer style success`);
+ });
+ } catch (error) {
+ console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ }
+ });
+});
+```
+## PointerStyle9+
+
+Enumerates mouse pointer styles.
+
+**System capability**: SystemCapability.MultimodalInput.Input.Pointer
+
+| Name | Value | Description |
+| -------------------------------- | ---- | ------ |
+| DEFAULT | 0 | Default |
+| EAST | 1 | East arrow |
+| WEST | 2 | West arrow |
+| SOUTH | 3 | South arrow |
+| NORTH | 4 | North arrow |
+| WEST_EAST | 5 | West-east arrow |
+| NORTH_SOUTH | 6 | North-south arrow |
+| NORTH_EAST | 7 | North-east arrow |
+| NORTH_WEST | 8 | North-west arrow |
+| SOUTH_EAST | 9 | South-east arrow |
+| SOUTH_WEST | 10 | South-west arrow |
+| NORTH_EAST_SOUTH_WEST | 11 | North-east and south-west adjustment|
+| NORTH_WEST_SOUTH_EAST | 12 | North-west and south-east adjustment|
+| CROSS | 13 | Cross (accurate selection) |
+| CURSOR_COPY | 14 | Copy cursor |
+| CURSOR_FORBID | 15 | Forbid cursor |
+| COLOR_SUCKER | 16 | Sucker |
+| HAND_GRABBING | 17 | Grabbing hand |
+| HAND_OPEN | 18 | Opening hand |
+| HAND_POINTING | 19 | Hand-shaped pointer |
+| HELP | 20 | Help |
+| MOVE | 21 | Move |
+| RESIZE_LEFT_RIGHT | 22 | Left and right resizing|
+| RESIZE_UP_DOWN | 23 | Up and down resizing|
+| SCREENSHOT_CHOOSE | 24 | Screenshot crosshair|
+| SCREENSHOT_CURSOR | 25 | Screenshot cursor |
+| TEXT_CURSOR | 26 | Text cursor |
+| ZOOM_IN | 27 | Zoom in |
+| ZOOM_OUT | 28 | Zoom out |
+| MIDDLE_BTN_EAST | 29 | Scrolling east |
+| MIDDLE_BTN_WEST | 30 | Scrolling west |
+| MIDDLE_BTN_SOUTH | 31 | Scrolling south |
+| MIDDLE_BTN_NORTH | 32 | Scrolling north |
+| MIDDLE_BTN_NORTH_SOUTH | 33 | Scrolling north-south |
+| MIDDLE_BTN_NORTH_EAST | 34 | Scrolling north-east |
+| MIDDLE_BTN_NORTH_WEST | 35 | Scrolling north-west |
+| MIDDLE_BTN_SOUTH_EAST | 36 | Scrolling south-east |
+| MIDDLE_BTN_SOUTH_WEST | 37 | Scrolling south-west |
+| MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | Moving as a cone in four directions|
diff --git a/en/application-dev/reference/apis/js-apis-sim.md b/en/application-dev/reference/apis/js-apis-sim.md
index 206ad668b6dbdaf8f12d74423a92c5d6ebaf2853..a5515dadfbd141dc16bfa44b2edffea5013109f4 100644
--- a/en/application-dev/reference/apis/js-apis-sim.md
+++ b/en/application-dev/reference/apis/js-apis-sim.md
@@ -710,7 +710,7 @@ Sets a display name for the SIM card in the specified slot. This API uses an asy
**Example**
```js
-let name = "China Mobile";
+let name = "ShowName";
sim.setShowName(0, name, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
@@ -744,7 +744,7 @@ Sets a display name for the SIM card in the specified slot. This API uses a prom
**Example**
```js
-let name = "China Mobile";
+let name = "ShowName";
let promise = sim.setShowName(0, name);
promise.then(data => {
console.log(`setShowName success, promise: data->${JSON.stringify(data)}`);
diff --git a/en/application-dev/reference/apis/js-apis-zlib.md b/en/application-dev/reference/apis/js-apis-zlib.md
index 75ac7f144e75fd9ed1068f161854fb185c0d6210..967def0ecbdfda71fe88bc55ac02e6d395046a00 100644
--- a/en/application-dev/reference/apis/js-apis-zlib.md
+++ b/en/application-dev/reference/apis/js-apis-zlib.md
@@ -1,31 +1,32 @@
-# Zip
+# zlib
+
+The **zlib** module provides APIs for file compression and decompression.
> **NOTE**
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-## Constraints
-
-None
## Modules to Import
```javascript
import zlib from '@ohos.zlib';
```
-## zlib.zipFile
-zipFile(inFile:string, outFile:string, options: Options): Promise<void>
+## zlib.zipFile(deprecated)
+zipFile(inFile: string, outFile: string, options: Options): Promise<void>
Zips a file. This API uses a promise to return the result.
+> This API is deprecated since API version 9. You are advised to use [zlib.compressFile](#zlibcompressfile9) instead.
+
**System capability**: SystemCapability.BundleManager.Zlib
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------- | ---- | ------------------------------------------------------------ |
-| inFile | string | Yes | Path of the folder or file to zip. For details about the path, see [FA Model](js-apis-Context.md) and [Stage Model](js-apis-application-context.md).|
-| outFile | string | Yes | Path of the zipped file. The file name extension is .zip. |
+| inFile | string | Yes | Path of the folder or file to zip. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
+| outFile | string | Yes | Path of the zipped file. The file name extension is .zip. |
| options | [Options](#options) | No | Optional parameters for the zip operation. |
**Return value**
@@ -36,59 +37,59 @@ Zips a file. This API uses a promise to return the result.
**Example 1**
-```javascript
-
+```typescript
// Zip a file.
-import zlib from '@ohos.zlib'
-var inFile = "/xxx/filename.xxx";
-var outFile = "/xxx/xxx.zip";
-var options = {
+import zlib from '@ohos.zlib';
+let inFile = '/xxx/filename.xxx';
+let outFile = '/xxx/xxx.zip';
+let options = {
level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
};
zlib.zipFile(inFile, outFile, options).then((data) => {
- console.log("zipFile result: " + data);
-}).catch((err)=>{
- console.log("catch((err)=>" + err);
+ console.log('zipFile result is ' + JSON.Stringify(data));
+}).catch((err) => {
+ console.log('error is ' + JSON.Stringify(err));
});
-
```
**Example 2**
-```
+```typescript
// Zip a folder.
-import zlib from '@ohos.zlib'
-var inFile = "/xxx/xxx";
-var outFile = "/xxx/xxx.zip";
-var options = {
+import zlib from '@ohos.zlib';
+let inFile = '/xxx/xxx';
+let outFile = '/xxx/xxx.zip';
+let options = {
level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
};
zlib.zipFile(inFile , outFile, options).then((data) => {
- console.log("zipFile result: " + data);
+ console.log('zipFile result is ' + JSON.Stringify(data));
}).catch((err)=>{
- console.log("catch((err)=>" + err);
+ console.log('error is ' + JSON.Stringify(err));
});
```
-## zlib.unzipFile
+## zlib.unzipFile(deprecated)
unzipFile(inFile:string, outFile:string, options: Options): Promise<void>
Unzips a file. This API uses a promise to return the result.
+> This API is deprecated since API version 9. You are advised to use [zlib.decompressFile](#zlibdecompressfile9) instead.
+
**System capability**: SystemCapability.BundleManager.Zlib
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------- | ---- | ------------------------------------------------------------ |
-| inFile | string | Yes | Path of the folder or file to zip. For details about the path, see [FA Model](js-apis-Context.md) and [Stage Model](js-apis-application-context.md).|
+| inFile | string | Yes | Path of the folder or file to unzip. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the unzipped file. |
| options | [Options](#options) | No | Optional parameters for the unzip operation. |
@@ -100,11 +101,11 @@ Unzips a file. This API uses a promise to return the result.
**Example**
-```javascript
+```typescript
// Unzip a file.
-import zlib from '@ohos.zlib'
-var inFile = "/xx/xxx.zip";
-var outFile = "/xxx";
+import zlib from '@ohos.zlib';
+let inFile = '/xx/xxx.zip';
+let outFile = '/xxx';
let options = {
level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
@@ -112,11 +113,202 @@ let options = {
strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
};
zlib.unzipFile(inFile, outFile, options).then((data) => {
- console.log("unzipFile result: " + data);
+ console.log('unzipFile result is ' + JSON.Stringify(data));
}).catch((err)=>{
- console.log("catch((err)=>" + err);
+ console.log('error is ' + JSON.Stringify(err));
})
-
+```
+
+## zlib.compressFile9+
+
+compressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback\): void;
+
+Compresses a file. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.BundleManager.Zlib
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------------------- | ------------------- | ---- | ------------------------------------------------------------ |
+| inFile | string | Yes | Path of the folder or file to compress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
+| outFile | string | Yes | Path of the compressed file. |
+| options | [Options](#options) | Yes | Compression parameters. |
+| AsyncCallback<**void**> | callback | No | Callback used to return the result. If the operation is successful, **null** is returned; otherwise, a specific error code is returned. |
+
+**Error codes**
+
+| ID| Error Message |
+| ------ | -------------------------------------- |
+| 401 | wrong param type |
+| 900001 | The Input source file is invalid. |
+| 900002 | The Input destination file is invalid. |
+
+**Example**
+
+```typescript
+// Compress a file.
+// The path used in the code must be the application sandbox path, for example, /data/storage/el2/base/haps. You can obtain the path through context.
+import zlib from '@ohos.zlib';
+let inFile = '/xxx/filename.xxx';
+let outFile = '/xxx/xxx.zip';
+let options = {
+ level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
+ memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
+ strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
+};
+
+try {
+ zlib.compressFile(inFile, outFile, options, (errData) => {
+ if (erData !== null) {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+ }
+ })
+} catch(errData) {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+}
+```
+
+compressFile(inFile: string, outFile: string, options: Options): Promise\;
+
+Compresses a file. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.BundleManager.Zlib
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ------- | ------------------- | ---- | ------------------------------------------------------------ |
+| inFile | string | Yes | Path of the folder or file to compress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
+| outFile | string | Yes | Path of the compressed file. |
+| options | [Options](#options) | Yes | Compression parameters. |
+
+**Error codes**
+
+| ID| Error Message |
+| ------ | -------------------------------------- |
+| 401 | wrong param type |
+| 900001 | The Input source file is invalid. |
+| 900002 | The Input destination file is invalid. |
+
+```typescript
+// Compress a file.
+// The path used in the code must be the application sandbox path, for example, /data/storage/el2/base/haps. You can obtain the path through context.
+import zlib from '@ohos.zlib';
+let inFile = '/xxx/filename.xxx';
+let outFile = '/xxx/xxx.zip';
+let options = {
+ level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
+ memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
+ strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
+};
+
+try {
+ zlib.compressFile(inFile, outFile, options).then((data) => {
+ console.info('compressFile success');
+ }).catch((errData) => {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+ })
+} catch(errData) {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+}
+```
+
+
+
+## zlib.decompressFile9+
+
+decompressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback\): void;
+
+Decompresses a file. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.BundleManager.Zlib
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------------------- | ------------------- | ---- | ------------------------------------------------------------ |
+| inFile | string | Yes | Path of the file to decompress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
+| outFile | string | Yes | Path of the decompressed file. |
+| options | [Options](#options) | Yes | Decompression parameters. |
+| AsyncCallback<**void**> | callback | No | Callback used to return the result. If the operation is successful, **null** is returned; otherwise, a specific error code is returned. |
+
+**Error codes**
+
+| ID| Error Message |
+| ------ | -------------------------------------- |
+| 401 | wrong param type |
+| 900001 | The Input source file is invalid. |
+| 900002 | The Input destination file is invalid. |
+
+**Example**
+
+```typescript
+// Decompress a file.
+// The path used in the code must be the application sandbox path, for example, /data/storage/el2/base/haps. You can obtain the path through context.
+import zlib from '@ohos.zlib';
+let inFile = '/xx/xxx.zip';
+let outFile = '/xxx';
+let options = {
+ level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
+ memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
+ strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
+};
+
+try {
+ zlib.decompressFile(inFile, outFile, options, (errData) => {
+ if (erData !== null) {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+ }
+ })
+} catch(errData) {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+}
+```
+
+decompressFile(inFile: string, outFile: string, options: Options): Promise\;
+
+Decompress a file. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.BundleManager.Zlib
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ------- | ------------------- | ---- | ------------------------------------------------------------ |
+| inFile | string | Yes | Path of the file to decompress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
+| outFile | string | Yes | Path of the decompressed file. |
+| options | [Options](#options) | Yes | Decompression parameters. |
+
+**Error codes**
+
+| ID| Error Message |
+| ------ | -------------------------------------- |
+| 401 | wrong param type |
+| 900001 | The Input source file is invalid. |
+| 900002 | The Input destination file is invalid. |
+
+```typescript
+// Decompress a file.
+// The path used in the code must be the application sandbox path, for example, /data/storage/el2/base/haps. You can obtain the path through context.
+import zlib from '@ohos.zlib';
+let inFile = '/xx/xxx.zip';
+let outFile = '/xxx';
+let options = {
+ level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
+ memLevel: zlib.MemLevel.MEM_LEVEL_DEFAULT,
+ strategy: zlib.CompressStrategy.COMPRESS_STRATEGY_DEFAULT_STRATEGY
+};
+
+try {
+ zlib.deCompressFile(inFile, outFile, options).then((data) => {
+ console.info('deCompressFile success');
+ }).catch((errData) => {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+ })
+} catch(errData) {
+ console.log(`errData is errCode:${errData.errCode} message:${errData.message}`);
+}
```
## Options
@@ -129,16 +321,6 @@ zlib.unzipFile(inFile, outFile, options).then((data) => {
| memLevel | MemLevel | No | See [zip.MemLevel](#zipmemlevel). |
| strategy | CompressStrategy | No | See [zip.CompressStrategy](#zipcompressstrategy).|
-## zip.MemLevel
-
-**System capability**: SystemCapability.BundleManager.Zlib
-
-| Name | Value | Description |
-| ----------------- | ---- | -------------------------------- |
-| MEM_LEVEL_MIN | 1 | Minimum memory used by the **zip** API during compression.|
-| MEM_LEVEL_MAX | 9 | Maximum memory used by the **zip** API during compression.|
-| MEM_LEVEL_DEFAULT | 8 | Default memory used by the **zip** API during compression.|
-
## zip.CompressLevel
**System capability**: SystemCapability.BundleManager.Zlib
@@ -150,6 +332,16 @@ zlib.unzipFile(inFile, outFile, options).then((data) => {
| COMPRESS_LEVEL_BEST_COMPRESSION | 9 | Compression level 9 that gives the best compression. |
| COMPRESS_LEVEL_DEFAULT_COMPRESSION | -1 | Default compression level. |
+## zip.MemLevel
+
+**System capability**: SystemCapability.BundleManager.Zlib
+
+| Name | Value | Description |
+| ----------------- | ---- | -------------------------------- |
+| MEM_LEVEL_MIN | 1 | Minimum memory used by the **zip** API during compression.|
+| MEM_LEVEL_MAX | 9 | Maximum memory used by the **zip** API during compression.|
+| MEM_LEVEL_DEFAULT | 8 | Default memory used by the **zip** API during compression.|
+
## zip.CompressStrategy
**System capability**: SystemCapability.BundleManager.Zlib
diff --git a/en/application-dev/reference/errorcodes/errorcode-AccessToken.md b/en/application-dev/reference/errorcodes/errorcode-AccessToken.md
new file mode 100644
index 0000000000000000000000000000000000000000..306ad41da505db3a42a8d6668ce00b47c7e3f60e
--- /dev/null
+++ b/en/application-dev/reference/errorcodes/errorcode-AccessToken.md
@@ -0,0 +1,140 @@
+# Access Token Error Codes
+
+## 401 Parameter Error
+
+### Error Message
+Parameter error.${messageInfo}.
+
+### Possible Causes
+This error code is reported if an error occurs during JS parameter parsing. The possible causes are as follows:
+1. The number of input parameters is insufficient.
+2. The parameter type is incorrect.
+
+### Solution
+1. Add input parameters.
+2. Correct parameter types.
+
+
+## 201 Permission denied.
+
+### Error Message
+Permission denied.${messageInfo}.
+
+### Possible Causes
+This error code is reported if the application process that calls an API is not granted the required permission. The possible causes are as follows:
+1. The application process is not granted the required permission.
+2. The permission requires user authorization to take effect, but the application process does not obtain the user authorization.
+
+### Solution
+1. Check whether the application process is granted the required permission.
+2. Check whether the application process has obtained the user authorization if the permission requires user authorization to take effect.
+
+
+## 12100001 Invalid Parameters
+
+### Error Message
+Parameter invalid, message is ${messageInfo}.
+
+### Possible Causes
+This error code is reported if an error occurs during parameter verification. The possible causes are as follows:
+1. The value of **tokenId** is **0**.
+2. The specified permission name is empty or contains more than 256 characters.
+3. The **flag** value in the permission authorization or revocation request is invalid.
+4. The input parameters specified for registering a listener are incorrect.
+
+### Solution
+1. Correct the invalid parameter values.
+
+
+## 12100002 TokenId does not exist.
+
+### Error Message
+TokenId does not exist.
+
+### Possible Causes
+1. The specified **tokenId** does not exist.
+2. The process corresponding to the specified **tokenId** is not an application process.
+
+### Solution
+Set a correct **tokenId**, and make sure that the process corresponding to the specified **tokenId** is an application process.
+
+
+## 12100003 Permission Not Exist
+
+### Error Message
+Permission does not exist.
+
+### Possible Causes
+1. The specified **permissionName** does not exist.
+2. The specified **permissionName** does not match the specified **tokenId** in the permission authorization or revocation scenario.
+3. The specified **permissionName** is not a sensitive permission that requires user authorization.
+
+### Solution
+Set the **permissionName** parameter correctly. For details, see [permission-list](../../security/permission-list.md).
+
+
+## 12100004 Listener APIs Not Used in Pairs
+
+### Error Message
+The listener interface is not used together.
+
+### Possible Causes
+This error code is reported if listener APIs are not used in pairs. The possible causes are as follows:
+1. The listener APIs that need to be used in pairs are repeatedly called.
+2. The listener APIs that need to be used in pairs are independently called.
+
+### Solution
+1. Check whether the API needs to be used in pairs. That is, if an API is called to enable listening, an API with the same input parameters cannot be called unless an API is called to stop listening first.
+2. Check whether the API needs to be used in pairs. That is, an API for disabling listening or unregistering a listener can only be called after the API for enabling listening or registering a listener is called.
+
+
+## 12100005 Listener Overflow
+
+### Error Message
+The number of listeners exceeds the limit.
+
+### Possible Causes
+The number of listeners exceeds 200 (the upper limit).
+
+### Solution
+Abandon unused listeners in a timely manner.
+
+
+## 12100006 Permission Granting or Revocation Not Supported for the Specified Application
+
+### Error Message
+The specified application does not support the permissions granted or ungranted as specified.
+
+### Possible Causes
+1. The specified **tokenId** is the identity of the remote device. Distributed granting and revocation are not yet supported.
+2. The specified **tokenId** belongs to a sandbox application, which is not allowed to apply for the specified permission.
+
+### Solution
+1. Check whether the method of obtaining **tokenId** is correct.
+2. Check whether the sandbox application works in restrictive mode. Most permissions cannot be granted to a sandbox application in restrictive mode.
+
+
+## 12100007 System Services Not Working Properly
+
+### Error Message
+Service is abnormal.
+
+### Possible Causes
+This error code is reported if system services are not working properly. The possible causes are as follows:
+1. The permission management service cannot be started properly.
+2. An error occurs while reading or writing IPC data.
+
+### Solution
+System services do not work properly. Try again later or restart the device.
+
+
+## 12100008 Out of Memory
+
+### Error Message
+Out of memory.
+
+### Possible Causes
+The system memory is insufficient.
+
+### Solution
+Try again later or restart the device.
diff --git a/en/application-dev/reference/errorcodes/errorcode-sensors.md b/en/application-dev/reference/errorcodes/errorcode-sensors.md
new file mode 100644
index 0000000000000000000000000000000000000000..155ff9263f550685e1b8dfc47016acc242ab5c9c
--- /dev/null
+++ b/en/application-dev/reference/errorcodes/errorcode-sensors.md
@@ -0,0 +1,40 @@
+# Pan-Sensor Error Codes
+
+## 14500101 Service exception.
+
+### Error information
+
+Service exception.
+
+### Description
+
+This error code is reported if the HDI service is abnormal when the **on**, **once**, or **off** interface of the sensor module is called.
+
+### Possible Causes
+
+The HDI service is abnormal.
+
+### Procedure
+
+1. Retry the operation at a specified interval (for example, 1s) or at an exponential increase interval.
+2. If the operation fails for three consecutive times, stop the attempt. You can also attempt to obtain the sensor list to check for device availability.
+
+## 14600101 Device operation failed.
+
+### Error Message
+
+Device operation failed.
+
+### Description
+
+This error code is reported if the HDI service is abnormal or the device is occupied when the **startVibration** interface of the vibrator module is called.
+
+### Possible Causes
+
+1. The HDI service is abnormal.
+2. The device is occupied.
+
+### Procedure
+
+1. Retry the operation at a specified interval or at an exponential increase interval. If the operation fails for three consecutive times, stop the retry. You can also obtain the vibrator list to check for device availability.
+2. Set a higher priority for the vibrator.
diff --git a/en/application-dev/reference/errorcodes/errorcode-zlib.md b/en/application-dev/reference/errorcodes/errorcode-zlib.md
new file mode 100644
index 0000000000000000000000000000000000000000..ea2b330abea46f7f9a9eebfff7e427cf57197cc2
--- /dev/null
+++ b/en/application-dev/reference/errorcodes/errorcode-zlib.md
@@ -0,0 +1,40 @@
+# zlib Error Codes
+
+## 900001 Invalid Source File
+
+**Error Message**
+
+The input source file is invalid.
+
+**Description**
+
+This error code is reported when the source file passed in the **compress** or **decompress** API is invalid.
+
+**Possible Causes**
+
+When the **compress** API is called, the file to compress does not exist. When the **decompress** API is called, the file to decompress does not exist.
+
+**Procedure**
+
+1. Check whether the source file exists.
+2. Check whether the path of the source file exists and whether the path is the correct sandbox path.
+
+## 900002 Invalid Destination File
+
+**Error Message**
+
+The input destination file is invalid.
+
+**Description**
+
+This error code is reported when the destination file passed in the **compress** or **decompress** API is invalid.
+
+**Possible Causes**
+
+1. When the **compress** API is called, the passed destination file path is invalid, for example, a non-exist sandbox path.
+2. When the **decompress** API is called, the destination folder does not exist.
+
+**Procedure**
+
+1. Check whether the destination file path is correct. If not, enter the correct sandbox path.
+2. Check whether the destination folder exists. If not, create the folder.
diff --git a/en/application-dev/reference/errorcodes/errorcodes-multimodalinput.md b/en/application-dev/reference/errorcodes/errorcodes-multimodalinput.md
new file mode 100644
index 0000000000000000000000000000000000000000..bca5dbf90bcec2b16c36c45edee7576ef50f3358
--- /dev/null
+++ b/en/application-dev/reference/errorcodes/errorcodes-multimodalinput.md
@@ -0,0 +1,43 @@
+# Screen Hopping Error Codes
+
+## 4400001 Incorrect Target Device Descriptor
+
+**Error Message**
+
+Incorrect descriptor for the target device.
+
+**Description**
+
+This error code is reported if an invalid device descriptor is passed to the screen hopping API.
+
+**Possible Causes**
+
+1. The target device does not exist, or the device is not networked.
+2. The target device descriptor is empty.
+
+**Solution**
+
+1. Check whether the target device for screen hopping is correctly networked with the local device.
+2. Set the target device descriptor correctly.
+
+## 4400002 Input Device Operation Failed
+
+**Error Message**
+
+Failed to operate the input device.
+
+**Description**
+
+This error code is reported if the screen hopping status is abnormal when the screen hopping API is called.
+
+**Possible Causes**
+
+1. When screen hopping is initiated, the local device is in the hopped state.
+2. When screen hopping is disabled, the local device is in the free state.
+3. When screen hopping is disabled, the local device is in the hopping state.
+
+**Solution**
+
+1. When initiating screen hopping, make sure that the local device is not in the hopped state.
+2. When disabling screen hopping, make sure that the local device is not in the free state.
+3. When disabling screen hopping, make sure that the local device is not in the hopping state.
diff --git a/en/device-dev/get-code/sourcecode-acquire.md b/en/device-dev/get-code/sourcecode-acquire.md
index b244824c3be958bf35bbf78f6d2f689d2e931a6a..08809554460c986eae58f3d0a0ece2b6bb58904d 100644
--- a/en/device-dev/get-code/sourcecode-acquire.md
+++ b/en/device-dev/get-code/sourcecode-acquire.md
@@ -180,14 +180,14 @@ The table below provides only the sites for downloading the latest OpenHarmony L
| Hi3518 solution (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_aries.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_aries.tar.gz.sha256)|
| Hi3516 solution-LiteOS (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus.tar.gz)|
| Hi3516 solution-Linux (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz.sha256) |
-| RELEASE-NOTES | 3.0 | [Download](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/en/release-notes/OpenHarmony-v3.0-LTS.md)| - |
+| Release Notes | 3.0 | [Download](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/en/release-notes/OpenHarmony-v3.0-LTS.md)| - |
| **Source code of the Latest Release**| **Version Information**| **Site**| **SHA-256 Verification Code**|
-| Full code base (for mini, small, and standard systems)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/code-v3.2-Beta2.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/code-v3.2-Beta2.tar.gz.sha256)|
-| RK3568 standard system solution (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/standard_rk3568.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.1.1/standard_rk3568.tar.gz.sha256)|
-| Hi3861 solution (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_pegasus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_pegasus.tar.gz.sha256) |
-| Hi3516 solution-LiteOS (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_taurus.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta2/hispark_taurus_LiteOS.tar.gz.sha256)|
-| Hi3516 solution-Linux (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta2/hispark_taurus_Linux.tar.gz.sha256)|
-| RELEASE-NOTES | 3.2 Beta2 | [Download](../../release-notes/OpenHarmony-v3.2-beta2.md)| - |
+| Full code base (for mini, small, and standard systems)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/code-v3.2-Beta3.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/code-v3.2-Beta3.tar.gz.sha256)|
+| RK3568 standard system solution (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/standard_rk3568.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.1.1/standard_rk3568.tar.gz.sha256)|
+| Hi3861 solution (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_pegasus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_pegasus.tar.gz.sha256) |
+| Hi3516 solution-LiteOS (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_taurus.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/hispark_taurus_LiteOS.tar.gz.sha256)|
+| Hi3516 solution-Linux (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/hispark_taurus_Linux.tar.gz.sha256)|
+| Release Notes | 3.2 Beta3 | [Download](../../release-notes/OpenHarmony-v3.2-beta3.md)| - |
| **Compiler Toolchain**| **Version Information**| **Site**| **SHA-256 Verification Code**|
| Compiler toolchain| - | [Download](https://repo.huaweicloud.com/openharmony/os/2.0/tool_chain/)| - |
diff --git a/en/readme/location.md b/en/readme/location.md
index 369f272c6ec8d1af651f9b69ae4db2d893df464e..035cec4b31d6ddb0b432b7de28bd5a8367c0c002 100644
--- a/en/readme/location.md
+++ b/en/readme/location.md
@@ -28,9 +28,8 @@ Location awareness helps determine where a mobile device locates. The system ide
WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points (APs) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network.
-**Figure 1** ** Location subsystem architecture**
+**Figure 1** Location subsystem architecture**
-![](figures/location_En-1.png)
![](figures/location_En-1.png)
## Directory Structure
@@ -116,7 +115,7 @@ The following table describes APIs available for obtaining device location infor
If your application needs to access the device location information when running on the background, it must be allowed to run on the background in the configuration file and also granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information even when your application moves to the background.
- You can declare the required permission in your application's configuration file. For details, see [Application Package Structure Configuration File](../application-dev/quick-start/stage-structure.md).
+ You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../application-dev/security/accesstoken-guidelines.md).
2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities.
diff --git a/en/release-notes/api-change/v3.1-Release/Readme-EN.md b/en/release-notes/api-change/v3.1-Release/Readme-EN.md
index d84adb9e93c862893399d0c1276a2cde150a44fb..e7465982e34f079913c30cf77dd1865e5f85a3e2 100644
--- a/en/release-notes/api-change/v3.1-Release/Readme-EN.md
+++ b/en/release-notes/api-change/v3.1-Release/Readme-EN.md
@@ -4,3 +4,4 @@ This directory records the API changes in OpenHarmony 3.1 Release over OpenHarmo
- [JS API Differences](js-apidiff-v3.1-release.md)
- [Native API Differences](native-apidiff-v3.1-release.md)
+- [Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)](changelog-v3.1-release.md)
diff --git a/en/release-notes/api-change/v3.1-Release/changelog-v3.1-release.md b/en/release-notes/api-change/v3.1-Release/changelog-v3.1-release.md
new file mode 100644
index 0000000000000000000000000000000000000000..597bda22e9a8564f20be1ca5dfa4d1b8d25f023c
--- /dev/null
+++ b/en/release-notes/api-change/v3.1-Release/changelog-v3.1-release.md
@@ -0,0 +1,56 @@
+# Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)
+
+### Added Validity Verification for Color Values in Color.json
+
+Validity verification is added for color values in the **color.json** file. The verification rules are as follows:
+
+- The hexadecimal color code is used in any of the following formats:
+ - #rgb: red(0-f) green(0-f) blue(0-f)
+ - #argb: transparency(0-f) red(0-f) green(0-f) blue(0-f)
+ - #rrggbb: red(00-ff) green(00-ff) blue(00-ff)
+ - #aarrggbb: transparency(00-ff) red(00-ff) green(00-ff) blue(00-ff)
+- The dollar sign ($) is used to reference resources defined in the application. The format is as follows:
+ - $color:xxx
+
+**Change Impacts**
+
+If the verification rules are not met, an error is reported during compilation.
+
+**Key API/Component Changes**
+
+None
+
+### Restrictions on Declaring Multiple Data Types of State Variables
+
+If a **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variable supports multiple data types, they must be all simple data types or references at one time.
+
+Example:
+
+```ts
+@Entry
+@Component
+struct Index {
+ // Incorrect: @State message: string | Resource = 'Hello World'
+ @State message: string = 'Hello World'
+
+ build() {
+ Row() {
+ Column() {
+ Text(`${ this.message }`)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
+
+**Change Impacts**
+
+When the defined state variable type contains both the simple data types and references, an error is reported during compilation.
+
+**Key API/Component Changes**
+
+If the defined state variable type contains both the simple data types and references, change the type to one of them, as shown in the preceding sample code.
diff --git a/en/release-notes/api-change/v3.2-beta2/Readme-EN.md b/en/release-notes/api-change/v3.2-beta2/Readme-EN.md
index 21548e70cc7276031e010cd063888682d7d79cb9..9c0ced90f4aaeb828bdc7aeffe8d52204cfd1f67 100644
--- a/en/release-notes/api-change/v3.2-beta2/Readme-EN.md
+++ b/en/release-notes/api-change/v3.2-beta2/Readme-EN.md
@@ -31,5 +31,6 @@ This directory records the API changes in OpenHarmony 3.2 Beta2 over OpenHarmony
- [Web subsystem](js-apidiff-web.md)
- [Window manager subsystem](js-apidiff-window.md)
- ChangeLog
- - [Updates Between OpenHarmony 3.2 Beta2 and OpenHarmony 3.2 Beta1](changelog-v3.2-beta2.md)
+ - [Updates (OpenHarmony 3.2 Beta1 -> OpenHarmony 3.2 Beta2)](changelog-v3.2-beta2.md)
- [Adaptation Guide for the Application Sandbox](application-sandbox-adaptation-guide.md)
+
diff --git a/en/release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md b/en/release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md
index 418b75ae1af0a1dba20d7dabe86a06243e956e46..087c63757f0fc93730cb637b15df1d5e7c1e8d3e 100644
--- a/en/release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md
+++ b/en/release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md
@@ -1,4 +1,4 @@
-# Updates Between OpenHarmony 3.2 Beta2 and OpenHarmony 3.2 Beta1
+# Updates (OpenHarmony 3.2 Beta1 -> OpenHarmony 3.2 Beta2)
## Introduced Application Sandbox
diff --git a/en/release-notes/api-change/v3.2-beta3/Readme-EN.md b/en/release-notes/api-change/v3.2-beta3/Readme-EN.md
index af4d7cc1dd326b2a086cacd23eebeb5f49bb1b78..816c48c5c111e2d70682fd7125cae3563cc33a0a 100644
--- a/en/release-notes/api-change/v3.2-beta3/Readme-EN.md
+++ b/en/release-notes/api-change/v3.2-beta3/Readme-EN.md
@@ -30,3 +30,4 @@ This directory records the API changes in OpenHarmony 3.2 Beta3 over OpenHarmony
- [Update subsystem](js-apidiff-update.md)
- [Web subsystem](js-apidiff-web.md)
- [Window manager subsystem](js-apidiff-window.md)
+- [Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3)](changelog-v3.2-beta3.md)
diff --git a/en/release-notes/api-change/v3.2-beta3/changelog-v3.2-beta3.md b/en/release-notes/api-change/v3.2-beta3/changelog-v3.2-beta3.md
new file mode 100644
index 0000000000000000000000000000000000000000..0070fc5fd80a26c7d2611af75272011357b5727a
--- /dev/null
+++ b/en/release-notes/api-change/v3.2-beta3/changelog-v3.2-beta3.md
@@ -0,0 +1,234 @@
+# Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3)
+
+## Bundle Management Framework
+
+The privilege control capability is added for preset applications. The capability can be divided into two parts: permission control for preset applications and configuration of preset applications.
+Application privileges are high-level capabilities of an application, for example, restricting an application from being uninstalled or restricting application data from being deleted.
+OpenHarmony provides both general and device-specific application privileges. The latter can be configured by device vendors for applications on different devices. OpenHarmony supports differentiated configuration of preset applications on different devices. In addition, OpenHarmony provides **GetCfgDirList** for your application to obtain the preset directories, such as **system**, **chipset**, **sys_prod**, and **chip_prod**, in ascending order of priority. For example, the priority of **chip_prod** is higher than that of **system**.
+
+### Changed Installation Mode for Preset Applications
+
+In earlier versions, preset applications are installed by automatically scanning and installing HAP files in the **/system/app** directory. From this version, preset applications are configured based on the trustlist. Specifically, only the HAP file configured with **app-dir** in the **install_list.json** file can be automatically installed as a preset application.
+
+**Change Impacts**
+
+JS and native APIs are not involved, and application development is not affected.
+
+**Key API/Component Changes**
+
+N/A
+
+**Adaptation Guide**
+
+Configure related fields in the [/system/etc/app/install_list.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list.json) file. The **app_dir** field specifies the directory where the HAP file is located, and **removable** specifies whether the HAP file can be uninstalled after being installed.
+
+Example:
+
+```json
+{
+ "install_list" : [
+ {
+ "app_dir" : "/system/app/com.ohos.systemui",
+ "removable" : false
+ },
+ {
+ "app_dir" : "/system/app/demo.hap",
+ "removable" : true
+ }
+ ]
+}
+```
+
+### Changes in General Application Privilege Control
+
+For a specific application, the general application privileges remain unchanged on all types of devices. The general application privileges are as follows:
+| Permission| Description |
+| ---------------- | ------------------------------------------------------------ |
+| AllowAppDataNotCleared | Allows application data to be deleted.|
+| AllowAppMultiProcess | Allows the application to run on multiple processes.|
+| AllowAppDesktopIconHide | Allows the application icon to be hidden from the home screen.|
+| AllowAbilityPriorityQueried | Allows an ability to configure and query the priority. |
+| AllowAbilityExcludeFromMissions | Allows an ability to be hidden in the mission stack.|
+| AllowAppUsePrivilegeExtension | Allows the application to use Service Extension and Data Extension abilities.|
+| AllowFormVisibleNotify | Allows a widget to be visible on the home screen.|
+
+In earlier versions, these privileges are configured in the **config.json** or **module.json** file and distinguished based on the application type (preset or system application). From this version, the privileges are configured based on the signing certificate and preset trustlist.
+
+**Change Impacts**
+
+JS and native APIs are not involved. If your application needs to use any of these privileges, apply for it. For details about how to apply for and configure the privileges, see [Application Privilege Configuration](../device-dev/subsystems/subsys-app-privilege-config-guide.md).
+
+**Key API/Component Changes**
+
+N/A
+
+**Adaptation Guide**
+
+See [Application Privilege Configuration](../device-dev/subsystems/subsys-app-privilege-config-guide.md).
+
+```json
+{
+ "version-name": "1.0.0",
+ ...
+ "bundle-info": {
+ "developer-id": "OpenHarmony",
+ ...
+ },
+ "issuer": "pki_internal",
+ "app-privilege-capabilities": ["AllowAppDataNotCleared", "AllowAppDesktopIconHide"] // The application data cannot be deleted, and the icon can be hidden on the home screen.
+}
+```
+
+### Changes in Device-specific Application Privilege Control
+In addition to general application privileges, device vendors can define device-specific privileges for an application, as described in the table below.
+
+| Permission | Type | Default Value| Description |
+| --------------------- | -------- | ------ | ------------------------------------------------- |
+| removable | bool | true | Allows the application to be uninstalled. This permission takes effect only for preset applications. |
+| keepAlive | bool | false | Allows the application to remain resident in the background. |
+| singleton | bool | false | Allows the application to be installed for a single user (User 0). |
+| allowCommonEvent | string[] | - | Allows the application to be started by a static broadcast. |
+| associatedWakeUp | bool | false | Allows the application in the FA model to be woken up by an associated application. |
+| runningResourcesApply | bool | false | Allows the application to request running resources, such as CPU, event notifications, and Bluetooth.|
+
+In earlier versions, these privileges are configured in the **config.json** or **module.json** file and distinguished based on the application type (preset or system application). From this version, the privileges can be configured based on the preset trustlist. For details, see [install_list_capability.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_capability.json).
+
+**Change Impacts**
+
+JS and native APIs are not involved. If your application needs to use any of these privileges, apply for it. For details, see [Configuration Mode](../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-mode).
+
+**Key API/Component Changes**
+
+N/A
+
+**Adaptation Guide**
+
+See [Configuration Mode](../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-mode).
+
+```json
+{
+ "install_list": [
+ {
+ "bundleName": "com.example.kikakeyboard",
+ "singleton": true, // The application is installed for a single user.
+ "keepAlive": true, // The application remains resident in the background.
+ "runningResourcesApply": true, // The application can apply for running resources such as CPU, event notifications, and Bluetooth.
+ "associatedWakeUp": true, // The application in the FA model can be woken up by an associated application.
+ "app_signature": ["8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC"], // The setting takes effect only when the configured certificate fingerprint is the same as the HAP certificate fingerprint.
+ "allowCommonEvent": ["usual.event.SCREEN_ON", "usual.event.THERMAL_LEVEL_CHANGED"]
+ }
+}
+```
+
+### Fingerprint Verification for Pre-authorization Trustlist
+
+The pre-authorization file [install_list_permissions.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json) is moved from **system/etc/permission** to **system/etc/app/** on the development board. The **app_signature** field is added to specify the fingerprint of the HAP file. Multiple fingerprints can be configured. Authorization can be performed only when the fingerprint is matched.
+
+**Change Impacts**
+
+JS and native APIs are not involved. If your application uses pre-authorization, add the fingerprint to the pre-authorization file.
+
+**Key API/Component Changes**
+
+N/A
+
+**Adaptation Guide**
+
+Refer to the following code:
+
+```json
+{
+[
+ {
+ "bundleName" : "com.ohos.screenshot",
+ "app_signature" : ["8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"],
+ "permissions" : [
+ {
+ "name" : "ohos.permission.MEDIA_LOCATION",
+ "userCancellable" : true
+ },
+ {
+ "name" : "ohos.permission.READ_MEDIA",
+ "userCancellable" : true
+ },
+ {
+ "name" : "ohos.permission.WRITE_MEDIA",
+ "userCancellable" : true
+ }
+ ]
+ }
+}
+```
+
+## ArkUI Development Framework
+
+### Rectified Variable Sharing Issue of the Common Module in Release HAP Mode During Building in the FA Model
+
+Assume that two pages depend on the same object (foodData) of a file. If page A modifies the object, page B obtains the new value when reading the object. This implements object sharing for the common module.
+
+**Change Impacts**
+
+Application compilation is not affected, and no interface adaptation is required.
+
+**Key API/Component Changes**
+
+N/A
+
+### Restrictions on Declaring Multiple Data Types of State Variables
+
+If a **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variable supports multiple data types, they must be all simple data types or references at one time.
+
+Example:
+
+```ts
+@Entry
+@Component
+struct Index {
+ // Incorrect: @State message: string | Resource = 'Hello World'
+ @State message: string = 'Hello World'
+
+ build() {
+ Row() {
+ Column() {
+ Text(`${ this.message }`)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+```
+
+**Change Impacts**
+
+When the defined state variable type contains both the simple data types and references, an error is reported during compilation.
+
+**Key API/Component Changes**
+
+If the defined state variable type contains both the simple data types and references, change the type to one of them, as shown in the preceding sample code.
+
+## Globalization Subsystem
+
+### Added Validity Verification for Color Values in Color.json
+
+Validity verification is added for color values in the **color.json** file. The verification rules are as follows:
+
+- The hexadecimal color code is used in any of the following formats:
+ - #rgb: red(0-f) green(0-f) blue(0-f)
+ - #argb: transparency(0-f) red(0-f) green(0-f) blue(0-f)
+ - #rrggbb: red(00-ff) green(00-ff) blue(00-ff)
+ - #aarrggbb: transparency(00-ff) red(00-ff) green(00-ff) blue(00-ff)
+- The dollar sign ($) is used to reference resources defined in the application. The format is as follows:
+ - $color:xxx
+
+**Change Impacts**
+
+If the verification rules are not met, an error is reported during compilation.
+
+**Key API/Component Changes**
+
+N/A
+
+
\ No newline at end of file
diff --git a/en/website.md b/en/website.md
index dcd1bc06fea931fb3fe160b92f1333ba2f416981..4165d8468ba31e9d420f14dfec9fb3fefa5199d6 100644
--- a/en/website.md
+++ b/en/website.md
@@ -58,6 +58,7 @@
- [Update subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-update.md)
- [Web subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-window.md)
+ - [Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3)](release-notes/api-change/v3.2-beta3/changelog-v3.2-beta3.md)
- OpenHarmony 3.2 Beta2
- JS API Differences
- [Ability framework](release-notes/api-change/v3.2-beta2/js-apidiff-ability.md)
@@ -88,7 +89,7 @@
- [Web subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-window.md)
- ChangeLog
- - [Updates Between OpenHarmony 3.2 Beta2 and OpenHarmony 3.2 Beta1](release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md)
+ - [Updates (OpenHarmony 3.2 Beta1 -> OpenHarmony 3.2 Beta2)](release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md)
- [Adaptation Guide for the Application Sandbox](release-notes/api-change/v3.2-beta2/application-sandbox-adaptation-guide.md)
- OpenHarmony 3.2 Beta1
- JS API Differences
@@ -143,10 +144,11 @@
- [User IAM subsystem](release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md)
- [Window manager subsystem](release-notes/api-change/v3.1-Release/js-apidiff-window.md)
- [Native API Differences](release-notes/api-change/v3.1-Release/native-apidiff-v3.1-release.md)
+ - [Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)](release-notes/api-change/v3.1-Release/changelog-v3.1-release.md)
- OpenHarmony 3.1 Beta
- [JS API Differences](release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md)
- [Native API Differences](release-notes/api-change/v3.1-beta/native-apidiff-v3.1-beta.md)
- - [Updates Between OpenHarmony 3.1 Beta and OpenHarmony 3.0](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md)
+ - [Updates (OpenHarmony 3.0 -> OpenHarmony 3.1 Beta)](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md)
- OpenHarmony 3.0 LTS
- [JS API Differences](release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md)
- OpenHarmony v2.2 Beta2
diff --git a/zh-cn/application-dev/database/database-relational-guidelines.md b/zh-cn/application-dev/database/database-relational-guidelines.md
index 3a89466da4747b55dae10e73bc1d17c1b2730ce4..5414bdccc785edac63a96ae75a2b0b2676bdc0c3 100644
--- a/zh-cn/application-dev/database/database-relational-guidelines.md
+++ b/zh-cn/application-dev/database/database-relational-guidelines.md
@@ -114,7 +114,10 @@
### 设置分布式列表
->**注意:** 在使用RdbStore的setDistributedTables、obtainDistributedTableName、sync、on、off接口时,需要请求相应的权限:ohos.permission.DISTRIBUTED_DATASYNC。
+> **说明:**
+>
+> - 在使用RdbStore的setDistributedTables、obtainDistributedTableName、sync、on、off接口时,需要请求相应的权限:ohos.permission.DISTRIBUTED_DATASYNC。
+> - 使用分布式列表前,需要先建立设备间组网,具体接口及使用可见[设备管理](../reference/apis/js-apis-device-manager.md)。
**设置分布式列表**
diff --git a/zh-cn/application-dev/key-features/multi-device-app-dev/start-with-a-example.md b/zh-cn/application-dev/key-features/multi-device-app-dev/start-with-a-example.md
index d7416c1fb2ed844a5887f2efa642a65cbc549639..ec3fd3dbca88638bddc82cddfdacf92fa2348f78 100644
--- a/zh-cn/application-dev/key-features/multi-device-app-dev/start-with-a-example.md
+++ b/zh-cn/application-dev/key-features/multi-device-app-dev/start-with-a-example.md
@@ -50,7 +50,7 @@
如此,既在各设备上体现了UX的一致性,也在各设备上体现了UX的差异性,从而既可以保障各设备上应用界面的体验,也可以最大程度复用界面代码。
-在本文[应用UX设计章节](ux-design.md)中,将详细介绍应用的UX设计规则。
+在本文[应用UX设计章节](design-principles.md)中,将详细介绍应用的UX设计规则。
## 工程管理及调试
@@ -271,3 +271,5 @@ struct Home {
- 在使用特定系统能力前,通过canIUse接口判断系统能力是否存在,进而执行不同的逻辑。
在本文的[功能开发的一多能力介绍](development-intro.md)章节中,将详细展开介绍。
+
+
\ No newline at end of file
diff --git a/zh-cn/application-dev/media/Readme-CN.md b/zh-cn/application-dev/media/Readme-CN.md
index e1115fafee7fa9f5fb6fdfabb59b64bc17b10a36..dbbe0823c4f646dd8db29fee4c85f320e9a50cd1 100755
--- a/zh-cn/application-dev/media/Readme-CN.md
+++ b/zh-cn/application-dev/media/Readme-CN.md
@@ -10,6 +10,8 @@
- [OpenSL ES播放开发指导](opensles-playback.md)
- [OpenSL ES录音开发指导](opensles-capture.md)
- [音频焦点模式开发指导](audio-interruptmode.md)
+ - [音量管理开发指导](audio-volume-manager.md)
+ - [路由、设备管理开发指导](audio-routing-manager.md)
- 视频
- [视频播放开发指导](video-playback.md)
diff --git a/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePath.md b/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePath.md
index 89e43e02cbb2de776cca4c6fa1f43cce120eac67..e2a83d75a2b15810ca6afc19cf1f3ec8ec60601b 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePath.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePath.md
@@ -44,6 +44,5 @@ constructor(durationTime: number);
**示例:**
```ts
-let durationTime = 20;
-let gesturePath = new GesturePath(durationTime);
+let gesturePath = new GesturePath.GesturePath(20);
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md b/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md
index d787f38222017e3e524d8d4712f81af7873d5d41..0639e6939b1cf40624385e039195a7f564d0503e 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md
@@ -45,7 +45,5 @@ constructor(positionX: number, positionY: number);
**示例:**
```ts
-let positionX = 1;
-let positionY = 2;
-let gesturePoint = new GesturePoint(positionX, positionY);
+let gesturePoint = new GesturePoint.GesturePoint(1, 2);
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-accessibility-config.md b/zh-cn/application-dev/reference/apis/js-apis-accessibility-config.md
index 4d7842e34181c20e99e296135c343b359a48d1e5..e4c42fbf76f3f226625d33223e8fa11e7c482aa5 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-accessibility-config.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-accessibility-config.md
@@ -65,7 +65,7 @@ enableAbility(name: string, capability: Array<accessibility.Capability>):
```ts
let name = 'com.ohos.example/axExtension';
-let capability = ['retrieve'];
+let capability : accessibility.Capability[] = ['retrieve'];
try {
config.enableAbility(name, capability).then(() => {
console.info('enable ability succeed');
@@ -75,7 +75,7 @@ try {
} catch (exception) {
console.error('failed to enable ability, because ' + JSON.stringify(exception));
};
- ```
+```
## enableAbility
@@ -106,9 +106,9 @@ enableAbility(name: string, capability: Array<accessibility.Capability>, c
```ts
let name = 'com.ohos.example/axExtension';
-let capability = ['retrieve'];
+let capability : accessibility.Capability[] = ['retrieve'];
try {
- config.enableAbility(name, capability, (err, data) => {
+ config.enableAbility(name, capability, (err) => {
if (err) {
console.error('failed to enable ability, because ' + JSON.stringify(err));
return;
@@ -153,7 +153,7 @@ disableAbility(name: string): Promise<void>;
```ts
let name = 'com.ohos.example/axExtension';
try {
- config.enableAbility(name).then(() => {
+ config.disableAbility(name).then(() => {
console.info('disable ability succeed');
}).catch((err) => {
console.error('failed to disable ability, because ' + JSON.stringify(err));
@@ -224,12 +224,9 @@ on(type: 'enabledAccessibilityExtensionListChange', callback: Callback<void&g
try {
config.on('enabledAccessibilityExtensionListChange', () => {
console.info('subscribe enabled accessibility extension list change state success');
- }).catch((err) => {
- console.error('failed to subscribe enabled accessibility extension list change state, because ' +
- JSON.stringify(err));
});
} catch (exception) {
- console.error('failed to subscribe enabled accessibility extension list change state, because ' +
+ console.error('failed to subscribe enabled accessibility extension list change state, because ' +
JSON.stringify(exception));
};
```
@@ -254,13 +251,10 @@ off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback<void
```ts
try {
config.off('enabledAccessibilityExtensionListChange', () => {
- console.info('unSubscribe enabled accessibility extension list change state success');
- }).catch((err) => {
- console.error('failed to unSubscribe enabled accessibility extension list change state, because ' +
- JSON.stringify(err));
+ console.info('Unsubscribe enabled accessibility extension list change state success');
});
} catch (exception) {
- console.error('failed to unSubscribe enabled accessibility extension list change state, because ' +
+ console.error('failed to Unsubscribe enabled accessibility extension list change state, because ' +
JSON.stringify(exception));
};
```
@@ -408,12 +402,8 @@ on(callback: Callback<T>): void;
```ts
try {
- config.highContrastText.on((err, data) => {
- if (err) {
- console.error('failed subscribe highContrastText, because ' + JSON.stringify(err));
- return;
- }
- console.info('subscribe highContrastText success');
+ config.highContrastText.on((data) => {
+ console.info('subscribe highContrastText success, result: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('failed subscribe highContrastText, because ' + JSON.stringify(exception));
@@ -437,12 +427,8 @@ off(callback?: Callback<T>): void;
**示例:**
```ts
-config.highContrastText.off((err, data) => {
- if (err) {
- console.error('failed unSubscribe highContrastText, because ' + JSON.stringify(err));
- return;
- }
- console.info('unSubscribe highContrastText success');
+config.highContrastText.off((data) => {
+ console.info('Unsubscribe highContrastText success, result: ' + JSON.stringify(data));
});
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-accessibility.md b/zh-cn/application-dev/reference/apis/js-apis-accessibility.md
index b36394fe89ced28ce55eb7b16a5e8a74899a1df7..030d38e87283e565e7dbc266f74a39ded410e21f 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-accessibility.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-accessibility.md
@@ -171,16 +171,10 @@ on(type: 'enableChange', callback: Callback<boolean>): void;
**示例:**
```ts
-let result = false;
let captionsManager = accessibility.getCaptionsManager();
try {
- captionsManager.on('enableChange', (err, data) => {
- if (err) {
- console.error('failed to subscribe caption manager enable state change, because ' + JSON.stringify(err));
- return;
- }
- result = data;
- console.info('subscribe caption manager enable state change success');
+ captionsManager.on('enableChange', (data) => {
+ console.info('subscribe caption manager enable state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('failed to subscribe caption manager enable state change, because ' + JSON.stringify(exception));
@@ -206,13 +200,9 @@ on(type: 'styleChange', callback: Callback<CaptionsStyle>): void;
let captionStyle;
let captionsManager = accessibility.getCaptionsManager();
try {
- captionsManager.on('styleChange', (err, data) => {
- if (err) {
- console.error('failed to subscribe caption manager style state change, because ' + JSON.stringify(err));
- return;
- }
+ captionsManager.on('styleChange', (data) => {
captionStyle = data;
- console.info('subscribe caption manager style state change success');
+ console.info('subscribe caption manager style state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('failed to subscribe caption manager style state change, because ' + JSON.stringify(exception));
@@ -235,19 +225,13 @@ off(type: 'enableChange', callback?: Callback<boolean>): void;
**示例:**
```ts
-let result = false;
let captionsManager = accessibility.getCaptionsManager();
try {
- captionsManager.off('enableChange', (err, data) => {
- if (err) {
- console.error('failed to unSubscribe caption manager enable state change, because ' + JSON.stringify(err));
- return;
- }
- result = data;
- console.info('unSubscribe caption manager enable state change success');
+ captionsManager.off('enableChange', (data) => {
+ console.info('Unsubscribe caption manager enable state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
- console.error('failed to unSubscribe caption manager enable state change, because ' + JSON.stringify(exception));
+ console.error('failed to Unsubscribe caption manager enable state change, because ' + JSON.stringify(exception));
}
```
@@ -270,16 +254,12 @@ off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void;
let captionStyle;
let captionsManager = accessibility.getCaptionsManager();
try {
- captionsManager.off('styleChange', (err, data) => {
- if (err) {
- console.error('failed to unSubscribe caption manager style state change, because ' + JSON.stringify(err));
- return;
- }
+ captionsManager.off('styleChange', (data) => {
captionStyle = data;
- console.info('unSubscribe caption manager style state change success');
+ console.info('Unsubscribe caption manager style state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
- console.error('failed to unSubscribe caption manager style state change, because ' + JSON.stringify(exception));
+ console.error('failed to Unsubscribe caption manager style state change, because ' + JSON.stringify(exception));
}
```
@@ -503,9 +483,9 @@ getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState)
**示例:**
```ts
-let abilityType = 'spoken';
-let abilityState = 'enable';
-let extensionList: accessibility.AccessibilityInfo[];
+let abilityType : accessibility.AbilityType = 'spoken';
+let abilityState : accessibility.AbilityState = 'enable';
+let extensionList: accessibility.AccessibilityAbilityInfo[] = [];
try {
accessibility.getAccessibilityExtensionList(abilityType, abilityState).then((data) => {
for (let item of data) {
@@ -526,7 +506,7 @@ try {
## accessibility.getAccessibilityExtensionList9+
-getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState,callback: AsyncCallback<Array<AccessibilityAbilityInfo>>): void
+getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback<Array<AccessibilityAbilityInfo>>): void
查询辅助应用列表,使用callback异步回调。
@@ -543,9 +523,9 @@ getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState,
**示例:**
```ts
-let abilityType = 'spoken';
-let abilityState = 'enable';
-let extensionList: accessibility.AccessibilityInfo[];
+let abilityType : accessibility.AbilityType = 'spoken';
+let abilityState : accessibility.AbilityState = 'enable';
+let extensionList: accessibility.AccessibilityAbilityInfo[] = [];
try {
accessibility.getAccessibilityExtensionList(abilityType, abilityState, (err, data) => {
if (err) {
@@ -560,8 +540,6 @@ try {
extensionList.push(item);
}
console.info('get accessibility extension list success');
- }).catch((err) => {
- console.error('failed to get accessibility extension list because ' + JSON.stringify(err));
});
} catch (exception) {
console.error('failed to get accessibility extension list because ' + JSON.stringify(exception));
@@ -607,12 +585,8 @@ on(type: 'accessibilityStateChange', callback: Callback<boolean>): void
```ts
try {
- accessibility.on('accessibilityStateChange', (err, data) => {
- if (err) {
- console.error('failed to subscribe accessibility state change, because ' + JSON.stringify(err));
- return;
- }
- console.info('subscribe accessibility state change success');
+ accessibility.on('accessibilityStateChange', (data) => {
+ console.info('subscribe accessibility state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('failed to subscribe accessibility state change, because ' + JSON.stringify(exception));
@@ -638,12 +612,8 @@ on(type: 'touchGuideStateChange', callback: Callback<boolean>): void
```ts
try {
- accessibility.on('touchGuideStateChange', (err, data) => {
- if (err) {
- console.error('failed to subscribe touch guide state change, because ' + JSON.stringify(err));
- return;
- }
- console.info('subscribe touch guide state change success');
+ accessibility.on('touchGuideStateChange', (data) => {
+ console.info('subscribe touch guide state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('failed to subscribe touch guide state change, because ' + JSON.stringify(exception));
@@ -669,15 +639,11 @@ off(type: 'accessibilityStateChange', callback?: Callback<boolean>): void
```ts
try {
- accessibility.on('accessibilityStateChange', (err, data) => {
- if (err) {
- console.error('failed to unSubscribe accessibility state change, because ' + JSON.stringify(err));
- return;
- }
- console.info('unSubscribe accessibility state change success');
+ accessibility.off('accessibilityStateChange', (data) => {
+ console.info('Unsubscribe accessibility state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
- console.error('failed to unSubscribe accessibility state change, because ' + JSON.stringify(exception));
+ console.error('failed to Unsubscribe accessibility state change, because ' + JSON.stringify(exception));
}
```
@@ -700,15 +666,11 @@ off(type: 'touchGuideStateChange', callback?: Callback<boolean>): void
```ts
try {
- accessibility.on('touchGuideStateChange', (err, data) => {
- if (err) {
- console.error('failed to unSubscribe touch guide state change, because ' + JSON.stringify(err));
- return;
- }
- console.info('unSubscribe touch guide state change success');
+ accessibility.off('touchGuideStateChange', (data) => {
+ console.info('Unsubscribe touch guide state change, result: ' + JSON.stringify(data));
});
} catch (exception) {
- console.error('failed to unSubscribe touch guide state change, because ' + JSON.stringify(exception));
+ console.error('failed to Unsubscribe touch guide state change, because ' + JSON.stringify(exception));
}
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md b/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
index 79c474b00aa1c9e77c25a6ea710df58815c0069a..bc6162d6d793754139104299d0f5f3623dea6972 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
@@ -632,7 +632,7 @@ import distributedObject from '@ohos.data.distributedDataObject';
import featureAbility from '@ohos.ability.featureAbility';
// 获取context
let context = featureAbility.getContext();
-let g_object = distributedObject.create({name:"Amy", age:18, isVis:false});
+let g_object = distributedObject.create(context,{name:"Amy", age:18, isVis:false});
g_object.setSessionId("123456");
g_object.save("local").then((result) => {
console.log("save callback");
@@ -654,7 +654,7 @@ class MainAbility extends Ability{
context = this.context
}
}
-let g_object = distributedObject.create({name:"Amy", age:18, isVis:false});
+let g_object = distributedObject.create(context,{name:"Amy", age:18, isVis:false});
g_object.setSessionId("123456");
g_object.save("local").then((result) => {
console.log("save callback");
diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md b/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md
index 49111b648c5c66fa8846e16561160dfe97fee3a6..a19a37efd9f244207dbdc75fa7abd60d684a450d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md
@@ -475,7 +475,7 @@ get(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>):
```js
try {
- data_preferences.get('startup', 'default', function (err, val) {
+ preferences.get('startup', 'default', function (err, val) {
if (err) {
console.info("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message);
return;
diff --git a/zh-cn/application-dev/reference/apis/js-apis-fileio.md b/zh-cn/application-dev/reference/apis/js-apis-fileio.md
index 9ba948beaccf86693e6d13fe257ab5554212659b..7a3d08fbd358af5a3d91672125854554fc5db1a8 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-fileio.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-fileio.md
@@ -1525,7 +1525,7 @@ lstat(path: string): Promise<Stat>
```js
let filePath = pathDir + "/test.txt";
fileio.lstat(filePath).then(function(stat){
- console.info("get link status succeed, " + the size of file is + stat.size);
+ console.info("get link status succeed, the size of file is" + stat.size);
}).catch(function(err){
console.info("get link status failed with error:"+ err);
});
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
index aa285044a0905a546983a48e157baf82b2ea4858..3a82fbdbae70fc44f158e06df7eaa463d351dbd0 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
@@ -56,7 +56,7 @@ getController(): InputMethodController
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | ------------------------------ |
@@ -84,7 +84,7 @@ getSetting(): InputMethodSetting
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -115,7 +115,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolea
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -164,7 +164,7 @@ switchInputMethod(target: InputMethodProperty): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -228,7 +228,7 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallb
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -290,7 +290,7 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean&
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -366,7 +366,7 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -434,7 +434,7 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -537,7 +537,7 @@ stopInputSession(callback: AsyncCallback<boolean>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -580,7 +580,7 @@ stopInputSession(): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -623,7 +623,7 @@ showSoftKeyboard(callback: AsyncCallback<void>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -660,7 +660,7 @@ showSoftKeyboard(): Promise<void>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -695,7 +695,7 @@ hideSoftKeyboard(callback: AsyncCallback<void>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -732,7 +732,7 @@ hideSoftKeyboard(): Promise<void>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -883,7 +883,7 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: Async
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -933,7 +933,7 @@ listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise<Arr
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -975,7 +975,7 @@ listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSub
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -1014,7 +1014,7 @@ listCurrentInputMethodSubtype(): Promise<Array<InputMethodSubtype>>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -1052,7 +1052,7 @@ getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethod
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -1091,7 +1091,7 @@ getInputMethods(enable: boolean): Promise<Array<InputMethodProperty>>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -1136,7 +1136,7 @@ showOptionalInputMethods(callback: AsyncCallback<boolean>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
@@ -1176,7 +1176,7 @@ showOptionalInputMethods(): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------------------- |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
index d441dc68018c365df774f93d1bb3c582b5dab978..21a731926282a8f66412a5e7fec8de00c91bfb60 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
@@ -712,7 +712,7 @@ hide(callback: AsyncCallback<void>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -746,7 +746,7 @@ hide(): Promise<void>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -841,7 +841,7 @@ sendKeyFunction(action:number, callback: AsyncCallback<boolean>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -889,7 +889,7 @@ sendKeyFunction(action:number): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -930,7 +930,7 @@ getForward(length:number, callback: AsyncCallback<string>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | ------------------------------ |
@@ -976,7 +976,7 @@ getForward(length:number): Promise<string>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | ------------------------------ |
@@ -1015,7 +1015,7 @@ getBackward(length:number, callback: AsyncCallback<string>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | ------------------------------ |
@@ -1061,7 +1061,7 @@ getBackward(length:number): Promise<string>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | ------------------------------ |
@@ -1100,7 +1100,7 @@ deleteForward(length:number, callback: AsyncCallback<boolean>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1150,7 +1150,7 @@ deleteForward(length:number): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1193,7 +1193,7 @@ deleteBackward(length:number, callback: AsyncCallback<boolean>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1243,7 +1243,7 @@ deleteBackward(length:number): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1282,7 +1282,7 @@ insertText(text:string, callback: AsyncCallback<boolean>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1327,7 +1327,7 @@ insertText(text:string): Promise<boolean>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1368,7 +1368,7 @@ getEditorAttribute(callback: AsyncCallback<EditorAttribute>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1403,7 +1403,7 @@ getEditorAttribute(): Promise<EditorAttribute>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1437,7 +1437,7 @@ moveCursor(direction: number, callback: AsyncCallback<void>): void
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
@@ -1481,7 +1481,7 @@ moveCursor(direction: number): Promise<void>
**错误码:**
-以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errcode-inputmethod-framework.md)。
+以下错误码的详细介绍请参见[输入法框架错误码](../errorcodes/errorcode-inputmethod-framework.md)。
| 错误码ID | 错误码信息 |
| -------- | -------------------------- |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-update.md b/zh-cn/application-dev/reference/apis/js-apis-update.md
index f6b29aa4c3a4b51193c7fcc15abcef1829e44d1f..1053f4629197be91c60382da5239cc8eeb6c08b5 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-update.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-update.md
@@ -102,7 +102,7 @@ try {
let localUpdater = update.getLocalUpdater();
} catch(error) {
console.error(`Fail to get localUpdater error: ${error}`);
-}
+};
```
## Updater
@@ -844,7 +844,7 @@ const versionDigestInfo = {
};
// 清除选项
-lconstet clearOptions = {
+const clearOptions = {
status: update.UpgradeStatus.UPGRADE_FAIL,
};
updater.clearError(versionDigestInfo, clearOptions).then(() => {
@@ -1248,7 +1248,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>): Promise\
-
+
```
```css
/* xxx.css */
.content {
- width: 60%;
+ width: 100%;
flex-direction: column;
align-items: center;
}
.input {
+ width: 60%;
placeholder-color: gray;
}
.button {
+ width: 60%;
background-color: gray;
margin-top: 20px;
- }
+ }
```
-
+
```js
// xxx.js
import prompt from '@system.prompt'
@@ -142,9 +144,10 @@
error: 'error text'
});
},
- }
+ }
```
+
![zh-cn_image_0000001252835901](figures/zh-cn_image_0000001252835901.png)
2. type为button
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-basic-label.md b/zh-cn/application-dev/reference/arkui-js/js-components-basic-label.md
index ae7bebf6bbbbe32d419bd75df5587279c3a29553..d134e5bf1090eeddf3c664eee8f8d584eb9050ea 100644
--- a/zh-cn/application-dev/reference/arkui-js/js-components-basic-label.md
+++ b/zh-cn/application-dev/reference/arkui-js/js-components-basic-label.md
@@ -82,7 +82,7 @@
/*xxx.css */
.container {
flex-direction: column;
- align-items: center;
+ margin-left: 20px;
}
.row {
flex-direction: row;
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-basic-qrcode.md b/zh-cn/application-dev/reference/arkui-js/js-components-basic-qrcode.md
index 5b156b7bffefe8b1e34d718c789e38d4dc1c4249..eb7e960a47abd94b5d13ad9f12f15f4440210a89 100644
--- a/zh-cn/application-dev/reference/arkui-js/js-components-basic-qrcode.md
+++ b/zh-cn/application-dev/reference/arkui-js/js-components-basic-qrcode.md
@@ -58,8 +58,6 @@