diff --git a/en/application-dev/reference/apis/js-apis-batteryStatistics.md b/en/application-dev/reference/apis/js-apis-batteryStatistics.md
index 721a432caaf67116a6df882c0e8995e76b893a7e..8314dd92cfc15cdbc9ad8e1e232b3fab2b00380b 100644
--- a/en/application-dev/reference/apis/js-apis-batteryStatistics.md
+++ b/en/application-dev/reference/apis/js-apis-batteryStatistics.md
@@ -36,7 +36,7 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
| Code | Error Message |
|---------|---------|
-| 4600101 | Operation failed. Cannot connect to service.|
+| 4600101 | If connecting to the service failed. |
**Example**
@@ -72,7 +72,7 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
| Code | Error Message |
|---------|---------|
-| 4600101 | Operation failed. Cannot connect to service.|
+| 4600101 | If connecting to the service failed. |
**Example**
@@ -114,7 +114,7 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
| Code | Error Message |
|---------|---------|
-| 4600101 | Operation failed. Cannot connect to service.|
+| 4600101 | If connecting to the service failed. |
**Example**
@@ -155,7 +155,7 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
| Code | Error Message |
|---------|---------|
-| 4600101 | Operation failed. Cannot connect to service.|
+| 4600101 | If connecting to the service failed. |
**Example**
@@ -196,13 +196,13 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
| Code | Error Message |
|---------|---------|
-| 4600101 | Operation failed. Cannot connect to service.|
+| 4600101 | If connecting to the service failed. |
**Example**
```js
try {
- var value = batteryStats.getHardwareUnitPowerValue(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
+ var value = batteryStats.getHardwareUnitPowerValue(batteryStats.ConsumptionType.CONSUMPTION_TYPE_SCREEN);
console.info('battery statistics value of hardware is: ' + value);
} catch(err) {
console.error('get battery statistics percent of hardware failed, err: ' + err);
@@ -237,13 +237,13 @@ For details about the error codes, see [Thermal Manager Error Codes](../errorcod
| Code | Error Message |
|---------|---------|
-| 4600101 | Operation failed. Cannot connect to service.|
+| 4600101 | If connecting to the service failed. |
**Example**
```js
try {
- var percent = batteryStats.getHardwareUnitPowerPercent(ConsumptionType.CONSUMPTION_TYPE_SCREEN);
+ var percent = batteryStats.getHardwareUnitPowerPercent(batteryStats.ConsumptionType.CONSUMPTION_TYPE_SCREEN);
console.info('battery statistics percent of hardware is: ' + percent);
} catch(err) {
console.error('get battery statistics percent of hardware failed, err: ' + err);
diff --git a/en/application-dev/reference/apis/js-apis-brightness.md b/en/application-dev/reference/apis/js-apis-brightness.md
index bd003733a485c1601ac251697461e78b863976a8..e6af63700029738f388f41edb5d980b51a9f9614 100644
--- a/en/application-dev/reference/apis/js-apis-brightness.md
+++ b/en/application-dev/reference/apis/js-apis-brightness.md
@@ -22,7 +22,7 @@ Sets the screen brightness.
**System API**: This is a system API.
-**System capability**: SystemCapability.PowerManager.DisplayPowerManager
+**System capability:** SystemCapability.PowerManager.DisplayPowerManager
**Parameters**
@@ -34,9 +34,9 @@ Sets the screen brightness.
For details about the error codes, see [Screen Brightness Error Codes](../errorcodes/errorcode-brightness.md).
-| Code | Error Message |
+| ID | Error Message |
|---------|---------|
-| 4700101 | Operation failed. Cannot connect to service.|
+| 4700101 | If connecting to the service failed. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md
index 068a12cd46efce13b68a4fcf697306c4b5d8f256..6e037296389e26851c4374fea6db0a282129dafd 100644
--- a/en/application-dev/reference/apis/js-apis-call.md
+++ b/en/application-dev/reference/apis/js-apis-call.md
@@ -16,7 +16,7 @@ import call from '@ohos.telephony.call';
## call.dialCall9+
-dialCall\(phoneNumber: string, callback: AsyncCallback\): void
+dialCall\(phoneNumber: string, callback: AsyncCallback\\): void
Initiates a call. This API uses an asynchronous callback to return the result.
@@ -40,6 +40,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -57,7 +58,7 @@ call.dialCall("138xxxxxxxx", (err) => {
## call.dialCall9+
-dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback\): void
+dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback\\): void
Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.
@@ -82,6 +83,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -104,7 +106,7 @@ call.dialCall("138xxxxxxxx", {
## call.dialCall9+
-dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise
+dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise\
Initiates a call. You can set call options as needed. This API uses a promise to return the result.
@@ -119,7 +121,7 @@ Initiates a call. You can set call options as needed. This API uses a promise to
| Name | Type | Mandatory| Description |
| ----------- | ----------------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
-| options | [DialCallOptions](#dialcalloptions9)| No | Call options, which carry other configuration information of the call.|
+| options | [DialCallOptions](#dialcalloptions9)| No | Call options, which carry other configuration information of the call.
If this parameter is not set, the following configuration is used by default. For details, see [DialCallOptions](#dialcalloptions9).
- **accountId**: 0 (card slot 1)
- **videoState**: voice call
- **dialScene**: common call
- **dialType**: carrier call |
**Return value**
@@ -134,6 +136,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -158,7 +161,7 @@ promise.then(() => {
## call.dial(deprecated)
-dial\(phoneNumber: string, callback: AsyncCallback\): void
+dial\(phoneNumber: string, callback: AsyncCallback\\): void
Initiates a call. This API uses an asynchronous callback to return the result.
@@ -188,7 +191,7 @@ call.dial("138xxxxxxxx", (err, data) => {
## call.dial(deprecated)
-dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback\): void
+dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback\\): void
Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.
@@ -220,7 +223,7 @@ call.dial("138xxxxxxxx", {
## call.dial(deprecated)
-dial\(phoneNumber: string, options?: DialOptions\): Promise
+dial\(phoneNumber: string, options?: DialOptions\): Promise\
Initiates a call. You can set call options as needed. This API uses a promise to return the result.
@@ -260,7 +263,7 @@ promise.then(data => {
## call.makeCall7+
-makeCall(phoneNumber: string, callback: AsyncCallback\): void
+makeCall\(phoneNumber: string, callback: AsyncCallback\\): void
Launches the call screen and displays the dialed number. This API uses an asynchronous callback to return the result.
@@ -296,7 +299,7 @@ call.makeCall("138xxxxxxxx", err => {
## call.makeCall7+
-makeCall(phoneNumber: string): Promise\
+makeCall\(phoneNumber: string\): Promise\
Launches the call screen and displays the dialed number. This API uses a promise to return the result.
@@ -339,7 +342,7 @@ promise.then(() => {
## call.hasCall
-hasCall\(callback: AsyncCallback\): void
+hasCall\(callback: AsyncCallback\\): void
Checks whether a call is in progress. This API uses an asynchronous callback to return the result.
@@ -362,7 +365,7 @@ call.hasCall((err, data) => {
## call.hasCall
-hasCall\(\): Promise
+hasCall\(\): Promise\
Checks whether a call is in progress. This API uses a promise to return the result.
@@ -388,7 +391,7 @@ promise.then(data => {
## call.getCallState
-getCallState\(callback: AsyncCallback\): void
+getCallState\(callback: AsyncCallback\\): void
Obtains the call status. This API uses an asynchronous callback to return the result.
@@ -411,7 +414,7 @@ call.getCallState((err, data) => {
## call.getCallState
-getCallState\(\): Promise
+getCallState\(\): Promise\
Obtains the call status. This API uses a promise to return the result.
@@ -436,7 +439,7 @@ promise.then(data => {
## call.hasVoiceCapability7+
-hasVoiceCapability(): boolean
+hasVoiceCapability\(\): boolean
Checks whether a device supports voice calls.
@@ -455,7 +458,7 @@ console.log(`hasVoiceCapability: ${JSON.stringify(result)}`);
## call.isEmergencyPhoneNumber7+
-isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback\): void
+isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback\\): void
Checks whether the called number is an emergency number. This API uses an asynchronous callback to return the result.
@@ -491,7 +494,7 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
## call.isEmergencyPhoneNumber7+
-isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback\): void
+isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback\\): void
Checks whether the called number is an emergency number based on the phone number. This API uses an asynchronous callback to return the result.
@@ -528,7 +531,7 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => {
## call.isEmergencyPhoneNumber7+
-isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise
+isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise\
Checks whether the called number is an emergency number based on the phone number. This API uses a promise to return the result.
@@ -572,7 +575,7 @@ promise.then(data => {
## call.formatPhoneNumber7+
-formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback\): void
+formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback\\): void
Formats a phone number. This API uses an asynchronous callback to return the result.
@@ -609,7 +612,7 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
## call.formatPhoneNumber7+
-formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\): void
+formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\\): void
Formats a phone number based on specified formatting options. This API uses an asynchronous callback to return the result.
@@ -650,7 +653,7 @@ call.formatPhoneNumber("138xxxxxxxx", {
## call.formatPhoneNumber7+
-formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise
+formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise\
Formats a phone number based on specified formatting options. This API uses a promise to return the result.
@@ -698,7 +701,7 @@ promise.then(data => {
## call.formatPhoneNumberToE1647+
-formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback\): void
+formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback\\): void
Converts a phone number into the E.164 format. This API uses an asynchronous callback to return the result.
@@ -737,7 +740,7 @@ call.formatPhoneNumberToE164("138xxxxxxxx", "CN", (err, data) => {
## call.formatPhoneNumberToE1647+
-formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise
+formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise\
Converts a phone number into the E.164 format. This API uses a promise to return the result.
@@ -785,7 +788,7 @@ promise.then(data => {
## call.muteRinger8+
-muteRinger\(callback: AsyncCallback\): void
+muteRinger\(callback: AsyncCallback\\): void
Mutes the ringtone while it is playing. It does not work if the ringtone has been muted. This API uses an asynchronous callback to return the result.
@@ -808,6 +811,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -825,7 +829,7 @@ call.muteRinger((err) => {
## call.muteRinger8+
-muteRinger\(\): Promise
+muteRinger\(\): Promise\
Mutes the ringtone while it is playing. It does not work if the ringtone has been muted. This API uses a promise to return the result.
@@ -848,6 +852,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
@@ -865,7 +870,7 @@ call.muteRinger().then(() => {
## call.answerCall9+
-answerCall\(callId: number, callback: AsyncCallback\): void
+answerCall\(callId: number, callback: AsyncCallback\\): void
Answers a call. This API uses an asynchronous callback to return the result.
@@ -889,6 +894,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -906,7 +912,7 @@ call.answerCall(1, (err) => {
## call.answerCall9+
-answerCall(callId?: number\): Promise
+answerCall(callId?: number\): Promise\
Answers a call. This API uses a promise to return the result.
@@ -920,7 +926,7 @@ Answers a call. This API uses a promise to return the result.
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
-| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.|
+| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.
If this parameter is not set, the latest ringing call will be connected.|
**Return value**
@@ -935,6 +941,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -954,7 +961,7 @@ call.answerCall(1).then(() => {
## call.answerCall9+
-answerCall\(callback: AsyncCallback\): void
+answerCall\(callback: AsyncCallback\\): void
Answers a call. This API uses an asynchronous callback to return the result.
@@ -977,6 +984,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -994,7 +1002,7 @@ call.answerCall((err) => {
## call.hangUpCall9+
-hangUpCall\(callId: number, callback: AsyncCallback\): void
+hangUpCall\(callId: number, callback: AsyncCallback\\): void
Ends a call. This API uses an asynchronous callback to return the result.
@@ -1018,6 +1026,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1035,7 +1044,7 @@ call.hangUpCall(1, (err) => {
## call.hangUpCall9+
-hangUpCall\(callId?: number\): Promise
+hangUpCall\(callId?: number\): Promise\
Ends a call. This API uses a promise to return the result.
@@ -1049,7 +1058,7 @@ Ends a call. This API uses a promise to return the result.
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
-| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.|
+| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.
If this parameter is not set, the latest ongoing, dialed, or connected call will be ended.|
**Return value**
@@ -1064,6 +1073,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1083,7 +1093,7 @@ call.hangUpCall(1).then(() => {
## call.hangUpCall9+
-hangUpCall\(callback: AsyncCallback\): void
+hangUpCall\(callback: AsyncCallback\\): void
Ends a call. This API uses an asynchronous callback to return the result.
@@ -1106,6 +1116,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1124,7 +1135,7 @@ call.hangUpCall((err) => {
## call.rejectCall9+
-rejectCall(callId: number, callback: AsyncCallback\): void
+rejectCall\(callId: number, callback: AsyncCallback\\): void
Rejects a call. This API uses an asynchronous callback to return the result.
@@ -1148,6 +1159,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1166,7 +1178,7 @@ call.rejectCall(1, (err) => {
## call.rejectCall9+
-rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback\): void
+rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback\\): void
Rejects a call. This API uses an asynchronous callback to return the result.
@@ -1191,6 +1203,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1211,7 +1224,7 @@ call.rejectCall(1, rejectMessageOptions, (err) => {
## call.rejectCall9+
-rejectCall(callId?: number, options?: RejectMessageOptions\): Promise
+rejectCall\(callId?: number, options?: RejectMessageOptions\): Promise\
Rejects a call. This API uses a promise to return the result.
@@ -1225,8 +1238,8 @@ Rejects a call. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| ------- | ---------------------------------------------- | ---- | ------------------------------------------------------------ |
-| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.|
-| options | [RejectMessageOptions](#rejectmessageoptions7) | No | Options for the call rejection message. |
+| callId | number | No | Call ID. You can obtain the value by subscribing to **callDetailsChange** events. This parameter is optional from API version 9.
If this parameter is not set, the latest ringing call will be rejected.|
+| options | [RejectMessageOptions](#rejectmessageoptions7) | No | Options for the call rejection message. If this parameter is not set, no call rejection message will be sent.|
**Return value**
@@ -1241,6 +1254,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1263,7 +1277,7 @@ call.reject(1, rejectMessageOptions).then(() => {
## call.rejectCall9+
-rejectCall\(callback: AsyncCallback\): void
+rejectCall\(callback: AsyncCallback\\): void
Rejects a call. This API uses an asynchronous callback to return the result.
@@ -1286,6 +1300,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1303,7 +1318,7 @@ call.rejectCall((err) => {
## call.rejectCall9+
-rejectCall\(options: RejectMessageOptions, callback: AsyncCallback\): void
+rejectCall\(options: RejectMessageOptions, callback: AsyncCallback\\): void
Rejects a call. This API uses an asynchronous callback to return the result.
@@ -1327,6 +1342,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1347,7 +1363,7 @@ call.rejectCall(rejectMessageOptions, (err) => {
## call.holdCall7+
-holdCall\(callId: number, callback: AsyncCallback\): void
+holdCall\(callId: number, callback: AsyncCallback\\): void
Holds a call based on the specified call ID. This API uses an asynchronous callback to return the result.
@@ -1371,6 +1387,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1388,7 +1405,7 @@ call.holdCall(1, (err) => {
## call.holdCall7+
-holdCall\(callId: number\): Promise
+holdCall\(callId: number\): Promise\
Holds a call based on the specified call ID. This API uses a promise to return the result.
@@ -1417,6 +1434,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1435,7 +1453,7 @@ call.holdCall(1).then(() => {
## call.unHoldCall7+
-unHoldCall\(callId: number, callback: AsyncCallback\): void
+unHoldCall\(callId: number, callback: AsyncCallback\\): void
Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result.
@@ -1459,6 +1477,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1476,7 +1495,7 @@ call.unHoldCall(1, (err) => {
## call.unHoldCall7+
-unHoldCall\(callId: number\): Promise
+unHoldCall\(callId: number\): Promise\
Unholds a call based on the specified call ID. This API uses a promise to return the result.
@@ -1505,6 +1524,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1523,7 +1543,7 @@ call.unHoldCall(1).then(() => {
## call.switchCall7+
-switchCall\(callId: number, callback: AsyncCallback\): void
+switchCall\(callId: number, callback: AsyncCallback\\): void
Switches a call. This API uses an asynchronous callback to return the result.
@@ -1547,6 +1567,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1564,7 +1585,7 @@ call.switchCall(1, (err) => {
## call.switchCall7+
-switchCall\(callId: number\): Promise
+switchCall\(callId: number\): Promise\
Switches a call. This API uses a promise to return the result.
@@ -1593,6 +1614,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -1611,7 +1633,7 @@ call.switchCall(1).then(() => {
## call.combineConference7+
-combineConference\(callId: number, callback: AsyncCallback\): void
+combineConference\(callId: number, callback: AsyncCallback\\): void
Combines two calls into a conference call. This API uses an asynchronous callback to return the result.
@@ -1632,11 +1654,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1649,7 +1671,7 @@ call.combineConference(1, (err) => {
## call.combineConference7+
-combineConference\(callId: number\): Promise
+combineConference\(callId: number\): Promise\
Combines two calls into a conference call. This API uses a promise to return the result.
@@ -1675,11 +1697,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1693,7 +1715,7 @@ call.combineConference(1).then(() => {
## call.getMainCallId7+
-getMainCallId\(callId: number, callback: AsyncCallback\): void
+getMainCallId\(callId: number, callback: AsyncCallback\\): void
Obtains the main call ID. This API uses an asynchronous callback to return the result.
@@ -1714,11 +1736,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1732,7 +1754,7 @@ call.getMainCallId(1, (err, data) => {
## call.getMainCallId7+
-getMainCallId\(callId: number\): Promise
+getMainCallId\(callId: number\): Promise\
Obtains the main call ID. This API uses a promise to return the result.
@@ -1758,11 +1780,12 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
+
**Example**
@@ -1777,7 +1800,7 @@ promise.then(data => {
## call.getSubCallIdList7+
-getSubCallIdList\(callId: number, callback: AsyncCallback\>\): void
+getSubCallIdList\(callId: number, callback: AsyncCallback\\>\): void
Obtains the list of subcall IDs. This API uses an asynchronous callback to return the result.
@@ -1798,11 +1821,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1815,7 +1838,7 @@ call.getSubCallIdList(1, (err, data) => {
## call.getSubCallIdList7+
-getSubCallIdList\(callId: number\): Promise\>
+getSubCallIdList\(callId: number\): Promise\\>
Obtains the list of subcall IDs. This API uses a promise to return the result.
@@ -1841,11 +1864,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1860,7 +1883,7 @@ promise.then(data => {
## call.getCallIdListForConference7+
-getCallIdListForConference\(callId: number, callback: AsyncCallback>\): void
+getCallIdListForConference\(callId: number, callback: AsyncCallback\\>\): void
Obtains the list of call IDs in a conference. This API uses an asynchronous callback to return the result.
@@ -1881,11 +1904,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1898,7 +1921,7 @@ call.getCallIdListForConference(1, (err, data) => {
## call.getCallIdListForConference7+
-getCallIdListForConference\(callId: number\): Promise\>
+getCallIdListForConference\(callId: number\): Promise\\>
Obtains the list of call IDs in a conference. This API uses a promise to return the result.
@@ -1924,11 +1947,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1943,7 +1966,7 @@ promise.then(data => {
## call.getCallWaitingStatus7+
-getCallWaitingStatus\(slotId: number, callback: AsyncCallback\): void
+getCallWaitingStatus\(slotId: number, callback: AsyncCallback\\): void
Obtains the call waiting status. This API uses an asynchronous callback to return the result.
@@ -1967,11 +1990,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -1984,7 +2007,7 @@ call.getCallWaitingStatus(0, (err, data) => {
## call.getCallWaitingStatus7+
-getCallWaitingStatus\(slotId: number\): Promise
+getCallWaitingStatus\(slotId: number\): Promise\
Obtains the call waiting status. This API uses a promise to return the result.
@@ -2013,11 +2036,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2032,7 +2055,7 @@ promise.then(data => {
## call.setCallWaiting7+
-setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback\): void
+setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback\\): void
Sets the call waiting switch. This API uses an asynchronous callback to return the result.
@@ -2057,11 +2080,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2074,7 +2097,7 @@ call.setCallWaiting(0, true, (err) => {
## call.setCallWaiting7+
-setCallWaiting\(slotId: number, activate: boolean\): Promise
+setCallWaiting\(slotId: number, activate: boolean\): Promise\
Sets the call waiting switch. This API uses a promise to return the result.
@@ -2104,11 +2127,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2122,7 +2145,7 @@ call.setCallWaiting(0, true).then(() => {
## call.startDTMF7+
-startDTMF\(callId: number, character: string, callback: AsyncCallback\): void
+startDTMF\(callId: number, character: string, callback: AsyncCallback\\): void
Enables DTMF. This API uses an asynchronous callback to return the result.
@@ -2144,11 +2167,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2161,7 +2184,7 @@ call.startDTMF(1, "0", (err) => {
## call.startDTMF7+
-startDTMF\(callId: number, character: string\): Promise
+startDTMF\(callId: number, character: string\): Promise\
Enables DTMF. This API uses a promise to return the result.
@@ -2188,11 +2211,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2206,7 +2229,7 @@ call.startDTMF(1, "0").then(() => {
## call.stopDTMF7+
-stopDTMF\(callId: number, callback: AsyncCallback\): void
+stopDTMF\(callId: number, callback: AsyncCallback\\): void
Stops DTMF. This API uses an asynchronous callback to return the result.
@@ -2227,11 +2250,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2244,7 +2267,7 @@ call.stopDTMF(1, (err) => {
## call.stopDTMF7+
-stopDTMF\(callId: number\): Promise
+stopDTMF\(callId: number\): Promise\
Stops DTMF. This API uses a promise to return the result.
@@ -2270,11 +2293,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2288,7 +2311,7 @@ call.stopDTMF(1).then(() => {
## call.isInEmergencyCall7+
-isInEmergencyCall\(callback: AsyncCallback\): void
+isInEmergencyCall\(callback: AsyncCallback\\): void
Checks whether a call is an emergency call. This API uses an asynchronous callback to return the result.
@@ -2311,6 +2334,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2328,7 +2352,7 @@ call.isInEmergencyCall((err, data) => {
## call.isInEmergencyCall7+
-isInEmergencyCall\(\): Promise
+isInEmergencyCall\(\): Promise\
Checks whether a call is an emergency call. This API uses a promise to return the result.
@@ -2351,8 +2375,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
-| 401 | Parameter error. |
-| 8300001 | Invalid parameter value. |
+| 202 | Non-system applications use system APIs. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
@@ -2370,7 +2393,7 @@ promise.then(data => {
## call.on('callDetailsChange')7+
-on\(type: 'callDetailsChange', callback: Callback\): void
+on\(type: 'callDetailsChange', callback: Callback\\): void
Subscribes to **callDetailsChange** events. This API uses an asynchronous callback to return the result.
@@ -2394,6 +2417,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2410,7 +2434,7 @@ call.on('callDetailsChange', data => {
## call.on('callEventChange')8+
-on\(type: 'callEventChange', callback: Callback\): void
+on\(type: 'callEventChange', callback: Callback\\): void
Subscribes to **callEventChange** events. This API uses an asynchronous callback to return the result.
@@ -2434,6 +2458,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2450,7 +2475,7 @@ call.on('callEventChange', data => {
## call.on('callDisconnectedCause')8+
-on\(type: 'callDisconnectedCause', callback: Callback): void
+on\(type: 'callDisconnectedCause', callback: Callback\\): void
Subscribes to **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.
@@ -2474,6 +2499,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2490,7 +2516,7 @@ call.on('callDisconnectedCause', data => {
## call.on('mmiCodeResult')9+
-on\(type: 'mmiCodeResult', callback: Callback\): void
+on\(type: 'mmiCodeResult', callback: Callback\\): void
Subscribes to **mmiCodeResult** events. This API uses an asynchronous callback to return the result.
@@ -2514,6 +2540,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2530,7 +2557,7 @@ call.on('mmiCodeResult', data => {
## call.off('callDetailsChange')7+
-off\(type: 'callDetailsChange', callback?: Callback\): void
+off\(type: 'callDetailsChange', callback?: Callback\\): void
Unsubscribes from **callDetailsChange** events. This API uses an asynchronous callback to return the result.
@@ -2545,7 +2572,7 @@ Unsubscribes from **callDetailsChange** events. This API uses an asynchronous ca
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
| type | string | Yes | Call details change. This field has a fixed value of **callDetailsChange**.|
-| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No | Callback used to return the result. |
+| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
**Error codes**
@@ -2554,6 +2581,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2570,7 +2598,7 @@ call.off('callDetailsChange', data => {
## call.off('callEventChange')8+
-off\(type: 'callEventChange', callback?: Callback\): void
+off\(type: 'callEventChange', callback?: Callback\\): void
Unsubscribes from **callEventChange** events. This API uses an asynchronous callback to return the result.
@@ -2585,7 +2613,7 @@ Unsubscribes from **callEventChange** events. This API uses an asynchronous call
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ---------------------------------- |
| type | string | Yes | Call event change. This field has a fixed value of **callEventChange**.|
-| callback | Callback<[CallEventOptions](#calleventoptions8)> | No | Callback used to return the result. |
+| callback | Callback<[CallEventOptions](#calleventoptions8)> | No | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
**Error codes**
@@ -2594,6 +2622,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2610,7 +2639,7 @@ call.off('callEventChange', data => {
## call.off('callDisconnectedCause')8+
-off\(type: 'callDisconnectedCause', callback?: Callback\): void
+off\(type: 'callDisconnectedCause', callback?: Callback\\): void
Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.
@@ -2625,7 +2654,7 @@ Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronou
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------------- | ---- | ------------------- |
| type | string | Yes | Call disconnection cause. This field has a fixed value of **callDisconnectedCause**.|
-| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | No | Callback used to return the result. |
+| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | No | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
**Error codes**
@@ -2634,6 +2663,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2650,7 +2680,7 @@ call.off('callDisconnectedCause', data => {
## call.off('mmiCodeResult')9+
-off\(type: 'mmiCodeResult', callback?: Callback\): void
+off\(type: 'mmiCodeResult', callback?: Callback\\): void
Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callback to return the result.
@@ -2665,7 +2695,7 @@ Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callba
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ----------- |
| type | string | Yes | MMI code result. This field has a fixed value of **mmiCodeResult**.|
-| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | No | Callback used to return the result. |
+| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | No | Callback used to return the result. If this parameter is not set, no subscription cancellation result will be received.|
**Error codes**
@@ -2674,6 +2704,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2690,7 +2721,7 @@ call.off('mmiCodeResult', data => {
## call.isNewCallAllowed8+
-isNewCallAllowed\(callback: AsyncCallback\): void
+isNewCallAllowed\(callback: AsyncCallback\\): void
Checks whether a new call is allowed. This API uses an asynchronous callback to return the result.
@@ -2710,6 +2741,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2727,7 +2759,7 @@ call.isNewCallAllowed((err, data) => {
## call.isNewCallAllowed8+
-isNewCallAllowed\(\): Promise
+isNewCallAllowed\(\): Promise\
Checks whether a new call is allowed. This API uses a promise to return the result.
@@ -2747,8 +2779,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
-| 401 | Parameter error. |
-| 8300001 | Invalid parameter value. |
+| 202 | Non-system applications use system APIs. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
@@ -2766,7 +2797,7 @@ promise.then(data => {
## call.separateConference8+
-separateConference\(callId: number, callback: AsyncCallback\): void
+separateConference\(callId: number, callback: AsyncCallback\\): void
Separates calls from a conference call. This API uses an asynchronous callback to return the result.
@@ -2787,6 +2818,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2804,7 +2836,7 @@ call.separateConference(1, (err) => {
## call.separateConference8+
-separateConference\(callId: number\): Promise
+separateConference\(callId: number\): Promise\
Separates calls from a conference call. This API uses a promise to return the result.
@@ -2830,6 +2862,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -2848,7 +2881,7 @@ call.separateConference(1).then(() => {
## call.getCallRestrictionStatus8+
-getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: AsyncCallback\): void
+getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: AsyncCallback\\): void
Obtains the call restriction status. This API uses an asynchronous callback to return the result.
@@ -2873,11 +2906,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2890,7 +2923,7 @@ call.getCallRestrictionStatus(0, 1, (err, data) => {
## call.getCallRestrictionStatus8+
-getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise
+getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise\
Obtains the call restriction status. This API uses a promise to return the result.
@@ -2920,11 +2953,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2939,7 +2972,7 @@ promise.then(data => {
## call.setCallRestriction8+
-setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback\): void
+setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback\\): void
Sets the call restriction status. This API uses an asynchronous callback to return the result.
@@ -2964,11 +2997,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -2986,7 +3019,7 @@ call.setCallRestriction(0, callRestrictionInfo, (err) => {
## call.setCallRestriction8+
-setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise
+setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise\
Sets the call restriction status. This API uses a promise to return the result.
@@ -3016,11 +3049,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -3039,7 +3072,7 @@ call.setCallRestriction(0, callRestrictionInfo).then(() => {
## call.getCallTransferInfo8+
-getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCallback\): void
+getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCallback\\): void
Obtains call transfer information. This API uses an asynchronous callback to return the result.
@@ -3064,11 +3097,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -3081,7 +3114,7 @@ call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err, data
## call.getCallTransferInfo8+
-getCallTransferInfo\(slotId: number, type: CallTransferType): Promise
+getCallTransferInfo\(slotId: number, type: CallTransferType\): Promise\
Obtains call transfer information. This API uses a promise to return the result.
@@ -3111,11 +3144,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -3130,7 +3163,7 @@ promise.then(data => {
## call.setCallTransfer8+
-setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback\): void
+setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback\\): void
Sets call transfer information. This API uses an asynchronous callback to return the result.
@@ -3155,11 +3188,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -3177,7 +3210,7 @@ call.setCallTransfer(0, callTransferInfo, (err) => {
## call.setCallTransfer8+
-setCallTransfer\(slotId: number, info: CallTransferInfo): Promise
+setCallTransfer\(slotId: number, info: CallTransferInfo\): Promise\
Sets call transfer information. This API uses a promise to return the result.
@@ -3207,11 +3240,11 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
-| 8300999 | Unknown error code. |
**Example**
@@ -3230,7 +3263,7 @@ call.setCallTransfer(0, callTransferInfo).then(() => {
## call.isRinging8+
-isRinging\(callback: AsyncCallback\): void
+isRinging\(callback: AsyncCallback\\): void
Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result.
@@ -3253,6 +3286,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3270,7 +3304,7 @@ call.isRinging((err, data) => {
## call.isRinging8+
-isRinging\(\): Promise
+isRinging\(\): Promise\
Checks whether the ringtone is playing. This API uses a promise to return the result.
@@ -3293,8 +3327,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
-| 401 | Parameter error. |
-| 8300001 | Invalid parameter value. |
+| 202 | Non-system applications use system APIs. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
@@ -3312,7 +3345,7 @@ promise.then(data => {
## call.setMuted8+
-setMuted\(callback: AsyncCallback\): void
+setMuted\(callback: AsyncCallback\\): void
Sets call muting. This API uses an asynchronous callback to return the result.
@@ -3332,6 +3365,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3349,7 +3383,7 @@ call.setMuted((err) => {
## call.setMuted8+
-setMuted\(\): Promise
+setMuted\(\): Promise\
Sets call muting. This API uses a promise to return the result.
@@ -3369,8 +3403,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
-| 401 | Parameter error. |
-| 8300001 | Invalid parameter value. |
+| 202 | Non-system applications use system APIs. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
@@ -3387,7 +3420,7 @@ call.setMuted().then(() => {
## call.cancelMuted8+
-cancelMuted(callback: AsyncCallback): void
+cancelMuted\(callback: AsyncCallback\\): void
Cancels call muting. This API uses an asynchronous callback to return the result.
@@ -3407,6 +3440,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3424,7 +3458,7 @@ call.cancelMuted((err) => {
## call.cancelMuted8+
-cancelMuted(): Promise
+cancelMuted\(\): Promise\
Cancels call muting. This API uses a promise to return the result.
@@ -3444,8 +3478,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
-| 401 | Parameter error. |
-| 8300001 | Invalid parameter value. |
+| 202 | Non-system applications use system APIs. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
@@ -3462,7 +3495,7 @@ call.cancelMuted().then(() => {
## call.setAudioDevice8+
-setAudioDevice\(device: AudioDevice, callback: AsyncCallback\): void
+setAudioDevice\(device: AudioDevice, callback: AsyncCallback\\): void
Sets the audio device for a call. This API uses an asynchronous callback to return the result.
@@ -3483,6 +3516,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3500,9 +3534,9 @@ call.setAudioDevice(1, (err) => {
## call.setAudioDevice9+
-setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback\): void
+setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback\\): void
-Sets the audio device for a call based on the specified options. This API uses an asynchronous callback to return the result.
+Sets the audio device for a call. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
@@ -3522,6 +3556,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3542,7 +3577,7 @@ call.setAudioDevice(1, audioDeviceOptions, (err) => {
## call.setAudioDevice9+
-setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise
+setAudioDevice\(device: AudioDevice, options?: AudioDeviceOptions\): Promise\
Sets the audio device for a call based on the specified options. This API uses a promise to return the result.
@@ -3569,6 +3604,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3590,7 +3626,7 @@ call.setAudioDevice(1, audioDeviceOptions).then(() => {
## call.joinConference8+
-joinConference(mainCallId: number, callNumberList: Array, callback: AsyncCallback): void
+joinConference\(mainCallId: number, callNumberList: Array\, callback: AsyncCallback\\): void
Joins a conference call. This API uses an asynchronous callback to return the result.
@@ -3612,6 +3648,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3631,7 +3668,7 @@ call.joinConference(1, callNumberList, (err) => {
## call.joinConference8+
-joinConference(mainCallId: number, callNumberList: Array): Promise
+joinConference\(mainCallId: number, callNumberList: Array\\): Promise\
Joins a conference call. This API uses a promise to return the result.
@@ -3658,6 +3695,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3679,7 +3717,7 @@ call.joinConference(1, callNumberList).then(() => {
## call.updateImsCallMode8+
-updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback): void
+updateImsCallMode\(callId: number, mode: ImsCallMode, callback: AsyncCallback\\): void
Updates the IMS call mode. This API uses an asynchronous callback to return the result.
@@ -3701,6 +3739,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3717,7 +3756,7 @@ call.updateImsCallMode(1, 1, (err) => {
## call.updateImsCallMode8+
-updateImsCallMode(callId: number, mode: ImsCallMode): Promise
+updateImsCallMode\(callId: number, mode: ImsCallMode\): Promise\
Updates the IMS call mode. This API uses a promise to return the result.
@@ -3744,6 +3783,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3762,7 +3802,7 @@ call.updateImsCallMode(1, 1).then(() => {
## call.enableImsSwitch8+
-enableImsSwitch(slotId: number, callback: AsyncCallback): void
+enableImsSwitch\(slotId: number, callback: AsyncCallback\\): void
Enables the IMS switch. This API uses an asynchronous callback to return the result.
@@ -3786,6 +3826,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3802,7 +3843,7 @@ call.enableImsSwitch(0, (err) => {
## call.enableImsSwitch8+
-enableImsSwitch(slotId: number): Promise
+enableImsSwitch\(slotId: number\): Promise\
Enables the IMS switch. This API uses a promise to return the result.
@@ -3831,6 +3872,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3849,7 +3891,7 @@ call.enableImsSwitch(0).then(() => {
## call.disableImsSwitch8+
-disableImsSwitch(slotId: number, callback: AsyncCallback): void
+disableImsSwitch\(slotId: number, callback: AsyncCallback\\): void
Disables the IMS switch. This API uses an asynchronous callback to return the result.
@@ -3873,6 +3915,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3889,7 +3932,7 @@ call.disableImsSwitch(0, (err) => {
## call.disableImsSwitch8+
-disableImsSwitch(slotId: number): Promise
+disableImsSwitch\(slotId: number\): Promise\
Disables the IMS switch. This API uses a promise to return the result.
@@ -3918,6 +3961,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3936,7 +3980,7 @@ call.disableImsSwitch(0).then(() => {
## call.isImsSwitchEnabled8+
-isImsSwitchEnabled(slotId: number, callback: AsyncCallback): void
+isImsSwitchEnabled\(slotId: number, callback: AsyncCallback\\): void
Checks whether the IMS switch is enabled. This API uses an asynchronous callback to return the result.
@@ -3957,6 +4001,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -3973,7 +4018,7 @@ call.isImsSwitchEnabled(0, (err, data) => {
## call.isImsSwitchEnabled8+
-isImsSwitchEnabled(slotId: number): Promise
+isImsSwitchEnabled\(slotId: number\): Promise\
Checks whether the IMS switch is enabled. This API uses a promise to return the result.
@@ -3999,6 +4044,7 @@ For details about the following error codes, see [Telephony Error Codes](../../r
| ID| Error Message |
| -------- | -------------------------------------------- |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
@@ -4024,11 +4070,11 @@ Provides an option for determining whether a call is a video call.
| Name | Type | Mandatory| Description |
| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
-| extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call|
-| accountId 8+ | number | No | Account ID.
- **0**: card slot 1
- **1**: card slot 2
This is a system API. |
-| videoState 8+ | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. |
-| dialScene 8+ | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. |
-| dialType 8+ | [DialType](#dialtype8) | No | Dialup type. This is a system API. |
+| extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call |
+| accountId 8+ | number | No | Account ID.
- **0**: card slot 1
- **1**: card slot 2
|
+| videoState 8+ | [VideoStateType](#videostatetype7) | No | Video state type. |
+| dialScene 8+ | [DialScene](#dialscene8) | No | Dialup scenario. |
+| dialType 8+ | [DialType](#dialtype8) | No | Dialup type. |
## DialCallOptions9+
@@ -4409,7 +4455,7 @@ Enumerates call transfer states.
## DisconnectedDetails9+
-Defines the cause of a call disconnection.
+Defines the call disconnection cause.
**System API**: This is a system API.
@@ -4417,12 +4463,12 @@ Defines the cause of a call disconnection.
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------------ | ---- | --------------- |
-| reason | [DisconnectedReason](#disconnectedreason8) | Yes | Cause of the call disconnection. |
-| message | string | Yes | Message indicating the call disconnection.|
+| reason | [DisconnectedReason](#disconnectedreason8) | Yes | Call disconnection cause. |
+| message | string | Yes | Call ending message.|
## DisconnectedReason8+
-Enumerates causes of call disconnection.
+Enumerates call disconnection causes.
**System API**: This is a system API.
diff --git a/en/application-dev/reference/apis/js-apis-charger.md b/en/application-dev/reference/apis/js-apis-charger.md
index 0b4f5dba51054c51fd2c74cc1867413340b9a687..4c5d43246672f37ea5cda135492ad71ed4f679da 100644
--- a/en/application-dev/reference/apis/js-apis-charger.md
+++ b/en/application-dev/reference/apis/js-apis-charger.md
@@ -17,6 +17,8 @@ import charger from '@ohos.charger';
Enumerates charging types.
+**System API**: This is a system API.
+
**System capability**: SystemCapability.PowerManager.BatteryManager.Core
| Name | Value | Description |
diff --git a/en/application-dev/reference/apis/js-apis-cooperate.md b/en/application-dev/reference/apis/js-apis-cooperate.md
index d63729a9dcf6a08133dd28f7cdabc6e63f0a4b6e..da39b72f0cae0702e82eb18b80e034f03c60936d 100644
--- a/en/application-dev/reference/apis/js-apis-cooperate.md
+++ b/en/application-dev/reference/apis/js-apis-cooperate.md
@@ -1,12 +1,12 @@
# @ohos.multimodalInput.inputDeviceCooperate (Screen Hopping)
-The **inputDeviceCooperate** module enables two or more networked devices to share the keyboard and mouse for collaborative operations.
+The **inputDeviceCooperate** module implements screen hopping for two or more networked devices to share the keyboard and mouse for collaborative operations.
> **NOTE**
>
-> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-> - The APIs provided by this module are system APIs.
-
+> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+>
+> - The APIs provided by this module are system APIs.
## Modules to Import
@@ -66,7 +66,7 @@ Specifies whether to enable screen hopping. This API uses a promise to return th
**Return value**
-| Name | Description |
+| Parameters | Description |
| ------------------- | ------------------------------- |
| Promise<void> | Promise used to return the result. |
@@ -221,7 +221,7 @@ Stops screen hopping. This API uses a promise to return the result.
| Name | Description |
| -------- | ---------------------------- |
-| Promise\ | Promise used to return the result. |
+| Promise\ | Promise used to return the result. |
**Example**
@@ -287,7 +287,7 @@ Checks whether screen hopping is enabled. This API uses a promise to return the
**Return value**
-| Name | Description |
+| Parameters | Description |
| ------------------- | ------------------------------- |
| Promise<{ state: boolean }>| Promise used to return the result. |
@@ -296,6 +296,7 @@ Checks whether screen hopping is enabled. This API uses a promise to return the
**Example**
```js
+let deviceDescriptor = "descriptor";
try {
inputDeviceCooperate.getState(deviceDescriptor).then((data) => {
console.log(`Get the status success, data: ${JSON.stringify(data)}`);
@@ -311,7 +312,7 @@ try {
on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, eventMsg: EventMsg }>): void
-Enables listening for screen hopping events.
+Enables listening for screen hopping status change events.
**System capability**: SystemCapability.MultimodalInput.Input.Cooperator
@@ -340,7 +341,7 @@ try {
off(type: 'cooperation', callback?: AsyncCallback\): void
-Disables listening for screen hopping events.
+Disables listening for screen hopping status change events.
**System capability**: SystemCapability.MultimodalInput.Input.Cooperator
@@ -388,7 +389,7 @@ Enumerates screen hopping event.
**System capability**: SystemCapability.MultimodalInput.Input.Cooperator
-| Name | Value | Description |
+| Name | Value | Description |
| -------- | --------- | ----------------- |
| MSG_COOPERATE_INFO_START | 200 | Screen hopping starts. |
| MSG_COOPERATE_INFO_SUCCESS | 201 | Screen hopping succeeds. |
diff --git a/en/application-dev/reference/apis/js-apis-devicestatus-cooperate.md b/en/application-dev/reference/apis/js-apis-devicestatus-cooperate.md
new file mode 100644
index 0000000000000000000000000000000000000000..cada3fc494deced44ecf150dae636786f167bb3a
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-devicestatus-cooperate.md
@@ -0,0 +1,457 @@
+# @ohos.cooperate (Screen Hopping)
+
+The **cooperate** module implements screen hopping for two or more networked devices to share the keyboard and mouse for collaborative operations.
+
+> **NOTE**
+>
+> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+>
+> - The APIs provided by this module are system APIs.
+
+## Modules to Import
+
+```js
+import cooperate from '@ohos.cooperate'
+```
+
+## cooperate.prepare
+
+prepare(callback: AsyncCallback<void>): void;
+
+Prepares for screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ------------------------- | ---- | --------------------------- |
+| callback | AsyncCallback<void> | Yes|Callback used to return the result. |
+
+**Example**
+
+```js
+try {
+ cooperate.prepare((error) => {
+ if (error) {
+ console.log(`Keyboard mouse crossing prepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Keyboard mouse crossing prepare success.`);
+ });
+} catch (error) {
+ console.log(`Keyboard mouse crossing prepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## cooperate.prepare
+
+prepare(): Promise<void>
+
+Prepares for screen hopping. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Return value**
+
+| Parameters | Description |
+| ------------------- | ------------------------------- |
+| Promise<void> | Promise used to return the result.|
+
+
+
+**Example**
+
+```js
+try {
+ cooperate.prepare().then(() => {
+ console.log(`Keyboard mouse crossing prepare success.`);
+ }, (error) => {
+ console.log(`Keyboard mouse crossing prepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ });
+} catch (error) {
+ console.log(`Keyboard mouse crossing prepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+
+
+## cooperate.unprepare
+
+unprepare(callback: AsyncCallback<void>): void;
+
+Cancels the preparation for screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------- | ---- | ------------------------------------------ |
+| callback | AsyncCallback<void> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+try {
+ cooperate.unprepare((error) => {
+ if (error) {
+ console.log(`Keyboard mouse crossing unprepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ return;
+ }
+ console.log(`Keyboard mouse crossing unprepare success.`);
+ });
+} catch (error) {
+ console.log(`Keyboard mouse crossing unprepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+
+
+## cooperate.unprepare
+
+unprepare(): Promise<void>;
+
+Cancels the preparation for screen hopping. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Return value**
+
+| Parameters | Description |
+| ------------------- | --------------------------------------------- |
+| Promise<void> | Promise used to return the result.|
+
+```js
+try {
+ cooperate.unprepare().then(() => {
+ console.log(`Keyboard mouse crossing unprepare success.`);
+ }, (error) => {
+ console.log(`Keyboard mouse crossing unprepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+ });
+} catch (error) {
+ console.log(`Keyboard mouse crossing unprepare failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+
+
+## cooperate.activate
+
+activate(targetNetworkId: string, inputDeviceId: number, callback: AsyncCallback<void>): void;
+
+Starts screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| targetNetworkId | string | Yes | Descriptor of the target device for screen hopping. |
+| inputDeviceId | number | Yes | Identifier of the input device for screen hopping.|
+| callback | AsyncCallback<void> | Yes | Callback used to return the result.|
+
+**Error codes**
+
+For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcode-devicestatus.md).
+
+| ID| Error Message|
+| -------- | ---------------------------------------- |
+| 20900001 | This error code is reported if the screen hopping status is abnormal when the screen hopping API is called. |
+
+**Example**
+
+```js
+let targetNetworkId = "networkId";
+let inputDeviceId = 0;
+try {
+ cooperate.activate(targetNetworkId, inputDeviceId, (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`])}`);
+}
+```
+
+## cooperate.activate
+
+activate(targetNetworkId: string, inputDeviceId: number): Promise<void>;
+
+Starts screen hopping. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| targetNetworkId | string | Yes | Descriptor of the target device for screen hopping. |
+| inputDeviceId | number | Yes | Identifier of the input device for screen hopping.|
+
+
+
+**Return value**
+
+| Name | Description |
+| ---------------------- | ------------------------------- |
+| Promise<void> | Promise used to return the result. |
+
+**Error codes**
+
+For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcode-devicestatus.md).
+
+| ID| Error Message|
+| -------- | ---------------------------------------- |
+| 20900001 | This error code is reported if the screen hopping status is abnormal when the screen hopping API is called. |
+
+**Example**
+
+```js
+let targetNetworkId = "networkId";
+let inputDeviceId = 0;
+try {
+ cooperate.activate(targetNetworkId, inputDeviceId).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`])}`);
+}
+```
+
+## cooperate.deactivate
+
+deactivate(isUnchained: boolean, callback: AsyncCallback<void>): void;
+
+Stops screen hopping. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| isUnchained | boolean | Yes| Whether to disable the cross-device link.|
+| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ cooperate.deactivate(false, (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`])}`);
+}
+```
+
+## cooperate.deactivate
+
+deactivate(isUnchained: boolean): Promise<void>;
+
+Stops screen hopping. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------- | ------- | ---- | ------------------ |
+| isUnchained | boolean | Yes | Whether to disable the cross-device link.|
+
+
+
+**Return value**
+
+| Name | Description |
+| -------- | ---------------------------- |
+| Promise<void> | Promise used to return the result. |
+
+
+
+**Example**
+
+```js
+try {
+ cooperate.deactivate(false).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`])}`);
+}
+```
+
+## cooperate.getCrossingSwitchState
+
+getCrossingSwitchState(networkId: string, callback: AsyncCallback<boolean>): void;
+
+Obtains the screen hopping status of the target device. This API uses an asynchronous callback to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | --------- | ---- | ---------------------------- |
+| networkId | string | Yes | Descriptor of the target device for screen hopping. |
+| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.|
+
+**Example**
+
+```js
+let deviceDescriptor = "networkId";
+try {
+ cooperate.getCrossingSwitchState(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`])}`);
+}
+```
+
+## cooperate.getCrossingSwitchState
+
+getCrossingSwitchState(networkId: string): Promise<boolean>;
+
+Obtains the screen hopping status of the target device. This API uses a promise to return the result.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | --------- | ---- | ---------------------------- |
+| networkId | string | Yes | Descriptor of the target device for screen hopping. |
+
+
+
+**Return value**
+
+| Parameters | Description |
+| ------------------- | ------------------------------- |
+| Promise<boolean> | Promise used to return the result.|
+
+
+
+**Example**
+
+```js
+let deviceDescriptor = "networkId";
+try {
+ cooperate.getCrossingSwitchState(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('cooperate')
+
+on(type: 'cooperate', callback: Callback<{ networkId: string, msg: CooperateMsg }>): void;
+
+Enables listening for screen hopping status change events.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| type | string | Yes | Event type. The value is **cooperate**.|
+| callback | Callback<{ networkId: string, msg: [CooperateMsg](#cooperatemsg) }> | Yes | Callback used to return the result.|
+
+
+
+**Example**
+
+```js
+try {
+ cooperate.on('cooperate', (data) => {
+ console.log(`Keyboard mouse crossing event: ${JSON.stringify(data)}`);
+ });
+} catch (error) {
+ console.log(`Register failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## off('cooperate')
+
+off(type: 'cooperate', callback?: Callback<void>): void;
+
+Disables listening for screen hopping status change events.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ---------------------------- |
+| type | string | Yes | Event type. The value is **cooperate**.|
+| callback | AsyncCallback<void> | 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.
+function callback(event) {
+ console.log(`Keyboard mouse crossing event: ${JSON.stringify(event)}`);
+ return false;
+}
+try {
+ cooperate.on('cooperate', callback);
+ cooperate.off("cooperate", callback);
+} catch (error) {
+ console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+```js
+// Unregister all callbacks.
+function callback(event) {
+ console.log(`Keyboard mouse crossing event: ${JSON.stringify(event)}`);
+ return false;
+}
+try {
+ cooperate.on('cooperate', callback);
+ cooperate.off("cooperate");
+} catch (error) {
+ console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
+}
+```
+
+## CooperateMsg
+
+Represents a screen hopping message notification.
+
+**System capability**: SystemCapability.Msdp.DeviceStatus.Cooperate
+
+| Name | Value | Description |
+| -------- | ----------------- | ----------------- |
+| COOPERATE_PREPARE | 0 | The preparation for screen hopping is finished. |
+| COOPERATE_UNPREPARE | 1 | The preparation for screen hopping is cancelled. |
+| COOPERATE_ACTIVATE | 2 | Screen hopping starts. |
+| COOPERATE_ACTIVATE_SUCCESS | 3 | Starting screen hopping succeeds.|
+| COOPERATE_ACTIVATE_FAIL | 4 | Starting screen hopping fails.|
+| COOPERATE_DEACTIVATE_SUCCESS | 5 | Stopping screen hopping succeeds.|
+| COOPERATE_DEACTIVATE_FAIL | 6 | Stopping screen hopping fails.|
diff --git a/en/application-dev/reference/apis/js-apis-http.md b/en/application-dev/reference/apis/js-apis-http.md
index c798d91a2cee8c4b750201cce4deef26bcc7bc40..9f49f9bb61eda42dfc3232ac545f6d080aa3758e 100644
--- a/en/application-dev/reference/apis/js-apis-http.md
+++ b/en/application-dev/reference/apis/js-apis-http.md
@@ -45,7 +45,8 @@ httpRequest.request(
connectTimeout: 60000 // Optional. The default value is 60000, in ms.
readTimeout: 60000, // Optional. The default value is 60000, in ms.
usingProtocol: http.HttpProtocol.HTTP1_1, // Optional. The default protocol type is automatically specified by the system.
- usingProxy: false, // Optional. By default, network proxy is not used. This field is supported since API 10.
+ usingProxy: false, // Optional. By default, network proxy is not used. This field is supported since API version 10.
+ caPath: "", // Optional. The preset CA certificate is used by default. This field is supported since API version 10.
}, (err, data) => {
if (!err) {
// data.result carries the HTTP response. Parse the response based on service requirements.
@@ -68,7 +69,7 @@ httpRequest.request(
> **NOTE**
> If the data in **console.info()** contains a newline character, the data will be truncated.
-## http.createHttp
+## http.createHttp6+
createHttp(): HttpRequest
@@ -94,7 +95,7 @@ let httpRequest = http.createHttp();
Defines an HTTP request task. Before invoking APIs provided by **HttpRequest**, you must call [createHttp()](#httpcreatehttp) to create an **HttpRequestTask** object.
-### request
+### request6+
request(url: string, callback: AsyncCallback\):void
@@ -116,14 +117,38 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback
**Error codes**
-| Code | Error Message |
+| ID | Error Message |
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
+| 2300001 | Unsupported protocol. |
| 2300003 | URL using bad/illegal format or missing URL. |
+| 2300005 | Couldn't resolve proxy name. |
+| 2300006 | Couldn't resolve host name. |
| 2300007 | Couldn't connect to server. |
+| 2300008 | Weird server reply. |
+| 2300009 | Access denied to remote resource. |
+| 2300016 | Error in the HTTP2 framing layer. |
+| 2300018 | Transferred a partial file. |
+| 2300023 | Failed writing received data to disk/application. |
+| 2300025 | Upload failed. |
+| 2300026 | Failed to open/read local data from file/application. |
+| 2300027 | Out of memory. |
| 2300028 | Timeout was reached. |
+| 2300047 | Number of redirects hit maximum amount. |
| 2300052 | Server returned nothing (no headers, no data). |
+| 2300055 | Failed sending data to the peer. |
+| 2300056 | Failure when receiving data from the peer. |
+| 2300058 | Problem with the local SSL certificate. |
+| 2300059 | Couldn't use specified SSL cipher. |
+| 2300060 | SSL peer certificate or SSH remote key was not OK. |
+| 2300061 | Unrecognized or bad HTTP Content or Transfer-Encoding.|
+| 2300063 | Maximum file size exceeded. |
+| 2300070 | Disk full or allocation exceeded. |
+| 2300073 | Remote file already exists. |
+| 2300077 | Problem with the SSL CA cert (path? access rights?). |
+| 2300078 | Remote file not found. |
+| 2300094 | An authentication function returned an error. |
| 2300999 | Unknown Other Error. |
> **NOTE**
@@ -145,7 +170,7 @@ httpRequest.request("EXAMPLE_URL", (err, data) => {
});
```
-### request
+### request6+
request(url: string, options: HttpRequestOptions, callback: AsyncCallback\):void
@@ -168,7 +193,7 @@ Initiates an HTTP request containing specified options to a given URL. This API
**Error codes**
-| Code | Error Message |
+| ID | Error Message |
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
@@ -231,7 +256,7 @@ httpRequest.request("EXAMPLE_URL",
});
```
-### request
+### request6+
request(url: string, options? : HttpRequestOptions): Promise\
@@ -259,7 +284,7 @@ Initiates an HTTP request containing specified options to a given URL. This API
**Error codes**
-| Code | Error Message |
+| ID | Error Message |
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
@@ -353,14 +378,38 @@ Initiates an HTTP request containing specified options to a given URL. This API
**Error codes**
-| Code | Error Message |
+| ID | Error Message |
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
+| 2300001 | Unsupported protocol. |
| 2300003 | URL using bad/illegal format or missing URL. |
+| 2300005 | Couldn't resolve proxy name. |
+| 2300006 | Couldn't resolve host name. |
| 2300007 | Couldn't connect to server. |
+| 2300008 | Weird server reply. |
+| 2300009 | Access denied to remote resource. |
+| 2300016 | Error in the HTTP2 framing layer. |
+| 2300018 | Transferred a partial file. |
+| 2300023 | Failed writing received data to disk/application. |
+| 2300025 | Upload failed. |
+| 2300026 | Failed to open/read local data from file/application. |
+| 2300027 | Out of memory. |
| 2300028 | Timeout was reached. |
+| 2300047 | Number of redirects hit maximum amount. |
| 2300052 | Server returned nothing (no headers, no data). |
+| 2300055 | Failed sending data to the peer. |
+| 2300056 | Failure when receiving data from the peer. |
+| 2300058 | Problem with the local SSL certificate. |
+| 2300059 | Couldn't use specified SSL cipher. |
+| 2300060 | SSL peer certificate or SSH remote key was not OK. |
+| 2300061 | Unrecognized or bad HTTP Content or Transfer-Encoding.|
+| 2300063 | Maximum file size exceeded. |
+| 2300070 | Disk full or allocation exceeded. |
+| 2300073 | Remote file already exists. |
+| 2300077 | Problem with the SSL CA cert (path? access rights?). |
+| 2300078 | Remote file not found. |
+| 2300094 | An authentication function returned an error. |
| 2300999 | Unknown Other Error. |
> **NOTE**
@@ -383,7 +432,7 @@ httpRequest.request2("EXAMPLE_URL", (err, data) => {
request2(url: string, options: HttpRequestOptions, callback: AsyncCallback\): void
-Initiates an HTTP request to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response.
+Initiates an HTTP request containing specified options to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response.
**Required permissions**: ohos.permission.INTERNET
@@ -399,7 +448,7 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback
**Error codes**
-| Code | Error Message |
+| ID | Error Message |
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
@@ -482,7 +531,7 @@ Initiates an HTTP request containing specified options to a given URL. This API
**Error codes**
-| Code | Error Message |
+| ID | Error Message |
|---------|-------------------------------------------------------|
| 401 | Parameter error. |
| 201 | Permission denied. |
@@ -757,7 +806,7 @@ httpRequest.off('dataEnd');
### on('dataProgress')10+
-on(type: 'dataProgress', callback: AsyncCallback\<{ receiveSize: number, totalSize: number }\>): void
+on(type: 'dataProgress', callback: Callback\<{ receiveSize: number, totalSize: number }\>): void
Registers an observer for events indicating progress of receiving HTTP streaming responses.
@@ -802,7 +851,7 @@ Unregisters the observer for events indicating progress of receiving HTTP stream
httpRequest.off('dataProgress');
```
-## HttpRequestOptions
+## HttpRequestOptions6+
Specifies the type and value range of the optional parameters in the HTTP request.
@@ -819,9 +868,10 @@ Specifies the type and value range of the optional parameters in the HTTP reques
| readTimeout | number | No | Read timeout duration. The default value is **60000**, in ms.
The value **0** indicates no timeout.|
| connectTimeout | number | No | Connection timeout interval. The default value is **60000**, in ms. |
| usingProtocol9+ | [HttpProtocol](#httpprotocol9) | No | Protocol. The default value is automatically specified by the system. |
-| usingProxy10+ | boolean \| Object | No | Whether to use HTTP proxy. The default value is **false**, which means not to use HTTP proxy.
- If **usingProxy** is of the **Boolean** type and the value is **true**, network proxy is used by default.
- If **usingProxy** is of the **object** type, the specified network proxy is used. |
+| usingProxy10+ | boolean \| Object | No | Whether to use HTTP proxy. The default value is **false**, which means not to use HTTP proxy.
- If **usingProxy** is of the **Boolean** type and the value is **true**, network proxy is used by default.
- If **usingProxy** is of the **object** type, the specified network proxy is used.
+| caPath10+ | string | No | Path of the CA certificate. If this parameter is set, the system uses the CA certificate in the specified path. Otherwise, the system uses the preset CA certificate. |
-## RequestMethod
+## RequestMethod6+
Defines an HTTP request method.
@@ -838,7 +888,7 @@ Defines an HTTP request method.
| TRACE | "TRACE" | TRACE method. |
| CONNECT | "CONNECT" | CONNECT method.|
-## ResponseCode
+## ResponseCode6+
Enumerates the response codes for an HTTP request.
@@ -882,7 +932,7 @@ Enumerates the response codes for an HTTP request.
| GATEWAY_TIMEOUT | 504 | "Gateway Timeout." The server acting as a gateway or proxy does not receive requests from the remote server within the timeout period. |
| VERSION | 505 | "HTTP Version Not Supported." The server does not support the HTTP protocol version used in the request. |
-## HttpResponse
+## HttpResponse6+
Defines the response to an HTTP request.
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 813d7c830bc37076654863fb7d8d17b1f039d14c..34705e77e7d0b1e4f2705faf4ae78e0526aad25c 100644
--- a/en/application-dev/reference/apis/js-apis-net-connection.md
+++ b/en/application-dev/reference/apis/js-apis-net-connection.md
@@ -11,7 +11,7 @@ The network connection management module provides basic network management capab
import connection from '@ohos.net.connection'
```
-## connection.createNetConnection
+## connection.createNetConnection8+
createNetConnection(netSpecifier?: NetSpecifier, timeout?: number): NetConnection
@@ -46,7 +46,7 @@ let netConnectionCellular = connection.createNetConnection({
})
```
-## connection.getDefaultNet
+## connection.getDefaultNet8+
getDefaultNet(callback: AsyncCallback\): void
@@ -79,7 +79,7 @@ connection.getDefaultNet(function (error, data) {
})
```
-## connection.getDefaultNet
+## connection.getDefaultNet8+
getDefaultNet(): Promise\
@@ -444,7 +444,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getAllNets
+## connection.getAllNets8+
getAllNets(callback: AsyncCallback<Array<NetHandle>>): void
@@ -477,7 +477,7 @@ connection.getAllNets(function (error, data) {
});
```
-## connection.getAllNets
+## connection.getAllNets8+
getAllNets(): Promise<Array<NetHandle>>
@@ -509,7 +509,7 @@ connection.getAllNets().then(function (data) {
});
```
-## connection.getConnectionProperties
+## connection.getConnectionProperties8+
getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\): void
@@ -547,7 +547,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getConnectionProperties
+## connection.getConnectionProperties8+
getConnectionProperties(netHandle: NetHandle): Promise\
@@ -589,7 +589,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getNetCapabilities
+## connection.getNetCapabilities8+
getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\): void
@@ -627,7 +627,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## connection.getNetCapabilities
+## connection.getNetCapabilities8+
getNetCapabilities(netHandle: NetHandle): Promise\
@@ -734,7 +734,7 @@ connection.isDefaultNetMetered().then(function (data) {
})
```
-## connection.hasDefaultNet
+## connection.hasDefaultNet8+
hasDefaultNet(callback: AsyncCallback\): void
@@ -767,7 +767,7 @@ connection.hasDefaultNet(function (error, data) {
})
```
-## connection.hasDefaultNet
+## connection.hasDefaultNet8+
hasDefaultNet(): Promise\
@@ -799,7 +799,7 @@ connection.hasDefaultNet().then(function (data) {
})
```
-## connection.enableAirplaneMode
+## connection.enableAirplaneMode8+
enableAirplaneMode(callback: AsyncCallback\): void
@@ -821,6 +821,7 @@ Enables the airplane mode. This API uses an asynchronous callback to return the
| ID| Error Message |
| ------- | ----------------------------- |
+| 202 | Non-system applications use system APIs.|
| 2100002 | Operation failed. Cannot connect to service.|
| 2100003 | System internal error. |
@@ -832,7 +833,7 @@ connection.enableAirplaneMode(function (error) {
})
```
-## connection.enableAirplaneMode
+## connection.enableAirplaneMode8+
enableAirplaneMode(): Promise\
@@ -854,6 +855,7 @@ Enables the airplane mode. This API uses a promise to return the result.
| ID| Error Message |
| ------- | ----------------------------- |
+| 202 | Non-system applications use system APIs.|
| 2100002 | Operation failed. Cannot connect to service.|
| 2100003 | System internal error. |
@@ -865,7 +867,7 @@ connection.enableAirplaneMode().then(function (error) {
})
```
-## connection.disableAirplaneMode
+## connection.disableAirplaneMode8+
disableAirplaneMode(callback: AsyncCallback\): void
@@ -887,6 +889,7 @@ Disables the airplane mode. This API uses an asynchronous callback to return the
| ID| Error Message |
| ------- | ----------------------------- |
+| 202 | Non-system applications use system APIs.|
| 2100002 | Operation failed. Cannot connect to service.|
| 2100003 | System internal error. |
@@ -898,7 +901,7 @@ connection.disableAirplaneMode(function (error) {
})
```
-## connection.disableAirplaneMode
+## connection.disableAirplaneMode8+
disableAirplaneMode(): Promise\
@@ -920,6 +923,7 @@ Disables the airplane mode. This API uses a promise to return the result.
| ID| Error Message |
| ------- | ----------------------------- |
+| 202 | Non-system applications use system APIs.|
| 2100002 | Operation failed. Cannot connect to service.|
| 2100003 | System internal error. |
@@ -931,7 +935,7 @@ connection.disableAirplaneMode().then(function (error) {
})
```
-## connection.reportNetConnected
+## connection.reportNetConnected8+
reportNetConnected(netHandle: NetHandle, callback: AsyncCallback<void>): void
@@ -968,7 +972,7 @@ connection.getDefaultNet().then(function (netHandle) {
});
```
-## connection.reportNetConnected
+## connection.reportNetConnected8+
reportNetConnected(netHandle: NetHandle): Promise<void>
@@ -1009,7 +1013,7 @@ connection.getDefaultNet().then(function (netHandle) {
});
```
-## connection.reportNetDisconnected
+## connection.reportNetDisconnected8+
reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback<void>): void
@@ -1046,7 +1050,7 @@ connection.getDefaultNet().then(function (netHandle) {
});
```
-## connection.reportNetDisconnected
+## connection.reportNetDisconnected8+
reportNetDisconnected(netHandle: NetHandle): Promise<void>
@@ -1087,7 +1091,7 @@ connection.getDefaultNet().then(function (netHandle) {
});
```
-## connection.getAddressesByName
+## connection.getAddressesByName8+
getAddressesByName(host: string, callback: AsyncCallback\>): void
@@ -1124,7 +1128,7 @@ connection.getAddressesByName(host, function (error, data) {
})
```
-## connection.getAddressesByName
+## connection.getAddressesByName8+
getAddressesByName(host: string): Promise\>
@@ -1174,7 +1178,7 @@ Represents the network connection handle.
> When a device changes to the network disconnected state, the **netLost** event will be triggered.
> When a device switches from a Wi-Fi network to a cellular network, the **netLost** event will be first triggered to indicate that the Wi-Fi network is lost and then the **netAvaliable** event will be triggered to indicate that the cellular network is available.
-### register
+### register8+
register(callback: AsyncCallback\): void
@@ -1195,9 +1199,10 @@ Registers a listener for network status changes.
| ID| Error Message |
| ------- | ----------------------------- |
| 201 | Permission denied. |
+| 401 | Parameter error. |
| 2100002 | Operation failed. Cannot connect to service.|
| 2100003 | System internal error. |
-| 2101008 | The callback is not exists. |
+| 2101008 | The same callback exists. |
| 2101022 | The number of requests exceeded the maximum. |
**Example**
@@ -1208,7 +1213,7 @@ netConnection.register(function (error) {
})
```
-### unregister
+### unregister8+
unregister(callback: AsyncCallback\): void
@@ -1226,9 +1231,11 @@ Unregisters the listener for network status changes.
| ID| Error Message |
| ------- | ----------------------------- |
+| 201 | Permission denied.|
+| 401 | Parameter error. |
| 2100002 | Operation failed. Cannot connect to service.|
| 2100003 | System internal error. |
-| 2101007 | The same callback exists. |
+| 2101007 | The callback is not exists. |
**Example**
@@ -1238,7 +1245,7 @@ netConnection.unregister(function (error) {
})
```
-### on('netAvailable')
+### on('netAvailable')8+
on(type: 'netAvailable', callback: Callback\): void
@@ -1277,7 +1284,7 @@ netCon.unregister(function (error) {
})
```
-### on('netBlockStatusChange')
+### on('netBlockStatusChange')8+
on(type: 'netBlockStatusChange', callback: Callback<{ netHandle: NetHandle, blocked: boolean }>): void
@@ -1316,7 +1323,7 @@ netCon.unregister(function (error) {
})
```
-### on('netCapabilitiesChange')
+### on('netCapabilitiesChange')8+
on(type: 'netCapabilitiesChange', callback: Callback<{ netHandle: NetHandle, netCap: NetCapabilities }>): void
@@ -1355,7 +1362,7 @@ netCon.unregister(function (error) {
})
```
-### on('netConnectionPropertiesChange')
+### on('netConnectionPropertiesChange')8+
on(type: 'netConnectionPropertiesChange', callback: Callback<{ netHandle: NetHandle, connectionProperties:
ConnectionProperties }>): void
@@ -1395,7 +1402,7 @@ netCon.unregister(function (error) {
})
```
-### on('netLost')
+### on('netLost')8+
on(type: 'netLost', callback: Callback\): void
@@ -1434,7 +1441,7 @@ netCon.unregister(function (error) {
})
```
-### on('netUnavailable')
+### on('netUnavailable')8+
on(type: 'netUnavailable', callback: Callback\): void
@@ -1473,7 +1480,7 @@ netCon.unregister(function (error) {
})
```
-## NetHandle
+## NetHandle8+
Defines the handle of the data network.
@@ -1640,7 +1647,7 @@ connection.getDefaultNet().then((netHandle) => {
})
```
-### getAddressesByName
+### getAddressesByName8+
getAddressesByName(host: string, callback: AsyncCallback\>): void
@@ -1679,7 +1686,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-### getAddressesByName
+### getAddressesByName8+
getAddressesByName(host: string): Promise\>
@@ -1722,7 +1729,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-### getAddressByName
+### getAddressByName8+
getAddressByName(host: string, callback: AsyncCallback\): void
@@ -1761,7 +1768,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-### getAddressByName
+### getAddressByName8+
getAddressByName(host: string): Promise\
@@ -1804,7 +1811,7 @@ connection.getDefaultNet().then(function (netHandle) {
})
```
-## NetCap
+## NetCap8+
Defines the network capability.
@@ -1818,7 +1825,7 @@ Defines the network capability.
| NET_CAPABILITY_NOT_VPN | 15 | The network does not use a virtual private network (VPN).|
| NET_CAPABILITY_VALIDATED | 16 | The Internet access capability of the network is successfully verified by the connection management module.|
-## NetBearType
+## NetBearType8+
Enumerates network types.
@@ -1842,7 +1849,7 @@ Defines the global HTTP proxy configuration of the network.
| port | number | No | Host port.|
| exclusionList | Array | No | Exclusion list of hosts that do not use the proxy server. The length of the combined elements in the list cannot exceed 96 bytes.
For example, the length of **baidu.com,zhihu.com** is 20 bytes.|
-## NetSpecifier
+## NetSpecifier8+
Provides an instance that bears data network capabilities.
@@ -1853,7 +1860,7 @@ Provides an instance that bears data network capabilities.
| netCapabilities | [NetCapabilities](#netcapabilities) | Yes | Network transmission capabilities and bearer types of the data network. |
| bearerPrivateIdentifier | string | No | Network identifier. The identifier of a Wi-Fi network is **wifi**, and that of a cellular network is **slot0** (corresponding to SIM card 1).|
-## NetCapabilities
+## NetCapabilities8+
Defines the network capability set.
@@ -1866,7 +1873,7 @@ Defines the network capability set.
| networkCap | Array\<[NetCap](#netcap)> | No| Network capability. |
| bearerTypes | Array\<[NetBearType](#netbeartype)> | Yes| Network type. |
-## ConnectionProperties
+## ConnectionProperties8+
Defines the network connection properties.
@@ -1881,7 +1888,7 @@ Defines the network connection properties.
| dnses | Array\<[NetAddress](#netaddress)> | Yes|Network address. For details, see [NetAddress](#netaddress).|
| mtu | number | Yes|Maximum transmission unit (MTU). |
-## RouteInfo
+## RouteInfo8+
Defines network route information.
@@ -1895,7 +1902,7 @@ Defines network route information.
| hasGateway | boolean | Yes|Whether a gateway is present. |
| isDefaultRoute | boolean | Yes|Whether the route is the default route.|
-## LinkAddress
+## LinkAddress8+
Defines network link information.
@@ -1906,7 +1913,7 @@ Defines network link information.
| address | [NetAddress](#netaddress) | Yes| Link address. |
| prefixLength | number | Yes|Length of the link address prefix.|
-## NetAddress
+## NetAddress8+
Defines a network address.
diff --git a/en/application-dev/reference/apis/js-apis-net-ethernet.md b/en/application-dev/reference/apis/js-apis-net-ethernet.md
index 3a04cbb3a501fd64d8315b5c929beaf6c2407355..ec15531de49c13ab4b2c85b0da9eacf37400d195 100644
--- a/en/application-dev/reference/apis/js-apis-net-ethernet.md
+++ b/en/application-dev/reference/apis/js-apis-net-ethernet.md
@@ -11,7 +11,7 @@ The **ethernet** module provides wired network capabilities, which allow users t
import ethernet from '@ohos.net.ethernet'
```
-## ethernet.setIfaceConfig
+## ethernet.setIfaceConfig9+
setIfaceConfig(iface: string, ic: InterfaceConfiguration, callback: AsyncCallback\): void
@@ -36,13 +36,15 @@ Sets the network interface configuration. This API uses an asynchronous callback
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
-| 2201005 | The device information does not exist. |
-| 2201006 | Device disconnected. |
-| 2201007 | Failed to write the user configuration. |
+| 2201004 | Invalid Ethernet profile. |
+| 2201005 | Device information does not exist. |
+| 2201006 | Ethernet device not connected. |
+| 2201007 | Ethernet failed to write user configuration information. |
**Example**
@@ -64,7 +66,7 @@ ethernet.setIfaceConfig("eth0", {
});
```
-## ethernet.setIfaceConfig
+## ethernet.setIfaceConfig9+
setIfaceConfig(iface: string, ic: InterfaceConfiguration): Promise\
@@ -94,13 +96,15 @@ Sets the network interface configuration. This API uses a promise to return the
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
-| 2201005 | The device information does not exist. |
-| 2201006 | Device disconnected. |
-| 2201007 | Failed to write the user configuration. |
+| 2201004 | Invalid Ethernet profile. |
+| 2201005 | Device information does not exist. |
+| 2201006 | Ethernet device not connected. |
+| 2201007 | Ethernet failed to write user configuration information. |
**Example**
@@ -120,7 +124,7 @@ ethernet.setIfaceConfig("eth0", {
});
```
-## ethernet.getIfaceConfig
+## ethernet.getIfaceConfig9+
getIfaceConfig(iface: string, callback: AsyncCallback\): void
@@ -144,11 +148,12 @@ Obtains the configuration of a network interface. This API uses an asynchronous
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
-| 2201005 | The device information does not exist. |
+| 2201005 | Device information does not exist. |
**Example**
@@ -168,7 +173,7 @@ ethernet.getIfaceConfig("eth0", (error, value) => {
});
```
-## ethernet.getIfaceConfig
+## ethernet.getIfaceConfig9+
getIfaceConfig(iface: string): Promise\
@@ -197,11 +202,12 @@ Obtains the configuration of a network interface. This API uses a promise to ret
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
-| 2201005 | The device information does not exist. |
+| 2201005 | Device information does not exist. |
**Example**
@@ -219,7 +225,7 @@ ethernet.getIfaceConfig("eth0").then((data) => {
});
```
-## ethernet.isIfaceActive
+## ethernet.isIfaceActive9+
isIfaceActive(iface: string, callback: AsyncCallback\): void
@@ -243,11 +249,12 @@ Checks whether a network interface is active. This API uses an asynchronous call
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
-| 2201005 | The device information does not exist. |
+| 2201005 | Device information does not exist. |
**Example**
@@ -261,7 +268,7 @@ ethernet.isIfaceActive("eth0", (error, value) => {
});
```
-## ethernet.isIfaceActive
+## ethernet.isIfaceActive9+
isIfaceActive(iface: string): Promise\
@@ -290,11 +297,12 @@ Checks whether a network interface is active. This API uses a promise to return
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
-| 2201005 | The device information does not exist. |
+| 2201005 | Device information does not exist. |
**Example**
@@ -306,7 +314,7 @@ ethernet.isIfaceActive("eth0").then((data) => {
});
```
-## ethernet.getAllActiveIfaces
+## ethernet.getAllActiveIfaces9+
getAllActiveIfaces(callback: AsyncCallback\>): void
@@ -329,6 +337,7 @@ Obtains the list of all active network interfaces. This API uses an asynchronous
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
@@ -347,7 +356,7 @@ ethernet.getAllActiveIfaces((error, value) => {
});
```
-## ethernet.getAllActiveIfaces
+## ethernet.getAllActiveIfaces9+
getAllActiveIfaces(): Promise\>
@@ -370,6 +379,7 @@ Obtains the list of all active network interfaces. This API uses a promise to re
| ID| Error Message |
| ------- | ----------------------------------------|
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 2200002 | Operation failed. Cannot connect to service.|
| 2200003 | System internal error. |
@@ -403,21 +413,19 @@ Registers an observer for NIC hot swap events. This API uses an asynchronous cal
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | ---- | ---------- |
| type | string | Yes | Event type. The value is **interfaceStateChange**.|
-| callback | Callback\<{ iface: string, active: boolean }\> | Yes | Callback used to return the result.
**iface**: NIC name.
**active**: whether the NIC is active. The value **true** indicates that the NIC is active, and the value **false** indicates the opposite.|
+| callback | AsyncCallback\<{ iface: string, active: boolean }\> | Yes | Callback used to return the result.
**iface**: NIC name.
**active**: whether the NIC is active. The value **true** indicates that the NIC is active, and the value **false** indicates the opposite.|
**Error codes**
| ID| Error Message |
| ------- | -------------------------------------------- |
-| 201 | Permission denied. |
-| 202 | Applicable only to system applications. |
-| 401 | Parameter error. |
+| 202 | Non-system applications use system APIs. |
**Example**
```js
-ethernet.on('interfaceStateChange', (data) => {
- console.log('on interfaceSharingStateChange: ' + JSON.stringify(data.iface) + JSON.stringify(data.active));
+ ethernet.on('interfaceStateChange', (data) => {
+ console.log('on interfaceSharingStateChange: ' + JSON.stringify(data));
});
```
@@ -438,15 +446,13 @@ Unregisters the observer for NIC hot swap events. This API uses an asynchronous
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | ---- | ---------- |
| type | string | Yes | Event type. The value is **interfaceStateChange**.|
-| callback | Callback\<{ iface: string, active: boolean }> | No | Callback used to return the result.
**iface**: NIC name.
**active**: whether the NIC is active. The value **true** indicates that the NIC is active, and the value **false** indicates the opposite.|
+| callback | AsyncCallback\<{ iface: string, active: boolean }> | No | Callback used to return the result.
**iface**: NIC name.
**active**: whether the NIC is active. The value **true** indicates that the NIC is active, and the value **false** indicates the opposite.|
**Error codes**
| ID| Error Message |
| ------- | -------------------------------------------- |
-| 201 | Permission denied. |
-| 202 | Applicable only to system applications. |
-| 401 | Parameter error. |
+| 202 | Non-system applications use system APIs. |
**Example**
@@ -454,7 +460,7 @@ Unregisters the observer for NIC hot swap events. This API uses an asynchronous
ethernet.off('interfaceStateChange');
```
-## InterfaceConfiguration
+## InterfaceConfiguration9+
Defines the network configuration for the Ethernet connection.
@@ -471,7 +477,7 @@ Defines the network configuration for the Ethernet connection.
| netMask | string | Yes| Subnet mask of the Ethernet connection. The value must be an IPv4 address, which is a 32-bit number displayed in dotted decimal notation and each 8-bit field ranges from 0 to 255. This parameter does not need to be configured in DHCP mode.|
| dnsServers | string | Yes| DNS server addresses of the Ethernet connection. The value must be an IPv4 address. This parameter does not need to be configured in DHCP mode. Multiple addresses are separated by commas (,).|
-## IPSetMode
+## IPSetMode9+
Defines the configuration mode of the Ethernet connection.
diff --git a/en/application-dev/reference/apis/js-apis-net-mdns.md b/en/application-dev/reference/apis/js-apis-net-mdns.md
index 2190dbe59ceca1336096944b8203826263c5294e..c84b3ae6dce748f686f50f001fa18fd13b78049d 100644
--- a/en/application-dev/reference/apis/js-apis-net-mdns.md
+++ b/en/application-dev/reference/apis/js-apis-net-mdns.md
@@ -11,7 +11,7 @@ Multicast DNS (mDNS) provides functions such as adding, removing, discovering, a
import mdns from '@ohos.net.mdns'
```
-## mdns.addLocalService
+## mdns.addLocalService10+
addLocalService(context: Context, serviceInfo: LocalServiceInfo, callback: AsyncCallback\): void
@@ -100,7 +100,7 @@ mdns.addLocalService(context, localServiceInfo, function (error, data) {
});
```
-## mdns.addLocalService
+## mdns.addLocalService10+
addLocalService(context: Context, serviceInfo: LocalServiceInfo): Promise\
@@ -192,7 +192,7 @@ mdns.addLocalService(context, localServiceInfo).then(function (data) {
});
```
-## mdns.removeLocalService
+## mdns.removeLocalService10+
removeLocalService(context: Context, serviceInfo: LocalServiceInfo, callback: AsyncCallback\): void
@@ -216,7 +216,7 @@ Removes an mDNS service. This API uses an asynchronous callback to return the re
| 2100002 | Operation failed. Cannot connect to service. |
| 2100003 | System internal error. |
| 2204002 | Callback not found. |
-| 2204008 | Service instance duplicated. |
+| 2204008 | Service instance not found. |
| 2204010 | Send packet failed. |
> **NOTE**
@@ -281,7 +281,7 @@ mdns.removeLocalService(context, localServiceInfo, function (error, data) {
});
```
-## mdns.removeLocalService
+## mdns.removeLocalService10+
removeLocalService(context: Context, serviceInfo: LocalServiceInfo): Promise\
@@ -310,7 +310,7 @@ Removes an mDNS service. This API uses a promise to return the result.
| 2100002 | Operation failed. Cannot connect to service. |
| 2100003 | System internal error. |
| 2204002 | Callback not found. |
-| 2204008 | Service instance duplicated. |
+| 2204008 | Service instance not found. |
| 2204010 | Send packet failed. |
> **NOTE**
@@ -373,7 +373,7 @@ mdns.removeLocalService(context, localServiceInfo).then(function (data) {
});
```
-## mdns.createDiscoveryService
+## mdns.createDiscoveryService10+
createDiscoveryService(context: Context, serviceType: string): DiscoveryService
@@ -423,7 +423,7 @@ let serviceType = "_print._tcp";
let discoveryService = mdns.createDiscoveryService(context, serviceType);
```
-## mdns.resolveLocalService
+## mdns.resolveLocalService10+
resolveLocalService(context: Context, serviceInfo: LocalServiceInfo, callback: AsyncCallback\): void
@@ -512,7 +512,7 @@ mdns.resolveLocalService(context, localServiceInfo, function (error, data) {
});
```
-## mdns.resolveLocalService
+## mdns.resolveLocalService10+
resolveLocalService(context: Context, serviceInfo: LocalServiceInfo): Promise\
@@ -603,11 +603,11 @@ mdns.resolveLocalService(context, localServiceInfo).then(function (data) {
console.log(JSON.stringify(data));
});
```
-## DiscoveryService
+## DiscoveryService10+
Defines a **DiscoveryService** object for discovering mDNS services of the specified type.
-### startSearchingMDNS
+### startSearchingMDNS10+
startSearchingMDNS(): void
@@ -644,7 +644,7 @@ let discoveryService = mdns.createDiscoveryService(context, serviceType);
discoveryService.startSearchingMDNS();
```
-### stopSearchingMDNS
+### stopSearchingMDNS10+
stopSearchingMDNS(): void
@@ -681,7 +681,7 @@ let discoveryService = mdns.createDiscoveryService(context, serviceType);
discoveryService.stopSearchingMDNS();
```
-### on('discoveryStart')
+### on('discoveryStart')10+
on(type: 'discoveryStart', callback: Callback<{serviceInfo: LocalServiceInfo, errorCode?: MdnsError}>): void
@@ -710,7 +710,7 @@ discoveryService.on('discoveryStart', (data) => {
discoveryService.stopSearchingMDNS();
```
-### on('discoveryStop')
+### on('discoveryStop')10+
on(type: 'discoveryStop', callback: Callback<{serviceInfo: LocalServiceInfo, errorCode?: MdnsError}>): void
@@ -739,7 +739,7 @@ discoveryService.on('discoveryStop', (data) => {
discoveryService.stopSearchingMDNS();
```
-### on('serviceFound')
+### on('serviceFound')10+
on(type: 'serviceFound', callback: Callback\): void
@@ -768,7 +768,7 @@ discoveryService.on('serviceFound', (data) => {
discoveryService.stopSearchingMDNS();
```
-### on('serviceLost')
+### on('serviceLost')10+
on(type: 'serviceLost', callback: Callback\): void
@@ -797,7 +797,7 @@ discoveryService.on('serviceLost', (data) => {
discoveryService.stopSearchingMDNS();
```
-## LocalServiceInfo
+## LocalServiceInfo10+
Defines the mDNS service information.
@@ -811,7 +811,7 @@ Defines the mDNS service information.
| host | [NetAddress](js-apis-net-connection.md#netaddress) | No| IP address of the device that provides the mDNS service. The IP address is not effective when an mDNS service is added or removed. |
| serviceAttribute | serviceAttribute\<[ServiceAttribute](#serviceattribute)> | No| mDNS service attribute information. |
-## ServiceAttribute
+## ServiceAttribute10+
Defines the mDNS service attribute information.
diff --git a/en/application-dev/reference/apis/js-apis-net-sharing.md b/en/application-dev/reference/apis/js-apis-net-sharing.md
index 0cda70aa2939c0da8f5aec7875d75bb48d309120..49796b225c56a3ff08a1ae51e986d4860b3edb77 100644
--- a/en/application-dev/reference/apis/js-apis-net-sharing.md
+++ b/en/application-dev/reference/apis/js-apis-net-sharing.md
@@ -12,7 +12,7 @@ The **sharing** module allows you to share your device's Internet connection wit
import sharing from '@ohos.net.sharing'
```
-## sharing.isSharingSupported
+## sharing.isSharingSupported9+
isSharingSupported(callback: AsyncCallback\): void
@@ -48,7 +48,7 @@ sharing.isSharingSupported((error, data) => {
});
```
-## sharing.isSharingSupported
+## sharing.isSharingSupported9+
isSharingSupported(): Promise\
@@ -85,7 +85,7 @@ sharing.isSharingSupported().then(data => {
});
```
-## sharing.isSharing
+## sharing.isSharing9+
isSharing(callback: AsyncCallback\): void
@@ -108,8 +108,10 @@ Checks whether network sharing is in progress. This API uses an asynchronous cal
| ID| Error Message |
| ------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 2200002 | Operation failed. Cannot connect to service. |
| 2200003 | System internal error. |
+| 2202011 | Cannot get network sharing configuration. |
**Example**
@@ -120,7 +122,7 @@ sharing.isSharing((error, data) => {
});
```
-## sharing.isSharing
+## sharing.isSharing9+
isSharing(): Promise\
@@ -143,8 +145,10 @@ Checks whether network sharing is in progress. This API uses a promise to return
| ID| Error Message |
| ------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 2200002 | Operation failed. Cannot connect to service. |
| 2200003 | System internal error. |
+| 2202011 | Cannot get network sharing configuration. |
**Example**
@@ -156,7 +160,7 @@ sharing.isSharing().then(data => {
});
```
-## sharing.startSharing
+## sharing.startSharing9+
startSharing(type: SharingIfaceType, callback: AsyncCallback\): void
@@ -201,7 +205,7 @@ sharing.startSharing(SHARING_WIFI, (error) => {
});
```
-## sharing.startSharing
+## sharing.startSharing9+
startSharing(type: SharingIfaceType): Promise\
@@ -253,7 +257,7 @@ sharing.startSharing(SHARING_WIFI).then(() => {
});
```
-## sharing.stopSharing
+## sharing.stopSharing9+
stopSharing(type: SharingIfaceType, callback: AsyncCallback\): void
@@ -277,10 +281,12 @@ Stops network sharing of a specified type. This API uses an asynchronous callbac
| ID| Error Message |
| ------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service. |
| 2200003 | System internal error. |
+| 2202004 | Try to share an unavailable iface. |
| 2202005 | WiFi sharing failed. |
| 2202006 | Bluetooth sharing failed. |
| 2202011 | Cannot get network sharing configuration. |
@@ -296,7 +302,7 @@ sharing.stopSharing(SHARING_WIFI, (error) => {
});
```
-## sharing.stopSharing
+## sharing.stopSharing9+
stopSharing(type: SharingIfaceType): Promise\
@@ -325,10 +331,12 @@ Stops network sharing of a specified type. This API uses a promise to return the
| ID| Error Message |
| ------- | -------------------------------------------- |
| 201 | Permission denied. |
+| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200001 | Invalid parameter value. |
| 2200002 | Operation failed. Cannot connect to service. |
| 2200003 | System internal error. |
+| 2202004 | Try to share an unavailable iface. |
| 2202005 | WiFi sharing failed. |
| 2202006 | Bluetooth sharing failed. |
| 2202011 | Cannot get network sharing configuration. |
@@ -346,7 +354,7 @@ sharing.stopSharing(SHARING_WIFI).then(() => {
});
```
-## sharing.getStatsRxBytes
+## sharing.getStatsRxBytes9+
getStatsRxBytes(callback: AsyncCallback\): void
@@ -381,7 +389,7 @@ sharing.getStatsRxBytes((error, data) => {
});
```
-## sharing.getStatsRxBytes
+## sharing.getStatsRxBytes9+
getStatsRxBytes(): Promise\
@@ -417,7 +425,7 @@ sharing.getStatsRxBytes().then(data => {
});
```
-## sharing.getStatsTxBytes
+## sharing.getStatsTxBytes9+
getStatsTxBytes(callback: AsyncCallback\): void
@@ -452,7 +460,7 @@ sharing.getStatsTxBytes((error, data) => {
});
```
-## sharing.getStatsTxBytes
+## sharing.getStatsTxBytes