提交 8e8fb729 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 12741510
# DFX # DFX
- Application Event Logging - [Development of Application Event Logging](hiappevent-guidelines.md)
- [Development of Application Event Logging](hiappevent-guidelines.md) - [Development of Performance Tracing](hitracemeter-guidelines.md)
- Performance Tracing - [Development of Distributed Call Chain Tracing](hitracechain-guidelines.md)
- [Development of Performance Tracing](hitracemeter-guidelines.md)
- Distributed Call Chain Tracing
- [Development of Distributed Call Chain Tracing](hitracechain-guidelines.md)
- Error Management - Error Management
- [Development of Error Manager](errormanager-guidelines.md) - [Development of Error Manager](errormanager-guidelines.md)
- [Development of Application Recovery](apprecovery-guidelines.md) - [Development of Application Recovery](apprecovery-guidelines.md)
\ No newline at end of file
...@@ -4,32 +4,32 @@ The **call** module provides call management functions, including making calls, ...@@ -4,32 +4,32 @@ The **call** module provides call management functions, including making calls,
To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange). To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange).
>**NOTE**<br> >**NOTE**
>
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. >The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
```js ```js
import call from '@ohos.telephony.call'; import call from '@ohos.telephony.call';
``` ```
## call.dial ## call.dial<sup>(deprecated)</sup>
dial\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void dial\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void
Initiates a call. This API uses an asynchronous callback to return the result. Initiates a call. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.PLACE\_CALL (a system permission) **Required Permissions**: ohos.permission.PLACE_CALL
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | -------------------------------- | | ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|
**Example** **Example**
...@@ -40,23 +40,23 @@ call.dial("138xxxxxxxx", (err, data) => { ...@@ -40,23 +40,23 @@ call.dial("138xxxxxxxx", (err, data) => {
``` ```
## call.dial ## call.dial<sup>(deprecated)</sup>
dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback<boolean\>\): void dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback<boolean\>\): void
Initiates a call based on the specified options. This API uses an asynchronous callback to return the result. Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.PLACE\_CALL (a system permission) **Required Permissions**: ohos.permission.PLACE_CALL
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- | | ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [DialOptions](#dialoptions) | No | Call option, which indicates whether the call is a voice call or video call. | | options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|
**Example** **Example**
...@@ -69,28 +69,28 @@ call.dial("138xxxxxxxx", { ...@@ -69,28 +69,28 @@ call.dial("138xxxxxxxx", {
``` ```
## call.dial ## call.dial<sup>(deprecated)</sup>
dial\(phoneNumber: string, options?: DialOptions\): Promise<boolean\> dial\(phoneNumber: string, options?: DialOptions\): Promise<boolean\>
Initiates a call based on the specified options. This API uses a promise to return the result. Initiates a call. You can set call options as needed. This API uses a promise to return the result.
**Required permission**: ohos.permission.PLACE\_CALL (a system permission) **Required Permissions**: ohos.permission.PLACE_CALL
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | -------------------------------------- | | ----------- | --------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. | | options | [DialOptions](#dialoptions) | No | Call option, which indicates whether the call is a voice call or video call.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------- | ---------------------------------------------------------------- | | ---------------------- | ------------------------------------------------------------ |
| Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure | | Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure|
**Example** **Example**
...@@ -105,6 +105,142 @@ promise.then(data => { ...@@ -105,6 +105,142 @@ promise.then(data => {
}); });
``` ```
## call.dialCall<sup>9+</sup>
dialCall\(phoneNumber: string, callback: AsyncCallback<void\>\): void
Initiates a call. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required Permissions**: ohos.permission.PLACE_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
call.dialCall("138xxxxxxxx", (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.dialCall<sup>9+</sup>
dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback<void\>\): void
Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required Permissions**: ohos.permission.PLACE_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ----------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. |
| options | [DialCallOptions](#dialcalloptions9)| Yes | Call options, which carry other configuration information of the call. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
call.dialCall("138xxxxxxxx", {
accountId: 0,
videoState: 0,
dialScene: 0,
dialType: 0,
}, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.dialCall<sup>9+</sup>
dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise<void\>
Initiates a call. You can set call options as needed. This API uses a promise to return the result.
**System API**: This is a system API.
**Required Permissions**: ohos.permission.PLACE_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ----------------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
| options | [DialCallOptions](#dialcalloptions9)| No | Call option, which indicates whether the call is a voice call or video call.|
**Return value**
| Type | Description |
| ---------------------- | ------------------------------------------------------------ |
| Promise&lt;void&gt; | Promise used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js
try {
call.dialCall('138xxxxxxxx');
console.log(`dialCall success, promise: data->${JSON.stringify(data)}`);
} catch (error) {
console.log(`dialCall fail, promise: err->${JSON.stringify(error)}`);
}
```
## call.makeCall<sup>7+</sup> ## call.makeCall<sup>7+</sup>
makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void
...@@ -115,16 +251,27 @@ Launches the call screen and displays the dialed number. This API uses an asynch ...@@ -115,16 +251,27 @@ Launches the call screen and displays the dialed number. This API uses an asynch
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------- | ---- | ------------------------------------------ | | ----------- | ------------------------- | ---- | ------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.makeCall("138xxxxxxxx", err => { call.makeCall("138xxxxxxxx", err => {
console.log(`makeCall callback: err->${JSON.stringify(err)}`); console.log(`makeCall callback: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -139,24 +286,35 @@ Launches the call screen and displays the dialed number. This API uses a promise ...@@ -139,24 +286,35 @@ Launches the call screen and displays the dialed number. This API uses a promise
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------- | | ----------- | ------ | ---- | ---------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | --------------------------------- | | ------------------- | --------------------------------- |
| Promise&lt;void&gt; | Promise used to return the result. | | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let promise = call.makeCall("138xxxxxxxx"); let promise = call.makeCall("138xxxxxxxx");
promise.then(() => { promise.then(() => {
console.log(`makeCall success`); console.log(`makeCall success`);
}).catch(err => { }).catch(err => {
console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`); console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -170,9 +328,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to ...@@ -170,9 +328,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress.|
**Example** **Example**
...@@ -195,7 +353,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu ...@@ -195,7 +353,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu
| Type | Description | | Type | Description |
| ---------------------- | --------------------------------------- | | ---------------------- | --------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result. | | Promise&lt;boolean&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -219,9 +377,9 @@ Obtains the call status. This API uses an asynchronous callback to return the re ...@@ -219,9 +377,9 @@ Obtains the call status. This API uses an asynchronous callback to return the re
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------------- | ---- | ------------------------------------ | | -------- | -------------------------------------------- | ---- | ------------------------------------ |
| callback | AsyncCallback&lt;[CallState](#callstate)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[CallState](#callstate)&gt; | Yes | Callback used to return the result.|
**Example** **Example**
...@@ -244,7 +402,7 @@ Obtains the call status. This API uses a promise to return the result. ...@@ -244,7 +402,7 @@ Obtains the call status. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| -------------------------------------- | --------------------------------------- | | -------------------------------------- | --------------------------------------- |
| Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result. | | Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -269,7 +427,7 @@ Checks whether a device supports voice calls. ...@@ -269,7 +427,7 @@ Checks whether a device supports voice calls.
| Type | Description | | Type | Description |
| ------- | ------------------------------------------------------------ | | ------- | ------------------------------------------------------------ |
| boolean | - **true**: The device supports voice calls.<br>- **false**: The device does not support voice calls. | | boolean | - **true**: The device supports voice calls.<br>- **false**: The device does not support voice calls.|
```js ```js
let result = call.hasVoiceCapability(); let result = call.hasVoiceCapability();
...@@ -286,10 +444,21 @@ Checks whether the called number is an emergency number. This API uses an asynch ...@@ -286,10 +444,21 @@ Checks whether the called number is an emergency number. This API uses an asynch
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -304,17 +473,28 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => { ...@@ -304,17 +473,28 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback<boolean\>\): void isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback<boolean\>\): void
Checks whether the called number is an emergency number based on the specified phone number options. This API uses an asynchronous callback to return the result. Checks whether the called number is an emergency number based on the phone number. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------------- | ---- | -------------------------------------------- | | ----------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | No | Phone number options. | | options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -329,22 +509,33 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => { ...@@ -329,22 +509,33 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => {
isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise<boolean\> isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise<boolean\>
Checks whether the called number is an emergency number based on the specified phone number options. This API uses a promise to return the result. Checks whether the called number is an emergency number based on the phone number. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------------- | ---- | -------------- | | ----------- | -------------------------------------------------- | ---- | -------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number options. | | options | [EmergencyNumberOptions](#emergencynumberoptions7) | No | Phone number.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------- | --------------------------------------------------- | | ---------------------- | --------------------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result. | | Promise&lt;boolean&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -369,10 +560,21 @@ A formatted phone number is a standard numeric string, for example, 555 0100. ...@@ -369,10 +560,21 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ------------------------------------ | | ----------- | --------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -386,7 +588,7 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => { ...@@ -386,7 +588,7 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback<string\>\): void formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback<string\>\): void
Formats a phone number based on the specified formatting options. This API uses an asynchronous callback to return the result. Formats a phone number based on specified formatting options. This API uses an asynchronous callback to return the result.
A formatted phone number is a standard numeric string, for example, 555 0100. A formatted phone number is a standard numeric string, for example, 555 0100.
...@@ -394,11 +596,22 @@ A formatted phone number is a standard numeric string, for example, 555 0100. ...@@ -394,11 +596,22 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------- | ---- | ------------------------------------ | | ----------- | -------------------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [NumberFormatOptions](#numberformatoptions7) | No | Number formatting options, for example, country code. | | options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting options, for example, country code. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -415,7 +628,7 @@ call.formatPhoneNumber("138xxxxxxxx", { ...@@ -415,7 +628,7 @@ call.formatPhoneNumber("138xxxxxxxx", {
formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise<string\> formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise<string\>
Formats a phone number based on the specified formatting options. This API uses a promise to return the result. Formats a phone number based on specified formatting options. This API uses a promise to return the result.
A formatted phone number is a standard numeric string, for example, 555 0100. A formatted phone number is a standard numeric string, for example, 555 0100.
...@@ -423,16 +636,27 @@ A formatted phone number is a standard numeric string, for example, 555 0100. ...@@ -423,16 +636,27 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------- | ---- | ---------------------- | | ----------- | -------------------------------------------- | ---- | ---------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting options, for example, country code. | | options | [NumberFormatOptions](#numberformatoptions7) | No | Number formatting options, for example, country code.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------- | | --------------------- | ------------------------------------------- |
| Promise&lt;string&gt; | Promise used to return the result. | | Promise&lt;string&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -459,11 +683,22 @@ The phone number must match the specified country code. For example, for a China ...@@ -459,11 +683,22 @@ The phone number must match the specified country code. For example, for a China
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ----------------------------------------------------- | | ----------- | --------------------------- | ---- | ----------------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -488,16 +723,27 @@ All country codes are supported. ...@@ -488,16 +723,27 @@ All country codes are supported.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------------------------------------- | | ----------- | ------ | ---- | ---------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------------------------ | | --------------------- | ------------------------------------------------------------ |
| Promise&lt;string&gt; | Promise used to return the result. | | Promise&lt;string&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -514,9 +760,9 @@ promise.then(data => { ...@@ -514,9 +760,9 @@ promise.then(data => {
muteRinger\(callback: AsyncCallback<void\>\): void muteRinger\(callback: AsyncCallback<void\>\): void
Mutes the ringtone while it is playing. This API uses an asynchronous callback to return the result. 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.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -528,6 +774,17 @@ This is a system API. ...@@ -528,6 +774,17 @@ This is a system API.
| ----------- | ------------------------- | ---- | ---------- | | ----------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -541,9 +798,9 @@ call.muteRinger((err, data) => { ...@@ -541,9 +798,9 @@ call.muteRinger((err, data) => {
muteRinger\(\): Promise<void\> muteRinger\(\): Promise<void\>
Mutes the ringtone while it is playing. This API uses a promise to return the result. 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.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -555,6 +812,18 @@ This is a system API. ...@@ -555,6 +812,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -566,13 +835,14 @@ promise.then(data => { ...@@ -566,13 +835,14 @@ promise.then(data => {
}); });
``` ```
## call.answer<sup>7+</sup>
answer\(callId: number, callback: AsyncCallback<void\>\): void ## call.answerCall<sup>7+</sup>
answerCall\(callId: number, callback: AsyncCallback<void\>\): void
Answers a call based on the specified call ID. This API uses an asynchronous callback to return the result. Answers a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -585,22 +855,34 @@ This is a system API. ...@@ -585,22 +855,34 @@ This is a system API.
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| | callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.answer(1, (err, data) => { call.answerCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.answer<sup>7+</sup> ## call.answerCall<sup>7+</sup>
answer(callId?: number\): Promise<void\> answerCall(callId?: number\): Promise<void\>
Answers a call based on the specified call ID. This API uses a promise to return the result. Answers a call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -618,24 +900,37 @@ This is a system API. ...@@ -618,24 +900,37 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let promise = call.answer(1); let promise = call.answerCall(1);
promise.then(data => { promise.then(data => {
console.log(`answer success, promise: data->${JSON.stringify(data)}`); console.log(`answerCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`answer fail, promise: err->${JSON.stringify(err)}`); console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
## call.hangup<sup>7+</sup>
hangup\(callId: number, callback: AsyncCallback<void\>\): void ## call.answerCall<sup>9+</sup>
Ends a call. This API uses an asynchronous callback to return the result. answerCall\(callback: AsyncCallback<void\>\): void
Answers a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -645,25 +940,36 @@ This is a system API. ...@@ -645,25 +940,36 @@ This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.hangup(1, (err, data) => { call.answerCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.answer<sup>9+</sup> ## call.hangUpCall<sup>7+</sup>
answer\(callback: AsyncCallback<void\>\): void hangUpCall\(callId: number, callback: AsyncCallback<void\>\): void
Answers a call.This API uses an asynchronous callback to return the result. Ends a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -673,24 +979,37 @@ This is a system API. ...@@ -673,24 +979,37 @@ This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ----------------------------------------------- | | -------- | ------------------------- | ---- | ----------------------------------------------- |
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.answer((err, data) => { call.hangUpCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.hangup<sup>7+</sup> ## call.hangUpCall<sup>7+</sup>
hangup\(callId?: number\): Promise<void\> hangUpCall\(callId?: number\): Promise<void\>
Ends a call based on the specified call ID. This API uses a promise to return the result. Ends a call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -708,24 +1027,37 @@ This is a system API. ...@@ -708,24 +1027,37 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let promise = call.hangup(1); let promise = call.hangUpCall(1);
promise.then(data => { promise.then(data => {
console.log(`hangup success, promise: data->${JSON.stringify(data)}`); console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`hangup fail, promise: err->${JSON.stringify(err)}`); console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
## call.hangup<sup>9+</sup>
hangup\(callback: AsyncCallback<void\>\): void ## call.hangUpCall<sup>9+</sup>
hangUpCall\(callback: AsyncCallback<void\>\): void
Ends a call. This API uses an asynchronous callback to return the result. Ends a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -737,22 +1069,35 @@ This is a system API. ...@@ -737,22 +1069,35 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.hangup((err, data) => { call.hangUpCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.reject<sup>7+</sup> ## call.rejectCall<sup>7+</sup>
reject(callId: number, callback: AsyncCallback\<void>): void rejectCall(callId: number, callback: AsyncCallback\<void>): void
Rejects a call based on the specified call ID. This API uses an asynchronous callback to return the result. Rejects a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -765,22 +1110,35 @@ This is a system API. ...@@ -765,22 +1110,35 @@ This is a system API.
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.| | callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.reject(1, (err, data) => { call.rejectCall(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.reject<sup>7+</sup>
reject\(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void\>\): void ## call.rejectCall<sup>7+</sup>
rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
Rejects a call based on the specified call ID and options. This API uses an asynchronous callback to return the result. Rejects a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -794,25 +1152,37 @@ This is a system API. ...@@ -794,25 +1152,37 @@ This is a system API.
| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message. | | options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let rejectMessageOptions={ let rejectMessageOptions={
messageContent: "Unknown number blocked" messageContent: "Unknown number blocked"
} }
call.reject(1, rejectMessageOptions, (err, data) => { call.rejectCall(1, rejectMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.reject<sup>7+</sup> ## call.rejectCall<sup>7+</sup>
reject(callId?: number, options?: RejectMessageOptions\): Promise<void\> rejectCall(callId?: number, options?: RejectMessageOptions\): Promise<void\>
Rejects a call based on the specified call ID and options. This API uses a promise to return the result. Rejects a call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -831,28 +1201,40 @@ This is a system API. ...@@ -831,28 +1201,40 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let rejectMessageOptions={ let rejectMessageOptions={
messageContent: "Unknown number blocked" messageContent: "Unknown number blocked"
} }
let promise = call.reject(1, rejectMessageOptions); let promise = call.rejectCall(1, rejectMessageOptions);
promise.then(data => { promise.then(data => {
console.log(`reject success, promise: data->${JSON.stringify(data)}`); console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`reject fail, promise: err->${JSON.stringify(err)}`); console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
## call.reject<sup>9+</sup> ## call.rejectCall<sup>9+</sup>
reject\(callback: AsyncCallback<void\>\): void rejectCall\(callback: AsyncCallback<void\>\): void
Rejects a call. This API uses an asynchronous callback to return the result. Rejects a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -864,22 +1246,34 @@ This is a system API. ...@@ -864,22 +1246,34 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example:** **Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js ```js
call.reject((err, data) => { call.rejectCall((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
## call.reject<sup>9+</sup> ## call.rejectCall<sup>9+</sup>
reject\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void rejectCall\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
Rejects a call. This API uses an asynchronous callback to return the result. Rejects a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -892,13 +1286,25 @@ This is a system API. ...@@ -892,13 +1286,25 @@ This is a system API.
| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message.| | options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example:** **Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example**
```js ```js
let rejectMessageOptions={ let rejectMessageOptions={
messageContent: "Unknown number blocked" messageContent: "Unknown number blocked"
} }
call.reject(rejectMessageOptions, (err, data) => { call.rejectCall(rejectMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
...@@ -910,7 +1316,7 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -910,7 +1316,7 @@ holdCall\(callId: number, callback: AsyncCallback<void\>\): void
Holds a call based on the specified call ID. This API uses an asynchronous callback to return the result. Holds a call based on the specified call ID. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -923,6 +1329,18 @@ This is a system API. ...@@ -923,6 +1329,18 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -938,7 +1356,7 @@ holdCall\(callId: number\): Promise<void\> ...@@ -938,7 +1356,7 @@ holdCall\(callId: number\): Promise<void\>
Holds a call based on the specified call ID. This API uses a promise to return the result. Holds a call based on the specified call ID. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -956,6 +1374,18 @@ This is a system API. ...@@ -956,6 +1374,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -973,7 +1403,7 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -973,7 +1403,7 @@ unHoldCall\(callId: number, callback: AsyncCallback<void\>\): void
Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result. Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -986,6 +1416,18 @@ This is a system API. ...@@ -986,6 +1416,18 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1001,7 +1443,7 @@ unHoldCall\(callId: number\): Promise<void\> ...@@ -1001,7 +1443,7 @@ unHoldCall\(callId: number\): Promise<void\>
Unholds a call based on the specified call ID. This API uses a promise to return the result. Unholds a call based on the specified call ID. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -1019,6 +1461,18 @@ This is a system API. ...@@ -1019,6 +1461,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1036,7 +1490,7 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1036,7 +1490,7 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void
Switches a call. This API uses an asynchronous callback to return the result. Switches a call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -1049,6 +1503,18 @@ This is a system API. ...@@ -1049,6 +1503,18 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1064,7 +1530,7 @@ switchCall\(callId: number\): Promise<void\> ...@@ -1064,7 +1530,7 @@ switchCall\(callId: number\): Promise<void\>
Switches a call. This API uses a promise to return the result. Switches a call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL **Required permission**: ohos.permission.ANSWER_CALL
...@@ -1082,6 +1548,18 @@ This is a system API. ...@@ -1082,6 +1548,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1099,7 +1577,7 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1099,7 +1577,7 @@ combineConference\(callId: number, callback: AsyncCallback<void\>\): void
Combines two calls into a conference call. This API uses an asynchronous callback to return the result. Combines two calls into a conference call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1110,6 +1588,17 @@ This is a system API. ...@@ -1110,6 +1588,17 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1125,7 +1614,7 @@ combineConference\(callId: number\): Promise<void\> ...@@ -1125,7 +1614,7 @@ combineConference\(callId: number\): Promise<void\>
Combines two calls into a conference call. This API uses a promise to return the result. Combines two calls into a conference call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1141,6 +1630,17 @@ This is a system API. ...@@ -1141,6 +1630,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1158,7 +1658,7 @@ getMainCallId\(callId: number, callback: AsyncCallback<number\>\): void ...@@ -1158,7 +1658,7 @@ getMainCallId\(callId: number, callback: AsyncCallback<number\>\): void
Obtains the main call ID. This API uses an asynchronous callback to return the result. Obtains the main call ID. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1169,6 +1669,18 @@ This is a system API. ...@@ -1169,6 +1669,18 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1184,7 +1696,7 @@ getMainCallId\(callId: number\): Promise<number\> ...@@ -1184,7 +1696,7 @@ getMainCallId\(callId: number\): Promise<number\>
Obtains the main call ID. This API uses a promise to return the result. Obtains the main call ID. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1200,6 +1712,17 @@ This is a system API. ...@@ -1200,6 +1712,17 @@ This is a system API.
| ------------------- | ------------------------------- | | ------------------- | ------------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1217,7 +1740,7 @@ getSubCallIdList\(callId: number, callback: AsyncCallback<Array<string\>\>\): vo ...@@ -1217,7 +1740,7 @@ getSubCallIdList\(callId: number, callback: AsyncCallback<Array<string\>\>\): vo
Obtains the list of subcall IDs. This API uses an asynchronous callback to return the result. Obtains the list of subcall IDs. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1228,6 +1751,17 @@ This is a system API. ...@@ -1228,6 +1751,17 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback<Array<string\>\> | Yes | Callback used to return the result. | | callback | AsyncCallback<Array<string\>\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1243,7 +1777,7 @@ getSubCallIdList\(callId: number\): Promise<Array<string\>\> ...@@ -1243,7 +1777,7 @@ getSubCallIdList\(callId: number\): Promise<Array<string\>\>
Obtains the list of subcall IDs. This API uses a promise to return the result. Obtains the list of subcall IDs. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1259,6 +1793,17 @@ This is a system API. ...@@ -1259,6 +1793,17 @@ This is a system API.
| ----------------------------- | ----------------------------------- | | ----------------------------- | ----------------------------------- |
| Promise&lt;Array<string\>&gt; | Promise used to return the result.| | Promise&lt;Array<string\>&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1276,7 +1821,7 @@ getCallIdListForConference\(callId: number, callback: AsyncCallback<Array<string ...@@ -1276,7 +1821,7 @@ getCallIdListForConference\(callId: number, callback: AsyncCallback<Array<string
Obtains the list of call IDs in a conference. This API uses an asynchronous callback to return the result. Obtains the list of call IDs in a conference. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1287,6 +1832,17 @@ This is a system API. ...@@ -1287,6 +1832,17 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;Array<string\>&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;Array<string\>&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1302,7 +1858,7 @@ getCallIdListForConference\(callId: number\): Promise<Array<string\>\> ...@@ -1302,7 +1858,7 @@ getCallIdListForConference\(callId: number\): Promise<Array<string\>\>
Obtains the list of call IDs in a conference. This API uses a promise to return the result. Obtains the list of call IDs in a conference. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1318,6 +1874,17 @@ This is a system API. ...@@ -1318,6 +1874,17 @@ This is a system API.
| ----------------------------- | --------------------------------------- | | ----------------------------- | --------------------------------------- |
| Promise&lt;Array<string\>&gt; | Promise used to return the result.| | Promise&lt;Array<string\>&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1335,7 +1902,7 @@ getCallWaitingStatus\(slotId: number, callback: AsyncCallback<CallWaitingStatus\ ...@@ -1335,7 +1902,7 @@ getCallWaitingStatus\(slotId: number, callback: AsyncCallback<CallWaitingStatus\
Obtains the call waiting status. This API uses an asynchronous callback to return the result. Obtains the call waiting status. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE **Required permission**: ohos.permission.GET_TELEPHONY_STATE
...@@ -1345,8 +1912,20 @@ This is a system API. ...@@ -1345,8 +1912,20 @@ This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.| | callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br> <br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -1363,7 +1942,7 @@ getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\> ...@@ -1363,7 +1942,7 @@ getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\>
Obtains the call waiting status. This API uses a promise to return the result. Obtains the call waiting status. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE **Required permission**: ohos.permission.GET_TELEPHONY_STATE
...@@ -1381,6 +1960,18 @@ This is a system API. ...@@ -1381,6 +1960,18 @@ This is a system API.
| ------------------------------------------------------- | ------------------------------------------------------------ | | ------------------------------------------------------- | ------------------------------------------------------------ |
| Promise&lt;[CallWaitingStatus](#callwaitingstatus7)&gt; | Promise used to return the result.<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.| | Promise&lt;[CallWaitingStatus](#callwaitingstatus7)&gt; | Promise used to return the result.<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1398,7 +1989,7 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\ ...@@ -1398,7 +1989,7 @@ setCallWaiting\(slotId: number, activate: boolean, callback: AsyncCallback<void\
Sets the call waiting switch. This API uses an asynchronous callback to return the result. Sets the call waiting switch. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1412,6 +2003,18 @@ This is a system API. ...@@ -1412,6 +2003,18 @@ This is a system API.
| activate | boolean | Yes | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.| | activate | boolean | Yes | Whether to enable call waiting.<br>- **false**: Disable call waiting.<br>- **true**: Enable call waiting.|
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1427,7 +2030,7 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\> ...@@ -1427,7 +2030,7 @@ setCallWaiting\(slotId: number, activate: boolean\): Promise<void\>
Sets the call waiting switch. This API uses a promise to return the result. Sets the call waiting switch. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1446,6 +2049,18 @@ This is a system API. ...@@ -1446,6 +2049,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1461,9 +2076,9 @@ promise.then(data => { ...@@ -1461,9 +2076,9 @@ promise.then(data => {
startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\): void startDTMF\(callId: number, character: string, callback: AsyncCallback<void\>\): void
Enables dual-tone multifrequency (DTMF). This API uses an asynchronous callback to return the result. Enables DTMF. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1475,6 +2090,17 @@ This is a system API. ...@@ -1475,6 +2090,17 @@ This is a system API.
| character | string | Yes | DTMF code. | | character | string | Yes | DTMF code. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1490,7 +2116,7 @@ startDTMF\(callId: number, character: string\): Promise<void\> ...@@ -1490,7 +2116,7 @@ startDTMF\(callId: number, character: string\): Promise<void\>
Enables DTMF. This API uses a promise to return the result. Enables DTMF. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1507,6 +2133,17 @@ This is a system API. ...@@ -1507,6 +2133,17 @@ This is a system API.
| ------------------- | ----------------------- | | ------------------- | ----------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1524,7 +2161,7 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void ...@@ -1524,7 +2161,7 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void
Stops DTMF. This API uses an asynchronous callback to return the result. Stops DTMF. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1535,6 +2172,17 @@ This is a system API. ...@@ -1535,6 +2172,17 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1550,7 +2198,7 @@ stopDTMF\(callId: number\): Promise<void\> ...@@ -1550,7 +2198,7 @@ stopDTMF\(callId: number\): Promise<void\>
Stops DTMF. This API uses a promise to return the result. Stops DTMF. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1566,6 +2214,17 @@ This is a system API. ...@@ -1566,6 +2214,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1583,7 +2242,7 @@ isInEmergencyCall\(callback: AsyncCallback<boolean\>\): void ...@@ -1583,7 +2242,7 @@ isInEmergencyCall\(callback: AsyncCallback<boolean\>\): void
Checks whether a call is an emergency call. This API uses an asynchronous callback to return the result. Checks whether a call is an emergency call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1595,6 +2254,18 @@ This is a system API. ...@@ -1595,6 +2254,18 @@ This is a system API.
| -------- | ---------------------------- | ---- | ---------- | | -------- | ---------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1610,7 +2281,7 @@ isInEmergencyCall\(\): Promise<boolean\> ...@@ -1610,7 +2281,7 @@ isInEmergencyCall\(\): Promise<boolean\>
Checks whether a call is an emergency call. This API uses a promise to return the result. Checks whether a call is an emergency call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1622,6 +2293,18 @@ This is a system API. ...@@ -1622,6 +2293,18 @@ This is a system API.
| ---------------------- | --------------------------- | | ---------------------- | --------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1639,7 +2322,7 @@ on\(type: 'callDetailsChange', callback: Callback<CallAttributeOptions\>\): void ...@@ -1639,7 +2322,7 @@ on\(type: 'callDetailsChange', callback: Callback<CallAttributeOptions\>\): void
Subscribes to **callDetailsChange** events. This API uses an asynchronous callback to return the result. Subscribes to **callDetailsChange** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1652,6 +2335,18 @@ This is a system API. ...@@ -1652,6 +2335,18 @@ This is a system API.
| type | string | Yes | Call details change during a call.| | type | string | Yes | Call details change during a call.|
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | Yes | Callback used to return the result. | | callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1666,7 +2361,7 @@ on\(type: 'callEventChange', callback: Callback<CallEventOptions\>\): void ...@@ -1666,7 +2361,7 @@ on\(type: 'callEventChange', callback: Callback<CallEventOptions\>\): void
Subscribes to **callEventChange** events. This API uses an asynchronous callback to return the result. Subscribes to **callEventChange** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1679,6 +2374,18 @@ This is a system API. ...@@ -1679,6 +2374,18 @@ This is a system API.
| type | string | Yes | Call event change during a call.| | type | string | Yes | Call event change during a call.|
| callback | Callback<[CallEventOptions](#calleventoptions8)> | Yes | Callback used to return the result. | | callback | Callback<[CallEventOptions](#calleventoptions8)> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1693,7 +2400,7 @@ on\(type: 'callDisconnectedCause', callback: Callback<DisconnectedDetails\>): vo ...@@ -1693,7 +2400,7 @@ on\(type: 'callDisconnectedCause', callback: Callback<DisconnectedDetails\>): vo
Subscribes to **callDisconnectedCause** events. This API uses an asynchronous callback to return the result. Subscribes to **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1706,6 +2413,18 @@ This is a system API. ...@@ -1706,6 +2413,18 @@ This is a system API.
| type | string | Yes | Cause of the call disconnection.| | type | string | Yes | Cause of the call disconnection.|
| callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | Yes | Callback used to return the result. | | callback | Callback<[DisconnectedDetails](#disconnecteddetails9)> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1720,7 +2439,7 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void ...@@ -1720,7 +2439,7 @@ on\(type: 'mmiCodeResult', callback: Callback<MmiCodeResults\>\): void
Subscribes to **mmiCodeResult** events. This API uses an asynchronous callback to return the result. Subscribes to **mmiCodeResult** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1733,6 +2452,18 @@ This is a system API. ...@@ -1733,6 +2452,18 @@ This is a system API.
| type | string | Yes | Man-machine interface (MMI) code result.| | type | string | Yes | Man-machine interface (MMI) code result.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | Yes | Callback used to return the result. | | callback | Callback<[MmiCodeResults](#mmicoderesults9)> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1747,7 +2478,7 @@ off\(type: 'callDetailsChange', callback?: Callback<CallAttributeOptions\>\): vo ...@@ -1747,7 +2478,7 @@ off\(type: 'callDetailsChange', callback?: Callback<CallAttributeOptions\>\): vo
Unsubscribes from **callDetailsChange** events. This API uses an asynchronous callback to return the result. Unsubscribes from **callDetailsChange** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1757,9 +2488,21 @@ This is a system API. ...@@ -1757,9 +2488,21 @@ This is a system API.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------------------------- | ---- | ---------------------------------- | | -------- | -------------------------------------------------------- | ---- | ---------------------------------- |
| type | string | Yes | Unsubscription from call details changes when a call ends.| | type | string | Yes | IMS registration status changes.|
| callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No | Callback used to return the result. | | callback | Callback<[CallAttributeOptions](#callattributeoptions7)> | No | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1774,7 +2517,7 @@ off\(type: 'callEventChange', callback?: Callback<CallEventOptions\>\): void ...@@ -1774,7 +2517,7 @@ off\(type: 'callEventChange', callback?: Callback<CallEventOptions\>\): void
Unsubscribes from **callEventChange** events. This API uses an asynchronous callback to return the result. Unsubscribes from **callEventChange** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1787,6 +2530,18 @@ This is a system API. ...@@ -1787,6 +2530,18 @@ This is a system API.
| type | string | Yes | Unsubscription from call event changes when a call ends.| | type | string | Yes | Unsubscription from call event changes when a call ends.|
| callback | Callback<[CallEventOptions](#calleventoptions8)> | No | Callback used to return the result. | | callback | Callback<[CallEventOptions](#calleventoptions8)> | No | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1801,7 +2556,7 @@ off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\): ...@@ -1801,7 +2556,7 @@ off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\):
Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronous callback to return the result. Unsubscribes from **callDisconnectedCause** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1814,6 +2569,18 @@ This is a system API. ...@@ -1814,6 +2569,18 @@ This is a system API.
| type | 'callDisconnectedCause' | Yes | Unsubscription from the call disconnection cause when a call ends.| | type | 'callDisconnectedCause' | Yes | Unsubscription from the call disconnection cause when a call ends.|
| callback | Callback**<**[DisconnectedDetails](#disconnecteddetails9)> | No | Callback used to return the result. | | callback | Callback**<**[DisconnectedDetails](#disconnecteddetails9)> | No | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1828,7 +2595,7 @@ off\(type: 'mmiCodeResult', callback?: Callback<MmiCodeResults\>\): void ...@@ -1828,7 +2595,7 @@ off\(type: 'mmiCodeResult', callback?: Callback<MmiCodeResults\>\): void
Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callback to return the result. Unsubscribes from **mmiCodeResult** events. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -1841,6 +2608,18 @@ This is a system API. ...@@ -1841,6 +2608,18 @@ This is a system API.
| type | 'mmiCodeResult' | Yes | MMI code result.| | type | 'mmiCodeResult' | Yes | MMI code result.|
| callback | Callback<[MmiCodeResults](#mmicoderesults9)> | No | Callback used to return the result. | | callback | Callback<[MmiCodeResults](#mmicoderesults9)> | No | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1855,7 +2634,7 @@ isNewCallAllowed\(callback: AsyncCallback<boolean\>\): void ...@@ -1855,7 +2634,7 @@ isNewCallAllowed\(callback: AsyncCallback<boolean\>\): void
Checks whether a new call is allowed. This API uses an asynchronous callback to return the result. Checks whether a new call is allowed. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1865,6 +2644,17 @@ This is a system API. ...@@ -1865,6 +2644,17 @@ This is a system API.
| -------- | ---------------------------- | ---- | ---------- | | -------- | ---------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1880,7 +2670,7 @@ isNewCallAllowed\(\): Promise<boolean\> ...@@ -1880,7 +2670,7 @@ isNewCallAllowed\(\): Promise<boolean\>
Checks whether a new call is allowed. This API uses a promise to return the result. Checks whether a new call is allowed. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1890,6 +2680,17 @@ This is a system API. ...@@ -1890,6 +2680,17 @@ This is a system API.
| ---------------------- | --------------------------- | | ---------------------- | --------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1905,9 +2706,9 @@ promise.then(data => { ...@@ -1905,9 +2706,9 @@ promise.then(data => {
separateConference\(callId: number, callback: AsyncCallback<void\>\): void separateConference\(callId: number, callback: AsyncCallback<void\>\): void
Separates a conference call. This API uses an asynchronous callback to return the result. Separates calls from a conference call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1918,6 +2719,17 @@ This is a system API. ...@@ -1918,6 +2719,17 @@ This is a system API.
| callId | number | Yes | Call ID. | | callId | number | Yes | Call ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1931,9 +2743,9 @@ call.separateConference(1, (err, data) => { ...@@ -1931,9 +2743,9 @@ call.separateConference(1, (err, data) => {
separateConference\(callId: number\): Promise<void\> separateConference\(callId: number\): Promise<void\>
Separates a conference call. This API uses a promise to return the result. Separates calls from a conference call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -1949,6 +2761,17 @@ This is a system API. ...@@ -1949,6 +2761,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1966,7 +2789,7 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: A ...@@ -1966,7 +2789,7 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType, callback: A
Obtains the call restriction status. This API uses an asynchronous callback to return the result. Obtains the call restriction status. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE **Required permission**: ohos.permission.GET_TELEPHONY_STATE
...@@ -1980,6 +2803,18 @@ This is a system API. ...@@ -1980,6 +2803,18 @@ This is a system API.
| type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type. | | type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type. |
| callback | AsyncCallback&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1995,7 +2830,7 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise<R ...@@ -1995,7 +2830,7 @@ getCallRestrictionStatus\(slotId: number, type: CallRestrictionType\): Promise<R
Obtains the call restriction status. This API uses a promise to return the result. Obtains the call restriction status. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE **Required permission**: ohos.permission.GET_TELEPHONY_STATE
...@@ -2014,6 +2849,18 @@ This is a system API. ...@@ -2014,6 +2849,18 @@ This is a system API.
| ------------------------------------------------------- | --------------------------- | | ------------------------------------------------------- | --------------------------- |
| Promise&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Promise used to return the result.| | Promise&lt;[RestrictionStatus](#restrictionstatus8)&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2031,7 +2878,7 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCa ...@@ -2031,7 +2878,7 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo, callback: AsyncCa
Sets the call restriction status. This API uses an asynchronous callback to return the result. Sets the call restriction status. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2045,6 +2892,18 @@ This is a system API. ...@@ -2045,6 +2892,18 @@ This is a system API.
| info | [CallRestrictionInfo](#callrestrictioninfo8) | Yes | Call restriction information. | | info | [CallRestrictionInfo](#callrestrictioninfo8) | Yes | Call restriction information. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2065,7 +2924,7 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise<void\> ...@@ -2065,7 +2924,7 @@ setCallRestriction\(slotId: number, info: CallRestrictionInfo\): Promise<void\>
Sets the call restriction status. This API uses a promise to return the result. Sets the call restriction status. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2084,6 +2943,18 @@ This is a system API. ...@@ -2084,6 +2943,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2106,7 +2977,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall ...@@ -2106,7 +2977,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType, callback: AsyncCall
Obtains call transfer information. This API uses an asynchronous callback to return the result. Obtains call transfer information. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE **Required permission**: ohos.permission.GET_TELEPHONY_STATE
...@@ -2120,10 +2991,22 @@ This is a system API. ...@@ -2120,10 +2991,22 @@ This is a system API.
| type | [CallTransferType](#calltransfertype8) | Yes | Call transfer type. | | type | [CallTransferType](#calltransfertype8) | Yes | Call transfer type. |
| callback | AsyncCallback&lt;[CallTransferResult](#calltransferresult8)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[CallTransferResult](#calltransferresult8)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
call.getCallTransferInfo(0, callTransferTyp, (err, data) => { call.getCallTransferInfo(0, call.CallTransferType.TRANSFER_TYPE_BUSY, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
``` ```
...@@ -2135,7 +3018,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf ...@@ -2135,7 +3018,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf
Obtains call transfer information. This API uses a promise to return the result. Obtains call transfer information. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE **Required permission**: ohos.permission.GET_TELEPHONY_STATE
...@@ -2154,6 +3037,18 @@ This is a system API. ...@@ -2154,6 +3037,18 @@ This is a system API.
| --------------------------------------------------------- | --------------------------- | | --------------------------------------------------------- | --------------------------- |
| Promise&lt;[CallTransferResult](#calltransferresult8)&gt; | Promise used to return the result.| | Promise&lt;[CallTransferResult](#calltransferresult8)&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2171,7 +3066,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback ...@@ -2171,7 +3066,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo, callback: AsyncCallback
Sets call transfer information. This API uses an asynchronous callback to return the result. Sets call transfer information. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2185,6 +3080,18 @@ This is a system API. ...@@ -2185,6 +3080,18 @@ This is a system API.
| info | [CallTransferInfo](#calltransferinfo8) | Yes | Call transfer information. | | info | [CallTransferInfo](#calltransferinfo8) | Yes | Call transfer information. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2205,7 +3112,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\> ...@@ -2205,7 +3112,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\>
Sets call transfer information. This API uses a promise to return the result. Sets call transfer information. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2224,6 +3131,18 @@ This is a system API. ...@@ -2224,6 +3131,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2246,7 +3165,7 @@ isRinging\(callback: AsyncCallback<boolean\>\): void ...@@ -2246,7 +3165,7 @@ isRinging\(callback: AsyncCallback<boolean\>\): void
Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result. Checks whether the ringtone is playing. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2258,6 +3177,18 @@ This is a system API. ...@@ -2258,6 +3177,18 @@ This is a system API.
| -------- | ---------------------------- | ---- | ---------- | | -------- | ---------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2273,7 +3204,7 @@ isRinging\(\): Promise<boolean\> ...@@ -2273,7 +3204,7 @@ isRinging\(\): Promise<boolean\>
Checks whether the ringtone is playing. This API uses a promise to return the result. Checks whether the ringtone is playing. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2285,6 +3216,18 @@ This is a system API. ...@@ -2285,6 +3216,18 @@ This is a system API.
| ---------------------- | --------------------------- | | ---------------------- | --------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2302,7 +3245,7 @@ setMuted\(callback: AsyncCallback<void\>\): void ...@@ -2302,7 +3245,7 @@ setMuted\(callback: AsyncCallback<void\>\): void
Sets call muting. This API uses an asynchronous callback to return the result. Sets call muting. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2312,6 +3255,17 @@ This is a system API. ...@@ -2312,6 +3255,17 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2327,7 +3281,7 @@ setMuted\(\): Promise<void\> ...@@ -2327,7 +3281,7 @@ setMuted\(\): Promise<void\>
Sets call muting. This API uses a promise to return the result. Sets call muting. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2337,6 +3291,17 @@ This is a system API. ...@@ -2337,6 +3291,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2354,7 +3319,7 @@ cancelMuted(callback: AsyncCallback<void\>): void ...@@ -2354,7 +3319,7 @@ cancelMuted(callback: AsyncCallback<void\>): void
Cancels call muting. This API uses an asynchronous callback to return the result. Cancels call muting. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2364,6 +3329,17 @@ This is a system API. ...@@ -2364,6 +3329,17 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2379,7 +3355,7 @@ cancelMuted(): Promise<void\> ...@@ -2379,7 +3355,7 @@ cancelMuted(): Promise<void\>
Cancels call muting. This API uses a promise to return the result. Cancels call muting. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2389,6 +3365,17 @@ This is a system API. ...@@ -2389,6 +3365,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2400,13 +3387,13 @@ promise.then(data => { ...@@ -2400,13 +3387,13 @@ promise.then(data => {
}); });
``` ```
## call.setAudioDevice<sup>9+</sup> ## call.setAudioDevice<sup>8+</sup>
setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
Sets the audio device for a call. 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.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2417,6 +3404,17 @@ This is a system API. ...@@ -2417,6 +3404,17 @@ This is a system API.
| device | [AudioDevice](#audiodevice8) | Yes | Audio device.| | device | [AudioDevice](#audiodevice8) | Yes | Audio device.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2432,7 +3430,7 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn ...@@ -2432,7 +3430,7 @@ setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: Asyn
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 based on the specified options. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2444,6 +3442,17 @@ This is a system API. ...@@ -2444,6 +3442,17 @@ This is a system API.
| options | [AudioDeviceOptions](#audiodeviceoptions9) | Yes | Audio device parameters.| | options | [AudioDeviceOptions](#audiodeviceoptions9) | Yes | Audio device parameters.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2456,13 +3465,13 @@ call.setAudioDevice(1, audioDeviceOptions, (err, data) => { ...@@ -2456,13 +3465,13 @@ call.setAudioDevice(1, audioDeviceOptions, (err, data) => {
``` ```
## call.setAudioDevice<sup>8+</sup> ## call.setAudioDevice<sup>9+</sup>
setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\> setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise<void\>
Sets the audio device for a call based on the specified options. This API uses a promise to return the result. Sets the audio device for a call based on the specified options. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2479,6 +3488,17 @@ This is a system API. ...@@ -2479,6 +3488,17 @@ This is a system API.
| ------------------- | ------------------------------- | | ------------------- | ------------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2499,7 +3519,7 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy ...@@ -2499,7 +3519,7 @@ joinConference(mainCallId: number, callNumberList: Array<string\>, callback: Asy
Joins a conference call. This API uses an asynchronous callback to return the result. Joins a conference call. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2511,6 +3531,17 @@ This is a system API. ...@@ -2511,6 +3531,17 @@ This is a system API.
| callNumberList | Array<string\> | Yes | List of call numbers.| | callNumberList | Array<string\> | Yes | List of call numbers.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2528,7 +3559,7 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void ...@@ -2528,7 +3559,7 @@ joinConference(mainCallId: number, callNumberList: Array<string\>): Promise<void
Joins a conference call. This API uses a promise to return the result. Joins a conference call. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2545,6 +3576,17 @@ This is a system API. ...@@ -2545,6 +3576,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2565,7 +3607,7 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi ...@@ -2565,7 +3607,7 @@ updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback<voi
Updates the IMS call mode. This API uses an asynchronous callback to return the result. Updates the IMS call mode. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2577,6 +3619,17 @@ This is a system API. ...@@ -2577,6 +3619,17 @@ This is a system API.
| mode | [ImsCallMode](#imscallmode8) | Yes | IMS call mode.| | mode | [ImsCallMode](#imscallmode8) | Yes | IMS call mode.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2591,7 +3644,7 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\> ...@@ -2591,7 +3644,7 @@ updateImsCallMode(callId: number, mode: ImsCallMode): Promise<void\>
Updates the IMS call mode. This API uses a promise to return the result. Updates the IMS call mode. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2608,6 +3661,17 @@ This is a system API. ...@@ -2608,6 +3661,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2625,7 +3689,7 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void ...@@ -2625,7 +3689,7 @@ enableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
Enables the IMS switch. This API uses an asynchronous callback to return the result. Enables the IMS switch. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2638,6 +3702,18 @@ This is a system API. ...@@ -2638,6 +3702,18 @@ This is a system API.
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2652,7 +3728,7 @@ enableImsSwitch(slotId: number): Promise<void\> ...@@ -2652,7 +3728,7 @@ enableImsSwitch(slotId: number): Promise<void\>
Enables the IMS switch. This API uses a promise to return the result. Enables the IMS switch. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2670,6 +3746,18 @@ This is a system API. ...@@ -2670,6 +3746,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2687,7 +3775,7 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void ...@@ -2687,7 +3775,7 @@ disableImsSwitch(slotId: number, callback: AsyncCallback<void\>): void
Disables the IMS switch. This API uses an asynchronous callback to return the result. Disables the IMS switch. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2700,6 +3788,18 @@ This is a system API. ...@@ -2700,6 +3788,18 @@ This is a system API.
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2714,7 +3814,7 @@ disableImsSwitch(slotId: number): Promise<void\> ...@@ -2714,7 +3814,7 @@ disableImsSwitch(slotId: number): Promise<void\>
Disables the IMS switch. This API uses a promise to return the result. Disables the IMS switch. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permission**: ohos.permission.SET_TELEPHONY_STATE
...@@ -2732,6 +3832,18 @@ This is a system API. ...@@ -2732,6 +3832,18 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2749,7 +3861,7 @@ isImsSwitchEnabled(slotId: number, callback: AsyncCallback<boolean\>): void ...@@ -2749,7 +3861,7 @@ isImsSwitchEnabled(slotId: number, callback: AsyncCallback<boolean\>): void
Checks whether the IMS switch is enabled. This API uses an asynchronous callback to return the result. Checks whether the IMS switch is enabled. This API uses an asynchronous callback to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2760,6 +3872,17 @@ This is a system API. ...@@ -2760,6 +3872,17 @@ This is a system API.
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2774,7 +3897,7 @@ isImsSwitchEnabled(slotId: number): Promise<boolean\> ...@@ -2774,7 +3897,7 @@ isImsSwitchEnabled(slotId: number): Promise<boolean\>
Checks whether the IMS switch is enabled. This API uses a promise to return the result. Checks whether the IMS switch is enabled. This API uses a promise to return the result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2790,6 +3913,17 @@ This is a system API. ...@@ -2790,6 +3913,17 @@ This is a system API.
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2801,20 +3935,32 @@ promise.then(data => { ...@@ -2801,20 +3935,32 @@ promise.then(data => {
}); });
``` ```
## DialOptions ## DialOptions
Defines the dialup options. Provides an option for determining whether a call is a video call.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ | | ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
| extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call| | extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
| accountId <sup>8+</sup> | number | No | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>This is a system API. | | accountId <sup>8+</sup> | number | No | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>This is a system API. |
| videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. | | videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. |
| dialScene <sup>8+</sup> | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. | | dialScene <sup>8+</sup> | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. |
| dialType <sup>8+</sup> | [DialType](#dialtype8) | No | Dialup type. This is a system API. | | dialType <sup>8+</sup> | [DialType](#dialtype8) | No | Dialup type. This is a system API. |
## DialCallOptions<sup>9+</sup>
Defines options for initiating a call.
**System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description |
| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ |
| accountId <sup>9+</sup> | number | No | Account ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>This is a system API.|
| videoState <sup>9+</sup> | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. |
| dialScene <sup>9+</sup> | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. |
| dialType <sup>9+</sup> | [DialType](#dialtype8) | No | Dialup type. This is a system API. |
## CallState ## CallState
...@@ -2827,33 +3973,33 @@ Enumerates call states. ...@@ -2827,33 +3973,33 @@ Enumerates call states.
| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. | | CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. |
| CALL_STATE_IDLE | 0 | No call is in progress. | | CALL_STATE_IDLE | 0 | No call is in progress. |
| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. | | CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. |
| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting. | | CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.|
## EmergencyNumberOptions<sup>7+</sup> ## EmergencyNumberOptions<sup>7+</sup>
Defines options for determining whether a number is an emergency number. Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name| Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------------------------------- | | ------ | ------ | ---- | ---------------------------------------------- |
| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
## NumberFormatOptions<sup>7+</sup> ## NumberFormatOptions<sup>7+</sup>
Defines the number formatting options. Provides an option for number formatting.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------------------------------------------------------- | | ----------- | ------ | ---- | ---------------------------------------------------------- |
| countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**. | | countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.|
## ImsCallMode<sup>8+</sup> ## ImsCallMode<sup>8+</sup>
Enumerates IMS call modes. Enumerates IMS call modes.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2869,23 +4015,23 @@ This is a system API. ...@@ -2869,23 +4015,23 @@ This is a system API.
Enumerates audio devices. Enumerates audio devices.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Value | Description | | Name | Value | Description |
| -------------------- | ---- | ------------ | | -------------------- | ---- | ------------ |
| DEVICE_EARPIECE | 0 | Earpiece. | | DEVICE_EARPIECE | 0 | Headset device. |
| DEVICE_SPEAKER | 1 | Speaker.| | DEVICE_SPEAKER | 1 | Speaker device.|
| DEVICE_WIRED_HEADSET | 2 | Wired headset.| | DEVICE_WIRED_HEADSET | 2 | Wired headset device.|
| DEVICE_BLUETOOTH_SCO | 3 | Bluetooth SCO device. | | DEVICE_BLUETOOTH_SCO | 3 | Bluetooth SCO device. |
| DEVICE_MIC | 4 | Microphone. | | DEVICE_MIC | 4 | Microphone device|
## CallRestrictionType<sup>8+</sup> ## CallRestrictionType<sup>8+</sup>
Enumerates call restriction types. Enumerates call restriction types.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2904,7 +4050,7 @@ This is a system API. ...@@ -2904,7 +4050,7 @@ This is a system API.
Defines the call transfer information. Defines the call transfer information.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2915,14 +4061,14 @@ This is a system API. ...@@ -2915,14 +4061,14 @@ This is a system API.
| settingType | [CallTransferSettingType](#calltransfersettingtype8) | Yes | Call transfer setting type.| | settingType | [CallTransferSettingType](#calltransfersettingtype8) | Yes | Call transfer setting type.|
| startHour<sup>9+</sup> | number | No | Hour in the start time.| | startHour<sup>9+</sup> | number | No | Hour in the start time.|
| startMinute<sup>9+</sup> | number | No | Minute in the start time.| | startMinute<sup>9+</sup> | number | No | Minute in the start time.|
| endHour<sup>9+</sup> | number | No | Hour in the end time.| | endHour<sup>9+</sup> | number | No | Minute in the end time.|
| endMinute<sup>9+</sup> | number | No | Minute in the end time.| | endMinute<sup>9+</sup> | number | No | Minute in the end time.|
## CallTransferType<sup>8+</sup> ## CallTransferType<sup>8+</sup>
Enumerates call transfer types. Enumerates call transfer types.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2937,7 +4083,7 @@ This is a system API. ...@@ -2937,7 +4083,7 @@ This is a system API.
Enumerates call transfer setting types. Enumerates call transfer setting types.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2952,11 +4098,11 @@ This is a system API. ...@@ -2952,11 +4098,11 @@ This is a system API.
Defines the call attribute options. Defines the call attribute options.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | ---------------------------------------- | ---- | -------------- | | --------------- | ---------------------------------------- | ---- | -------------- |
| accountNumber | string | Yes | Account number. | | accountNumber | string | Yes | Account number. |
| speakerphoneOn | boolean | Yes | Speakerphone on.| | speakerphoneOn | boolean | Yes | Speakerphone on.|
...@@ -2973,7 +4119,7 @@ This is a system API. ...@@ -2973,7 +4119,7 @@ This is a system API.
Enumerates conference states. Enumerates conference states.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -2988,7 +4134,7 @@ This is a system API. ...@@ -2988,7 +4134,7 @@ This is a system API.
Enumerates call types. Enumerates call types.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3001,9 +4147,9 @@ This is a system API. ...@@ -3001,9 +4147,9 @@ This is a system API.
## VideoStateType<sup>7+</sup> ## VideoStateType<sup>7+</sup>
Enumerates video state types. Video state type.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3016,7 +4162,7 @@ This is a system API. ...@@ -3016,7 +4162,7 @@ This is a system API.
Enumerates detailed call states. Enumerates detailed call states.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3036,11 +4182,11 @@ This is a system API. ...@@ -3036,11 +4182,11 @@ This is a system API.
Defines the call restriction information. Defines the call restriction information.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------------- | ---- | ------------ | | -------- | -------------------------------------------- | ---- | ------------ |
| type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type.| | type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type.|
| password | string | Yes | Password. | | password | string | Yes | Password. |
...@@ -3050,7 +4196,7 @@ This is a system API. ...@@ -3050,7 +4196,7 @@ This is a system API.
Enumerates call restriction modes. Enumerates call restriction modes.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3063,11 +4209,11 @@ This is a system API. ...@@ -3063,11 +4209,11 @@ This is a system API.
Defines the call event options. Defines the call event options.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------------ | ---- | -------------- | | ------- | ------------------------------------------ | ---- | -------------- |
| eventId | [CallAbilityEventId](#callabilityeventid8) | Yes | Call ability event ID.| | eventId | [CallAbilityEventId](#callabilityeventid8) | Yes | Call ability event ID.|
...@@ -3075,7 +4221,7 @@ This is a system API. ...@@ -3075,7 +4221,7 @@ This is a system API.
Enumerates call ability event IDs. Enumerates call ability event IDs.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3088,7 +4234,7 @@ This is a system API. ...@@ -3088,7 +4234,7 @@ This is a system API.
Enumerates dialup scenarios. Enumerates dialup scenarios.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3102,7 +4248,7 @@ This is a system API. ...@@ -3102,7 +4248,7 @@ This is a system API.
Enumerates dialup types. Enumerates dialup types.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3116,11 +4262,11 @@ This is a system API. ...@@ -3116,11 +4262,11 @@ This is a system API.
Defines options for the call rejection message. Defines options for the call rejection message.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | ------ | ---- | -------- | | -------------- | ------ | ---- | -------- |
| messageContent | string | Yes | Message content.| | messageContent | string | Yes | Message content.|
...@@ -3128,7 +4274,7 @@ This is a system API. ...@@ -3128,7 +4274,7 @@ This is a system API.
Defines the call transfer result. Defines the call transfer result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3138,14 +4284,14 @@ This is a system API. ...@@ -3138,14 +4284,14 @@ This is a system API.
| number | string | Yes | Call transfer number. | | number | string | Yes | Call transfer number. |
| startHour<sup>9+</sup> | number | Yes | Hour in the start time.| | startHour<sup>9+</sup> | number | Yes | Hour in the start time.|
| startMinute<sup>9+</sup> | number | Yes | Minute in the start time.| | startMinute<sup>9+</sup> | number | Yes | Minute in the start time.|
| endHour<sup>9+</sup> | number | Yes | Hour in the end time.| | endHour<sup>9+</sup> | number | Yes | Minute in the end time.|
| endMinute<sup>9+</sup> | number | Yes | Minute in the end time.| | endMinute<sup>9+</sup> | number | Yes | Minute in the end time.|
## CallWaitingStatus<sup>7+</sup> ## CallWaitingStatus<sup>7+</sup>
Enumerates call waiting states. Enumerates call waiting states.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3158,7 +4304,7 @@ This is a system API. ...@@ -3158,7 +4304,7 @@ This is a system API.
Enumerates call restriction states. Enumerates call restriction states.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3171,7 +4317,7 @@ This is a system API. ...@@ -3171,7 +4317,7 @@ This is a system API.
Enumerates call transfer states. Enumerates call transfer states.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3184,7 +4330,7 @@ This is a system API. ...@@ -3184,7 +4330,7 @@ This is a system API.
Defines the cause of a call disconnection. Defines the cause of a call disconnection.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3197,7 +4343,7 @@ This is a system API. ...@@ -3197,7 +4343,7 @@ This is a system API.
Enumerates causes of call disconnection. Enumerates causes of call disconnection.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3287,7 +4433,7 @@ This is a system API. ...@@ -3287,7 +4433,7 @@ This is a system API.
Defines the MMI code result. Defines the MMI code result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3298,9 +4444,9 @@ This is a system API. ...@@ -3298,9 +4444,9 @@ This is a system API.
## MmiCodeResult<sup>9+</sup> ## MmiCodeResult<sup>9+</sup>
Enumerates MMI code results. Defines the MMI code result.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -3313,7 +4459,7 @@ This is a system API. ...@@ -3313,7 +4459,7 @@ This is a system API.
Defines audio device options. Defines audio device options.
This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
......
...@@ -166,6 +166,7 @@ Updates a contact based on the specified contact information. This API uses an a ...@@ -166,6 +166,7 @@ Updates a contact based on the specified contact information. This API uses an a
```js ```js
contact.updateContact({ contact.updateContact({
id: 1,
name: {fullName: 'xxx'}, name: {fullName: 'xxx'},
phoneNumbers: [{phoneNumber: '138xxxxxxxx'}] phoneNumbers: [{phoneNumber: '138xxxxxxxx'}]
}, (err) => { }, (err) => {
...@@ -200,6 +201,7 @@ Updates a contact based on the specified contact information and attributes. Thi ...@@ -200,6 +201,7 @@ Updates a contact based on the specified contact information and attributes. Thi
```js ```js
contact.updateContact({ contact.updateContact({
id: 1,
name: {fullName: 'xxx'}, name: {fullName: 'xxx'},
phoneNumbers: [{phoneNumber: '138xxxxxxxx'}] phoneNumbers: [{phoneNumber: '138xxxxxxxx'}]
}, { }, {
...@@ -241,6 +243,7 @@ Updates a contact based on the specified contact information and attributes. Thi ...@@ -241,6 +243,7 @@ Updates a contact based on the specified contact information and attributes. Thi
```js ```js
let promise = contact.updateContact({ let promise = contact.updateContact({
id: 1,
name: {fullName: 'xxx'}, name: {fullName: 'xxx'},
phoneNumbers: [{phoneNumber: '138xxxxxxxx'}] phoneNumbers: [{phoneNumber: '138xxxxxxxx'}]
}, { }, {
......
...@@ -9,7 +9,7 @@ The **observer** module provides event subscription management functions. You ca ...@@ -9,7 +9,7 @@ The **observer** module provides event subscription management functions. You ca
## Modules to Import ## Modules to Import
```js ```
import observer from '@ohos.telephony.observer' import observer from '@ohos.telephony.observer'
``` ```
...@@ -17,7 +17,7 @@ import observer from '@ohos.telephony.observer' ...@@ -17,7 +17,7 @@ import observer from '@ohos.telephony.observer'
on\(type: \'networkStateChange\', callback: Callback<NetworkState\>\): void; on\(type: \'networkStateChange\', callback: Callback<NetworkState\>\): void;
Registers an observer for network status change events. This API uses an asynchronous callback to return the result. Registers an observer for network status change events. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
...@@ -30,6 +30,18 @@ Registers an observer for network status change events. This API uses an asynchr ...@@ -30,6 +30,18 @@ Registers an observer for network status change events. This API uses an asynchr
| type | string | Yes | Network status change event. | | type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).| | callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -43,7 +55,7 @@ observer.on('networkStateChange', data =>{ ...@@ -43,7 +55,7 @@ observer.on('networkStateChange', data =>{
on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callback<NetworkState\>\): void; on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callback<NetworkState\>\): void;
Registers an observer for network status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Registers an observer for network status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
...@@ -54,9 +66,21 @@ Registers an observer for network status change events of the SIM card in the sp ...@@ -54,9 +66,21 @@ Registers an observer for network status change events of the SIM card in the sp
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| type | string | Yes | Network status change event. | | type | string | Yes | Network status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).| | callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -70,7 +94,7 @@ observer.on('networkStateChange', {slotId: 0}, data =>{ ...@@ -70,7 +94,7 @@ observer.on('networkStateChange', {slotId: 0}, data =>{
off\(type: \'networkStateChange\', callback?: Callback<NetworkState\>\): void; off\(type: \'networkStateChange\', callback?: Callback<NetworkState\>\): void;
Unregisters the observer for network status change events. This API uses an asynchronous callback to return the result. Unregisters the observer for network status change events. This API uses an asynchronous callback to return the execution result.
>**NOTE** >**NOTE**
> >
...@@ -85,6 +109,14 @@ Unregisters the observer for network status change events. This API uses an asyn ...@@ -85,6 +109,14 @@ Unregisters the observer for network status change events. This API uses an asyn
| type | string | Yes | Network status change event. | | type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | No | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).| | callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | No | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -101,7 +133,7 @@ observer.off('networkStateChange'); ...@@ -101,7 +133,7 @@ observer.off('networkStateChange');
on\(type: \'signalInfoChange\', callback: Callback<Array<SignalInformation\>\>): void; on\(type: \'signalInfoChange\', callback: Callback<Array<SignalInformation\>\>): void;
Registers an observer for signal status change events. This API uses an asynchronous callback to return the result. Registers an observer for signal status change events. This API uses an asynchronous callback to return the execution result.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
...@@ -109,9 +141,21 @@ Registers an observer for signal status change events. This API uses an asynchro ...@@ -109,9 +141,21 @@ Registers an observer for signal status change events. This API uses an asynchro
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Signal status change event. | | type | string | Yes | Signal information change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).| | callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -125,7 +169,7 @@ observer.on('signalInfoChange', data =>{ ...@@ -125,7 +169,7 @@ observer.on('signalInfoChange', data =>{
on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback<Array<SignalInformation\>\>): void; on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback<Array<SignalInformation\>\>): void;
Registers an observer for signal status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Registers an observer for signal status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the execution result.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
...@@ -133,10 +177,22 @@ Registers an observer for signal status change events of the SIM card in the spe ...@@ -133,10 +177,22 @@ Registers an observer for signal status change events of the SIM card in the spe
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| type | string | Yes | Signal status change event. | | type | string | Yes | Signal information change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).| | callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -150,7 +206,7 @@ observer.on('signalInfoChange', {slotId: 0}, data =>{ ...@@ -150,7 +206,7 @@ observer.on('signalInfoChange', {slotId: 0}, data =>{
off\(type: \'signalInfoChange\', callback?: Callback<Array<SignalInformation\>\>): void; off\(type: \'signalInfoChange\', callback?: Callback<Array<SignalInformation\>\>): void;
Unregisters the observer for signal status change events. This API uses an asynchronous callback to return the result. Unregisters the observer for signal status change events. This API uses an asynchronous callback to return the execution result.
>**NOTE** >**NOTE**
> >
...@@ -162,9 +218,20 @@ Unregisters the observer for signal status change events. This API uses an async ...@@ -162,9 +218,20 @@ Unregisters the observer for signal status change events. This API uses an async
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Signal status change event. | | type | string | Yes | Signal information change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | No | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).| | callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | No | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -182,7 +249,7 @@ observer.off('signalInfoChange'); ...@@ -182,7 +249,7 @@ observer.off('signalInfoChange');
on(type: 'callStateChange', callback: Callback\<{ state: CallState, number: string }\>): void; on(type: 'callStateChange', callback: Callback\<{ state: CallState, number: string }\>): void;
Registers an observer for call status change events. This API uses an asynchronous callback to return the result. Registers an observer for call status change events. This API uses an asynchronous callback to return the execution result.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
...@@ -193,6 +260,17 @@ Registers an observer for call status change events. This API uses an asynchrono ...@@ -193,6 +260,17 @@ Registers an observer for call status change events. This API uses an asynchrono
| type | string | Yes | Call status change event. | | type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.| | callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -206,7 +284,7 @@ observer.on('callStateChange', value =>{ ...@@ -206,7 +284,7 @@ observer.on('callStateChange', value =>{
on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ state:CallState, number: string }>): void; on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ state:CallState, number: string }>): void;
Registers an observer for call status change events. This API uses an asynchronous callback to return the result. Registers an observer for call status change events. This API uses an asynchronous callback to return the execution result.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
...@@ -215,9 +293,20 @@ Registers an observer for call status change events. This API uses an asynchrono ...@@ -215,9 +293,20 @@ Registers an observer for call status change events. This API uses an asynchrono
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Call status change event. | | type | string | Yes | Call status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.| | callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -231,7 +320,7 @@ observer.on('callStateChange', {slotId: 0}, value =>{ ...@@ -231,7 +320,7 @@ observer.on('callStateChange', {slotId: 0}, value =>{
off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: string }>): void; off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: string }>): void;
Unregisters the observer for call status change events. This API uses an asynchronous callback to return the result. Unregisters the observer for call status change events. This API uses an asynchronous callback to return the execution result.
>**NOTE** >**NOTE**
> >
...@@ -246,6 +335,17 @@ Unregisters the observer for call status change events. This API uses an asynchr ...@@ -246,6 +335,17 @@ Unregisters the observer for call status change events. This API uses an asynchr
| type | string | Yes | Call status change event. | | type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | No | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.| | callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | No | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -263,7 +363,7 @@ observer.off('callStateChange'); ...@@ -263,7 +363,7 @@ observer.off('callStateChange');
on\(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: DataConnectState, network: RatType}\>\): void; on\(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: DataConnectState, network: RatType}\>\): void;
Registers an observer for connection status change events of the cellular data connection.This API uses an asynchronous callback to return the result. Registers an observer for connection status change events of the cellular data link. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
...@@ -271,9 +371,20 @@ Registers an observer for connection status change events of the cellular data c ...@@ -271,9 +371,20 @@ Registers an observer for connection status change events of the cellular data c
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data connection. | | type | string | Yes | Connection status change event of the cellular data link. |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).| | callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -287,7 +398,7 @@ observer.on('cellularDataConnectionStateChange', value =>{ ...@@ -287,7 +398,7 @@ observer.on('cellularDataConnectionStateChange', value =>{
on\(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback\<{ state: DataConnectState, network: RatType }\>\): void; on\(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback\<{ state: DataConnectState, network: RatType }\>\): void;
Registers an observer for connection status change events of the cellular data connection over the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Registers an observer for connection status change events of the cellular data link over the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
...@@ -295,10 +406,21 @@ Registers an observer for connection status change events of the cellular data c ...@@ -295,10 +406,21 @@ Registers an observer for connection status change events of the cellular data c
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data connection. | | type | string | Yes | Connection status change event of the cellular data link. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).| | callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -312,7 +434,7 @@ observer.on('cellularDataConnectionStateChange', {slotId: 0}, value =>{ ...@@ -312,7 +434,7 @@ observer.on('cellularDataConnectionStateChange', {slotId: 0}, value =>{
off\(type: 'cellularDataConnectionStateChange', callback?: Callback\<{ state: DataConnectState, network: RatType}\>\): void; off\(type: 'cellularDataConnectionStateChange', callback?: Callback\<{ state: DataConnectState, network: RatType}\>\): void;
Unregisters the observer for connection status change events of the cellular data connection.This API uses an asynchronous callback to return the result. Unregisters the observer for connection status change events of the cellular data link. This API uses an asynchronous callback to return the result.
>**NOTE** >**NOTE**
> >
...@@ -324,9 +446,20 @@ Unregisters the observer for connection status change events of the cellular dat ...@@ -324,9 +446,20 @@ Unregisters the observer for connection status change events of the cellular dat
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data connection. | | type | string | Yes | Connection status change event of the cellular data link. |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | No | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).| | callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectstate), network: [RatType](js-apis-radio.md#radiotechnology) }\> | No | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -355,6 +488,17 @@ Registers an observer for the uplink and downlink data flow status change events ...@@ -355,6 +488,17 @@ Registers an observer for the uplink and downlink data flow status change events
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. | | type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).| | callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -377,9 +521,20 @@ Registers an observer for the uplink and downlink data flow status change events ...@@ -377,9 +521,20 @@ Registers an observer for the uplink and downlink data flow status change events
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. | | type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).| | callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -408,6 +563,17 @@ Unregisters the observer for the uplink and downlink data flow status change eve ...@@ -408,6 +563,17 @@ Unregisters the observer for the uplink and downlink data flow status change eve
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. | | type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | No | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).| | callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | No | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -436,6 +602,17 @@ Registers an observer for SIM card status change events. This API uses an asynch ...@@ -436,6 +602,17 @@ Registers an observer for SIM card status change events. This API uses an asynch
| type | string | Yes | SIM card status change event. | | type | string | Yes | SIM card status change event. |
| callback | Callback\<[SimStateData](#simstatedata7)\> | Yes | Callback used to return the result.| | callback | Callback\<[SimStateData](#simstatedata7)\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -458,9 +635,20 @@ Registers an observer for status change events of the SIM card in the specified ...@@ -458,9 +635,20 @@ Registers an observer for status change events of the SIM card in the specified
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | SIM card status change event. | | type | string | Yes | SIM card status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | Callback\<[SimStateData](#simstatedata7)\> | Yes | Callback used to return the result.| | callback | Callback\<[SimStateData](#simstatedata7)\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -489,6 +677,17 @@ Unregisters the observer for SIM card status change events. This API uses an asy ...@@ -489,6 +677,17 @@ Unregisters the observer for SIM card status change events. This API uses an asy
| type | string | Yes | SIM card status change event. | | type | string | Yes | SIM card status change event. |
| callback | Callback\<[SimStateData](#simstatedata7)\> | No | Callback used to return the result.| | callback | Callback\<[SimStateData](#simstatedata7)\> | No | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -531,8 +730,8 @@ Enumerates SIM card types and states. ...@@ -531,8 +730,8 @@ Enumerates SIM card types and states.
**System capability**: SystemCapability.Telephony.StateRegistry **System capability**: SystemCapability.Telephony.StateRegistry
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | ------------------- | ----------------------------------- | ---- | -------------------------------------------------------- |
| type | [CardType](js-apis-sim.md#cardtype) | Yes| SIM card type. For details, see [CardType](js-apis-sim.md#cardtype).| | type | [CardType](js-apis-sim.md#cardtype) | Yes | SIM card type. For details, see [CardType](js-apis-sim.md#cardtype).|
| state | [SimState](js-apis-sim.md#simstate) | Yes| SIM card status. For details, see [SimState](js-apis-sim.md#simstate).| | state | [SimState](js-apis-sim.md#simstate) | Yes | SIM card status. For details, see [SimState](js-apis-sim.md#simstate).|
| reason<sup>8+</sup> | [LockReason](#lockreason8) | Yes| SIM card lock type.| | reason<sup>8+</sup> | [LockReason](#lockreason8) | Yes | SIM card lock type. |
...@@ -420,44 +420,44 @@ Enumerates mouse pointer styles. ...@@ -420,44 +420,44 @@ Enumerates mouse pointer styles.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer **System capability**: SystemCapability.MultimodalInput.Input.Pointer
| Name | Value | Description | | Name | Value | Description |Legend|
| -------------------------------- | ---- | ------ | | -------------------------------- | ---- | ------ |------ |
| DEFAULT | 0 | Default | | DEFAULT | 0 | Default |![Default.png](./figures/Default.png)|
| EAST | 1 | East arrow | | EAST | 1 | East arrow |![East.png](./figures/East.png)|
| WEST | 2 | West arrow | | WEST | 2 | West arrow |![West.png](./figures/West.png)|
| SOUTH | 3 | South arrow | | SOUTH | 3 | South arrow |![South.png](./figures/South.png)|
| NORTH | 4 | North arrow | | NORTH | 4 | North arrow |![North.png](./figures/North.png)|
| WEST_EAST | 5 | West-east arrow | | WEST_EAST | 5 | West-east arrow |![West_East.png](./figures/West_East.png)|
| NORTH_SOUTH | 6 | North-south arrow | | NORTH_SOUTH | 6 | North-south arrow |![North_South.png](./figures/North_South.png)|
| NORTH_EAST | 7 | North-east arrow | | NORTH_EAST | 7 | North-east arrow |![North_East.png](./figures/North_East.png)|
| NORTH_WEST | 8 | North-west arrow | | NORTH_WEST | 8 | North-west arrow |![North_West.png](./figures/North_West.png)|
| SOUTH_EAST | 9 | South-east arrow | | SOUTH_EAST | 9 | South-east arrow |![South_East.png](./figures/South_East.png)|
| SOUTH_WEST | 10 | South-west arrow | | SOUTH_WEST | 10 | South-west arrow |![South_West.png](./figures/South_West.png)|
| NORTH_EAST_SOUTH_WEST | 11 | North-east and south-west adjustment| | NORTH_EAST_SOUTH_WEST | 11 | North-east and south-west adjustment|![North_East_South_West.png](./figures/North_East_South_West.png)|
| NORTH_WEST_SOUTH_EAST | 12 | North-west and south-east adjustment| | NORTH_WEST_SOUTH_EAST | 12 | North-west and south-east adjustment|![North_West_South_East.png](./figures/North_West_South_East.png)|
| CROSS | 13 | Cross (accurate selection) | | CROSS | 13 | Cross (accurate selection) |![Cross.png](./figures/Cross.png)|
| CURSOR_COPY | 14 | Copy cursor | | CURSOR_COPY | 14 | Copy cursor |![Copy.png](./figures/Copy.png)|
| CURSOR_FORBID | 15 | Forbid cursor | | CURSOR_FORBID | 15 | Forbid cursor |![Forbid.png](./figures/Forbid.png)|
| COLOR_SUCKER | 16 | Sucker | | COLOR_SUCKER | 16 | Sucker |![Colorsucker.png](./figures/Colorsucker.png)|
| HAND_GRABBING | 17 | Grabbing hand | | HAND_GRABBING | 17 | Grabbing hand |![Hand_Grabbing.png](./figures/Hand_Grabbing.png)|
| HAND_OPEN | 18 | Opening hand | | HAND_OPEN | 18 | Opening hand |![Hand_Open.png](./figures/Hand_Open.png)|
| HAND_POINTING | 19 | Hand-shaped pointer | | HAND_POINTING | 19 | Hand-shaped pointer |![Hand_Poniting.png](./figures/Hand_Pointing.png)|
| HELP | 20 | Help | | HELP | 20 | Help |![Help.png](./figures/Help.png)|
| MOVE | 21 | Move | | MOVE | 21 | Move |![Move.png](./figures/Move.png)|
| RESIZE_LEFT_RIGHT | 22 | Left and right resizing| | RESIZE_LEFT_RIGHT | 22 | Left-and-right resizing|![Resize_Left_Right.png](./figures/Resize_Left_Right.png)|
| RESIZE_UP_DOWN | 23 | Up and down resizing| | RESIZE_UP_DOWN | 23 | Up-and-down resizing|![Resize_Up_Down.png](./figures/Resize_Up_Down.png)|
| SCREENSHOT_CHOOSE | 24 | Screenshot crosshair| | SCREENSHOT_CHOOSE | 24 | Screenshot crosshair|![Screenshot_Cross.png](./figures/Screenshot_Cross.png)|
| SCREENSHOT_CURSOR | 25 | Screenshot cursor | | SCREENSHOT_CURSOR | 25 | Screenshot cursor |![Screenshot_Cursor.png](./figures/Screenshot_Cursor.png)|
| TEXT_CURSOR | 26 | Text cursor | | TEXT_CURSOR | 26 | Text cursor |![Text_Cursor.png](./figures/Text_Cursor.png)|
| ZOOM_IN | 27 | Zoom in | | ZOOM_IN | 27 | Zoom in |![Zoom_In.png](./figures/Zoom_In.png)|
| ZOOM_OUT | 28 | Zoom out | | ZOOM_OUT | 28 | Zoom out |![Zoom_Out.png](./figures/Zoom_Out.png)|
| MIDDLE_BTN_EAST | 29 | Scrolling east | | MIDDLE_BTN_EAST | 29 | Scrolling east |![MID_Btn_East.png](./figures/MID_Btn_East.png)|
| MIDDLE_BTN_WEST | 30 | Scrolling west | | MIDDLE_BTN_WEST | 30 | Scrolling west |![MID_Btn_West.png](./figures/MID_Btn_West.png)|
| MIDDLE_BTN_SOUTH | 31 | Scrolling south | | MIDDLE_BTN_SOUTH | 31 | Scrolling south | ![MID_Btn_South.png](./figures/MID_Btn_South.png) |
| MIDDLE_BTN_NORTH | 32 | Scrolling north | | MIDDLE_BTN_NORTH | 32 | Scrolling north |![MID_Btn_North.png](./figures/MID_Btn_North.png)|
| MIDDLE_BTN_NORTH_SOUTH | 33 | Scrolling north-south | | MIDDLE_BTN_NORTH_SOUTH | 33 | Scrolling north-south |![MID_Btn_North_South.png](./figures/MID_Btn_North_South.png)|
| MIDDLE_BTN_NORTH_EAST | 34 | Scrolling north-east | | MIDDLE_BTN_NORTH_EAST | 34 | Scrolling north-east |![MID_Btn_North_East.png](./figures/MID_Btn_North_East.png)|
| MIDDLE_BTN_NORTH_WEST | 35 | Scrolling north-west | | MIDDLE_BTN_NORTH_WEST | 35 | Scrolling north-west |![MID_Btn_North_West.png](./figures/MID_Btn_North_West.png)|
| MIDDLE_BTN_SOUTH_EAST | 36 | Scrolling south-east | | MIDDLE_BTN_SOUTH_EAST | 36 | Scrolling south-east |![MID_Btn_South_East.png](./figures/MID_Btn_South_East.png)|
| MIDDLE_BTN_SOUTH_WEST | 37 | Scrolling south-west | | MIDDLE_BTN_SOUTH_WEST | 37 | Scrolling south-west |![MID_Btn_South_West.png](./figures/MID_Btn_South_West.png)|
| MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | Moving as a cone in four directions| | MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | Moving as a cone in four directions|![MID_Btn_North_South_West_East.png](./figures/MID_Btn_North_South_West_East.png)|
...@@ -30,6 +30,18 @@ Obtains the RAT used in the CS and PS domains for the SIM card in the specified ...@@ -30,6 +30,18 @@ Obtains the RAT used in the CS and PS domains for the SIM card in the specified
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech:[RadioTechnology](#radiotechnology)}\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech:[RadioTechnology](#radiotechnology)}\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -62,6 +74,18 @@ Obtains the RAT used in the CS and PS domains for the SIM card in the specified ...@@ -62,6 +74,18 @@ Obtains the RAT used in the CS and PS domains for the SIM card in the specified
| ------------------------------------------------------------ | ----------------------------------------------- | | ------------------------------------------------------------ | ----------------------------------------------- |
| Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | Promise used to return the result.| | Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -91,6 +115,18 @@ Obtains the network status. This API uses an asynchronous callback to return the ...@@ -91,6 +115,18 @@ Obtains the network status. This API uses an asynchronous callback to return the
| -------- | ---------------------------------------------- | ---- | ---------- | | -------- | ---------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -117,6 +153,18 @@ Obtains the network status. This API uses an asynchronous callback to return the ...@@ -117,6 +153,18 @@ Obtains the network status. This API uses an asynchronous callback to return the
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -149,6 +197,18 @@ Obtains the network status. This API uses a promise to return the result. ...@@ -149,6 +197,18 @@ Obtains the network status. This API uses a promise to return the result.
| ---------------------------------------- | --------------------------- | | ---------------------------------------- | --------------------------- |
| Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.| | Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -177,6 +237,17 @@ Obtains the network selection mode of the SIM card in the specified slot. This A ...@@ -177,6 +237,17 @@ Obtains the network selection mode of the SIM card in the specified slot. This A
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NetworkSelectionMode](#networkselectionmode)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NetworkSelectionMode](#networkselectionmode)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -207,6 +278,17 @@ Obtains the network selection mode of the SIM card in the specified slot. This A ...@@ -207,6 +278,17 @@ Obtains the network selection mode of the SIM card in the specified slot. This A
| -------------------------------------------------------- | ------------------------------- | | -------------------------------------------------------- | ------------------------------- |
| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.| | Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -235,6 +317,17 @@ Obtains the ISO country code of the network with which the SIM card in the speci ...@@ -235,6 +317,17 @@ Obtains the ISO country code of the network with which the SIM card in the speci
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is an ISO country code, for example, **CN** (China).| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is an ISO country code, for example, **CN** (China).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -265,6 +358,17 @@ Obtains the ISO country code of the network with which the SIM card in the speci ...@@ -265,6 +358,17 @@ Obtains the ISO country code of the network with which the SIM card in the speci
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).| | Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -292,6 +396,17 @@ Obtains the ID of the slot in which the primary card is located. This API uses a ...@@ -292,6 +396,17 @@ Obtains the ID of the slot in which the primary card is located. This API uses a
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback\<number\> | Yes | Callback invoked to return the result.| | callback | AsyncCallback\<number\> | Yes | Callback invoked to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -315,6 +430,17 @@ Obtains the ID of the slot in which the primary card is located. This API uses a ...@@ -315,6 +430,17 @@ Obtains the ID of the slot in which the primary card is located. This API uses a
| ----------------------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<number\> | Promise used to return the result.| | Promise\<number\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -342,6 +468,17 @@ Obtains a list of signal strengths of the network with which the SIM card in the ...@@ -342,6 +468,17 @@ Obtains a list of signal strengths of the network with which the SIM card in the
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | Yes | Callback used to return the result, which is a list of [SignalInformation](#signalinformation) objects.| | callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | Yes | Callback used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -372,6 +509,17 @@ Obtains a list of signal strengths of the network with which the SIM card in the ...@@ -372,6 +509,17 @@ Obtains a list of signal strengths of the network with which the SIM card in the
| ----------------------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<Array\<[SignalInformation](#signalinformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.| | Promise\<Array\<[SignalInformation](#signalinformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -509,6 +657,18 @@ Checks whether the radio service is enabled on the primary SIM card. This API us ...@@ -509,6 +657,18 @@ Checks whether the radio service is enabled on the primary SIM card. This API us
| -------- | ------------------------ | ---- | ------------------------------------------------------- | | -------- | ------------------------ | ---- | ------------------------------------------------------- |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -535,6 +695,18 @@ Checks whether the radio service is enabled on the SIM card in the specified slo ...@@ -535,6 +695,18 @@ Checks whether the radio service is enabled on the SIM card in the specified slo
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -567,6 +739,18 @@ Checks whether the radio service is enabled on the SIM card in the specified slo ...@@ -567,6 +739,18 @@ Checks whether the radio service is enabled on the SIM card in the specified slo
| ------------------ | ------------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.| | Promise\<boolean\> | Promise used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -595,6 +779,17 @@ Obtains the carrier name for the SIM card in the specified slot. This API uses a ...@@ -595,6 +779,17 @@ Obtains the carrier name for the SIM card in the specified slot. This API uses a
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is the carrier name, for example, China Mobile.| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is the carrier name, for example, China Mobile.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -625,6 +820,17 @@ Obtains the carrier name for the SIM card in the specified slot. This API uses a ...@@ -625,6 +820,17 @@ Obtains the carrier name for the SIM card in the specified slot. This API uses a
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile. | | Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -656,6 +862,19 @@ Sets the ID of the slot in which the primary card is located. This API uses an a ...@@ -656,6 +862,19 @@ Sets the ID of the slot in which the primary card is located. This API uses an a
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -690,6 +909,19 @@ Sets the ID of the slot in which the primary card is located. This API uses a pr ...@@ -690,6 +909,19 @@ Sets the ID of the slot in which the primary card is located. This API uses a pr
| --------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -720,6 +952,18 @@ Obtains the IMEI of the SIM card in a card slot. This API uses an asynchronous c ...@@ -720,6 +952,18 @@ Obtains the IMEI of the SIM card in a card slot. This API uses an asynchronous c
| -------- | ----------------------- | ---- | ------------------------------------------ | | -------- | ----------------------- | ---- | ------------------------------------------ |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. If the IMEI does not exist, an empty string is returned.| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. If the IMEI does not exist, an empty string is returned.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -748,6 +992,18 @@ Obtains the IMEI of the SIM card in the specified card slot. This API uses an as ...@@ -748,6 +992,18 @@ Obtains the IMEI of the SIM card in the specified card slot. This API uses an as
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. If the IMEI does not exist, an empty string is returned.| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. If the IMEI does not exist, an empty string is returned.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -782,6 +1038,18 @@ Obtains the IMEI of the SIM card in the specified card slot. This API uses a pro ...@@ -782,6 +1038,18 @@ Obtains the IMEI of the SIM card in the specified card slot. This API uses a pro
| ----------------- | ------------------------------------------ | | ----------------- | ------------------------------------------ |
| Promise\<string\> | Promise used to return the result. If the IMEI does not exist, an empty string is returned.| | Promise\<string\> | Promise used to return the result. If the IMEI does not exist, an empty string is returned.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -812,6 +1080,18 @@ Obtains the MEID of the SIM card in a card slot. This API uses an asynchronous c ...@@ -812,6 +1080,18 @@ Obtains the MEID of the SIM card in a card slot. This API uses an asynchronous c
| -------- | ----------------------- | ---- | ---------- | | -------- | ----------------------- | ---- | ---------- |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -840,6 +1120,18 @@ Obtains the MEID of the SIM card in the specified card slot. This API uses an as ...@@ -840,6 +1120,18 @@ Obtains the MEID of the SIM card in the specified card slot. This API uses an as
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -874,6 +1166,18 @@ Obtains the MEID of the SIM card in the specified card slot. This API uses a pro ...@@ -874,6 +1166,18 @@ Obtains the MEID of the SIM card in the specified card slot. This API uses a pro
| ----------------- | --------------------------------------- | | ----------------- | --------------------------------------- |
| Promise\<string\> | Promise used to return the result.| | Promise\<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -904,6 +1208,18 @@ Obtains the unique device ID of the SIM card in a card slot. This API uses an as ...@@ -904,6 +1208,18 @@ Obtains the unique device ID of the SIM card in a card slot. This API uses an as
| -------- | ----------------------- | ---- | ---------- | | -------- | ----------------------- | ---- | ---------- |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -932,6 +1248,18 @@ Obtains the unique device ID of the SIM card in the specified card slot. This AP ...@@ -932,6 +1248,18 @@ Obtains the unique device ID of the SIM card in the specified card slot. This AP
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -966,6 +1294,18 @@ Obtains the unique device ID of the SIM card in the specified card slot. This AP ...@@ -966,6 +1294,18 @@ Obtains the unique device ID of the SIM card in the specified card slot. This AP
| ----------------- | --------------------------------------------- | | ----------------- | --------------------------------------------- |
| Promise\<string\> | Promise used to return the result.| | Promise\<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -996,6 +1336,18 @@ Sends a cell location update request. This API uses an asynchronous callback to ...@@ -996,6 +1336,18 @@ Sends a cell location update request. This API uses an asynchronous callback to
| -------- | --------------------- | ---- | ---------- | | -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1023,6 +1375,18 @@ Sends a cell location update request for the SIM card in the specified slot. Thi ...@@ -1023,6 +1375,18 @@ Sends a cell location update request for the SIM card in the specified slot. Thi
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1056,6 +1420,18 @@ Sends a cell location update request for the SIM card in the specified slot. Thi ...@@ -1056,6 +1420,18 @@ Sends a cell location update request for the SIM card in the specified slot. Thi
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1086,6 +1462,18 @@ Obtains cell information. This API uses an asynchronous callback to return the r ...@@ -1086,6 +1462,18 @@ Obtains cell information. This API uses an asynchronous callback to return the r
| -------- | ------------------------------------------------------------ | ---- | ------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------ |
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1114,6 +1502,18 @@ Obtains cell information for the SIM card in the specified slot. This API uses a ...@@ -1114,6 +1502,18 @@ Obtains cell information for the SIM card in the specified slot. This API uses a
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1148,6 +1548,18 @@ Obtains cell information for the SIM card in the specified slot. This API uses a ...@@ -1148,6 +1548,18 @@ Obtains cell information for the SIM card in the specified slot. This API uses a
| ------------------------------------------------------- | ----------------------- | | ------------------------------------------------------- | ----------------------- |
| Promise\<Array<[CellInformation](#cellinformation8)\>\> | Promise used to return the result.| | Promise\<Array<[CellInformation](#cellinformation8)\>\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1179,6 +1591,18 @@ Sets the network selection mode. This API uses an asynchronous callback to retur ...@@ -1179,6 +1591,18 @@ Sets the network selection mode. This API uses an asynchronous callback to retur
| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes | Network selection mode.| | options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes | Network selection mode.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1223,6 +1647,18 @@ Sets the network selection mode. This API uses a promise to return the result. ...@@ -1223,6 +1647,18 @@ Sets the network selection mode. This API uses a promise to return the result.
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1265,6 +1701,18 @@ Obtains network search information for the SIM card in the specified slot. This ...@@ -1265,6 +1701,18 @@ Obtains network search information for the SIM card in the specified slot. This
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1297,6 +1745,18 @@ Obtains network search information for the SIM card in the specified slot. This ...@@ -1297,6 +1745,18 @@ Obtains network search information for the SIM card in the specified slot. This
| ------------------------------------------------------ | ----------------------- | | ------------------------------------------------------ | ----------------------- |
| Promise\<[NetworkSearchResult](#networksearchresult)\> | Promise used to return the result.| | Promise\<[NetworkSearchResult](#networksearchresult)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1324,6 +1784,17 @@ Obtains the NR option mode. This API uses an asynchronous callback to return the ...@@ -1324,6 +1784,17 @@ Obtains the NR option mode. This API uses an asynchronous callback to return the
| -------- | ----------------------------------------------- | ---- | ---------- | | -------- | ----------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1350,6 +1821,17 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses ...@@ -1350,6 +1821,17 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1382,6 +1864,17 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses ...@@ -1382,6 +1864,17 @@ Obtains the NR option mode for the SIM card in the specified slot. This API uses
| ----------------------------------------- | ----------------------- | | ----------------------------------------- | ----------------------- |
| Promise\<[NrOptionMode](#nroptionmode8)\> | Promise used to return the result.| | Promise\<[NrOptionMode](#nroptionmode8)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1412,6 +1905,18 @@ Turns on the radio function. This API uses an asynchronous callback to return th ...@@ -1412,6 +1905,18 @@ Turns on the radio function. This API uses an asynchronous callback to return th
| -------- | --------------------- | ---- | ---------- | | -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1440,6 +1945,18 @@ Turns on the radio function for the SIM card in the specified slot. This API use ...@@ -1440,6 +1945,18 @@ Turns on the radio function for the SIM card in the specified slot. This API use
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1474,6 +1991,18 @@ Turns on the radio function for the SIM card in the specified slot. This API use ...@@ -1474,6 +1991,18 @@ Turns on the radio function for the SIM card in the specified slot. This API use
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1504,6 +2033,18 @@ Turns off the radio function. This API uses an asynchronous callback to return t ...@@ -1504,6 +2033,18 @@ Turns off the radio function. This API uses an asynchronous callback to return t
| -------- | --------------------- | ---- | ---------- | | -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1532,6 +2073,18 @@ Turns off the radio function for the SIM card in the specified slot. This API us ...@@ -1532,6 +2073,18 @@ Turns off the radio function for the SIM card in the specified slot. This API us
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1566,6 +2119,18 @@ Turns off the radio function for the SIM card in the specified slot. This API us ...@@ -1566,6 +2119,18 @@ Turns off the radio function for the SIM card in the specified slot. This API us
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1598,6 +2163,18 @@ Sets the preferred network for the SIM card in the specified slot. This API uses ...@@ -1598,6 +2163,18 @@ Sets the preferred network for the SIM card in the specified slot. This API uses
| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | Yes | Preferred network mode. | | networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | Yes | Preferred network mode. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1631,6 +2208,18 @@ Sets the preferred network for the SIM card in the specified slot. This API uses ...@@ -1631,6 +2208,18 @@ Sets the preferred network for the SIM card in the specified slot. This API uses
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1656,11 +2245,23 @@ Obtains the preferred network for the SIM card in the specified slot. This API u ...@@ -1656,11 +2245,23 @@ Obtains the preferred network for the SIM card in the specified slot. This API u
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | | -------- | --------------------------------------------------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[PreferredNetworkMode](#preferrednetworkmode8)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[PreferredNetworkMode](#preferrednetworkmode8)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1693,6 +2294,18 @@ Obtains the preferred network for the SIM card in the specified slot. This API u ...@@ -1693,6 +2294,18 @@ Obtains the preferred network for the SIM card in the specified slot. This API u
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1724,6 +2337,18 @@ Obtains the IMS registration status of the specified IMS service type for the SI ...@@ -1724,6 +2337,18 @@ Obtains the IMS registration status of the specified IMS service type for the SI
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | | imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | Yes | Callback used to return the result. | | callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1757,6 +2382,18 @@ Obtains the IMS registration status of the specified IMS service type for the SI ...@@ -1757,6 +2382,18 @@ Obtains the IMS registration status of the specified IMS service type for the SI
| ------------------------------------- | ----------------------- | | ------------------------------------- | ----------------------- |
| Promise\<[ImsRegInfo](#imsreginfo9)\> | Promise used to return the result.| | Promise\<[ImsRegInfo](#imsreginfo9)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1789,6 +2426,18 @@ Enables listening for **imsRegStateChange** events. This API uses an asynchronou ...@@ -1789,6 +2426,18 @@ Enables listening for **imsRegStateChange** events. This API uses an asynchronou
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | | imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | Yes | Callback used to return the result. | | callback | Callback<[ImsRegInfo](#imsreginfo9)> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1818,6 +2467,18 @@ Disables listening for **imsRegStateChange** events. This API uses an asynchrono ...@@ -1818,6 +2467,18 @@ Disables listening for **imsRegStateChange** events. This API uses an asynchrono
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | | imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | No | Callback used to return the result. | | callback | Callback<[ImsRegInfo](#imsreginfo9)> | No | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1855,11 +2516,11 @@ Defines the signal strength. ...@@ -1855,11 +2516,11 @@ Defines the signal strength.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ----------------- | | --------------- | --------------------------- | ---- | ------------------ |
| signalType | [NetworkType](#networktype) | Yes | Signal strength type.| | signalType | [NetworkType](#networktype) | Yes | Signal strength type.|
| signalLevel | number | Yes | Signal strength level.| | signalLevel | number | Yes | Signal strength level.|
| dBm<sup>9+</sup>| number | Yes | Signal strength, in dBm. |
## NetworkType ## NetworkType
......
# @ohos.telephony.sim (SIM Management) # @ohos.telephony.sim (SIM)
The **sim** module provides basic SIM card management functions. You can obtain the name, number, ISO country code, home PLMN number, service provider name, SIM card status, type, installation status, activation status, and lock status of the SIM card in the specified slot. Besides, you can set the name, number, and lock status of the SIM card, activate or deactivate the SIM card, and change the PIN or unlock the PIN or PUK of the SIM card. The SIM management module provides basic SIM card management functions. You can obtain the name, number, ISO country code, home PLMN number, service provider name, SIM card status, type, installation status, activation status, and lock status of the SIM card in the specified slot. Besides, you can set the name, number, and lock status of the SIM card, activate or deactivate the SIM card, and change the PIN or unlock the PIN or PUK of the SIM card.
>**NOTE** >**NOTE**
> >
...@@ -121,7 +121,7 @@ promise.then(data => { ...@@ -121,7 +121,7 @@ promise.then(data => {
hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void
Checks whether the application (caller) has been granted the operator permission. This API uses an asynchronous callback to return the result. Checks whether the application (caller) has been granted the operator permission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -132,6 +132,18 @@ Checks whether the application (caller) has been granted the operator permission ...@@ -132,6 +132,18 @@ Checks whether the application (caller) has been granted the operator permission
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -144,7 +156,7 @@ sim.hasOperatorPrivileges(0, (err, data) => { ...@@ -144,7 +156,7 @@ sim.hasOperatorPrivileges(0, (err, data) => {
hasOperatorPrivileges(slotId: number): Promise<boolean\> hasOperatorPrivileges(slotId: number): Promise<boolean\>
Checks whether the application (caller) has been granted the carrier permission. This API uses a promise to return the result. Checks whether the application (caller) has been granted the operator permission. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -160,6 +172,18 @@ Checks whether the application (caller) has been granted the carrier permission. ...@@ -160,6 +172,18 @@ Checks whether the application (caller) has been granted the carrier permission.
| :----------------- | :---------------------------------------------------------- | | :----------------- | :---------------------------------------------------------- |
| Promise\<boolean\> | Promise used to return the result. The value **true** indicates that the application (caller) has been granted the carrier permission, and the value **false** indicates the opposite.| | Promise\<boolean\> | Promise used to return the result. The value **true** indicates that the application (caller) has been granted the carrier permission, and the value **false** indicates the opposite.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -184,7 +208,19 @@ Obtains the ISO country code of the SIM card in the specified slot. This API use ...@@ -184,7 +208,19 @@ Obtains the ISO country code of the SIM card in the specified slot. This API use
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ---------------------------------------- | | -------- | ----------------------- | ---- | ---------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. which is an ISO country code, for example, **CN** (China).| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is an ISO country code, for example, **CN** (China).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -215,6 +251,18 @@ Obtains the ISO country code of the SIM card in the specified slot. This API use ...@@ -215,6 +251,18 @@ Obtains the ISO country code of the SIM card in the specified slot. This API use
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).| | Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -231,7 +279,7 @@ promise.then(data => { ...@@ -231,7 +279,7 @@ promise.then(data => {
getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the public land mobile network (PLMN) ID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the public land mobile network \(PLMN\) ID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -242,6 +290,18 @@ Obtains the public land mobile network (PLMN) ID of the SIM card in the specifie ...@@ -242,6 +290,18 @@ Obtains the public land mobile network (PLMN) ID of the SIM card in the specifie
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -271,6 +331,18 @@ Obtains the PLMN ID of the SIM card in the specified slot. This API uses a promi ...@@ -271,6 +331,18 @@ Obtains the PLMN ID of the SIM card in the specified slot. This API uses a promi
| ----------------- | ------------------------------------------------ | | ----------------- | ------------------------------------------------ |
| Promise\<string\> | Promise used to return the result.| | Promise\<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -287,7 +359,7 @@ promise.then(data => { ...@@ -287,7 +359,7 @@ promise.then(data => {
getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the service provider name (SPN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the service provider name (SPN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -298,6 +370,18 @@ Obtains the service provider name (SPN) of the SIM card in the specified slot. T ...@@ -298,6 +370,18 @@ Obtains the service provider name (SPN) of the SIM card in the specified slot. T
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -311,7 +395,7 @@ sim.getSimSpn(0, (err, data) => { ...@@ -311,7 +395,7 @@ sim.getSimSpn(0, (err, data) => {
getSimSpn\(slotId: number\): Promise<string\> getSimSpn\(slotId: number\): Promise<string\>
Obtains the SPN of the SIM card in the specified slot. This API uses a promise to return the result. Obtains the SPN of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -327,6 +411,18 @@ Obtains the SPN of the SIM card in the specified slot. This API uses a promise t ...@@ -327,6 +411,18 @@ Obtains the SPN of the SIM card in the specified slot. This API uses a promise t
| ----------------- | ----------------------------------------- | | ----------------- | ----------------------------------------- |
| Promise\<string\> | Promise used to return the result.| | Promise\<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -343,7 +439,7 @@ promise.then(data => { ...@@ -343,7 +439,7 @@ promise.then(data => {
getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void
Obtains the status of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the state of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -354,6 +450,18 @@ Obtains the status of the SIM card in the specified slot. This API uses an async ...@@ -354,6 +450,18 @@ Obtains the status of the SIM card in the specified slot. This API uses an async
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[SimState](#simstate)\> | Yes | Callback used to return the result. For details, see [SimState](#simstate). | | callback | AsyncCallback\<[SimState](#simstate)\> | Yes | Callback used to return the result. For details, see [SimState](#simstate). |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -367,7 +475,7 @@ sim.getSimState(0, (err, data) => { ...@@ -367,7 +475,7 @@ sim.getSimState(0, (err, data) => {
getSimState\(slotId: number\): Promise<SimState\> getSimState\(slotId: number\): Promise<SimState\>
Obtains the status of the SIM card in the specified slot. This API uses a promise to return the result. Obtains the state of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
...@@ -383,6 +491,18 @@ Obtains the status of the SIM card in the specified slot. This API uses a promis ...@@ -383,6 +491,18 @@ Obtains the status of the SIM card in the specified slot. This API uses a promis
| -------------------------------- | ------------------------------------------ | | -------------------------------- | ------------------------------------------ |
| Promise\<[SimState](#simstate)\> | Promise used to return the result.| | Promise\<[SimState](#simstate)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -409,6 +529,18 @@ Obtains the type of the SIM card in the specified slot. This API uses an asynchr ...@@ -409,6 +529,18 @@ Obtains the type of the SIM card in the specified slot. This API uses an asynchr
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[CardType](#cardtype7)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[CardType](#cardtype7)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -438,6 +570,18 @@ Obtains the type of the SIM card in the specified slot. This API uses a promise ...@@ -438,6 +570,18 @@ Obtains the type of the SIM card in the specified slot. This API uses a promise
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
| Promise\<[CardType](#cardtype7)\> | Promise used to return the result.| | Promise\<[CardType](#cardtype7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -465,6 +609,18 @@ Checks whether the SIM card in the specified slot is installed. This API uses an ...@@ -465,6 +609,18 @@ Checks whether the SIM card in the specified slot is installed. This API uses an
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -494,6 +650,18 @@ Checks whether the SIM card in the specified slot is installed. This API uses a ...@@ -494,6 +650,18 @@ Checks whether the SIM card in the specified slot is installed. This API uses a
| --------------------- | ---------------------------------- | | --------------------- | ---------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result. The value **true** indicates that the SIM card in the specified slot is installed, and the value **false** indicates the opposite.| | Promise&lt;boolean&gt; | Promise used to return the result. The value **true** indicates that the SIM card in the specified slot is installed, and the value **false** indicates the opposite.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -509,7 +677,7 @@ promise.then(data => { ...@@ -509,7 +677,7 @@ promise.then(data => {
getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): void getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): void
Obtains account information of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains SIM card account information. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -524,6 +692,20 @@ Obtains account information of the SIM card in the specified slot. This API uses ...@@ -524,6 +692,20 @@ Obtains account information of the SIM card in the specified slot. This API uses
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[IccAccountInfo](#iccaccountinfo7)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[IccAccountInfo](#iccaccountinfo7)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -537,7 +719,7 @@ sim.getSimAccountInfo(0, (err, data) => { ...@@ -537,7 +719,7 @@ sim.getSimAccountInfo(0, (err, data) => {
getSimAccountInfo(slotId: number): Promise<IccAccountInfo\> getSimAccountInfo(slotId: number): Promise<IccAccountInfo\>
Obtains account information of the SIM card in the specified slot. This API uses a promise to return the result. Obtains SIM card account information. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -557,6 +739,20 @@ Obtains account information of the SIM card in the specified slot. This API uses ...@@ -557,6 +739,20 @@ Obtains account information of the SIM card in the specified slot. This API uses
| -------------------------------------------- | ------------------------------------------ | | -------------------------------------------- | ------------------------------------------ |
| Promise<[IccAccountInfo](#iccaccountinfo7)\> | Promise used to return the result.| | Promise<[IccAccountInfo](#iccaccountinfo7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -586,6 +782,19 @@ Obtains the account information list of the active SIM card. This API uses an as ...@@ -586,6 +782,19 @@ Obtains the account information list of the active SIM card. This API uses an as
| -------- | ----------------------------------------------------------- | ---- | ---------- | | -------- | ----------------------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<Array<[IccAccountInfo](#iccaccountinfo7)\>\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<Array<[IccAccountInfo](#iccaccountinfo7)\>\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -613,6 +822,19 @@ Obtains the account information list of the active SIM card. This API uses a pro ...@@ -613,6 +822,19 @@ Obtains the account information list of the active SIM card. This API uses a pro
| ---------------------------------------------------- | ---------------------------------------------- | | ---------------------------------------------------- | ---------------------------------------------- |
| Promise<Array<[IccAccountInfo](#iccaccountinfo7)\>\> | Promise used to return the result.| | Promise<Array<[IccAccountInfo](#iccaccountinfo7)\>\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -643,6 +865,20 @@ Sets the default slot ID of the SIM card that provides voice services. This API ...@@ -643,6 +865,20 @@ Sets the default slot ID of the SIM card that provides voice services. This API
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: Clears the default configuration.| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: Clears the default configuration.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301001 | SIM card is not activated. |
**Example** **Example**
```js ```js
...@@ -676,6 +912,20 @@ Sets the default slot ID of the SIM card that provides voice services. This API ...@@ -676,6 +912,20 @@ Sets the default slot ID of the SIM card that provides voice services. This API
| --------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301001 | SIM card is not activated. |
**Example** **Example**
```js ```js
...@@ -707,6 +957,19 @@ Sets a display name for the SIM card in the specified slot. This API uses an asy ...@@ -707,6 +957,19 @@ Sets a display name for the SIM card in the specified slot. This API uses an asy
| name | string | Yes | SIM card name. | | name | string | Yes | SIM card name. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -741,6 +1004,19 @@ Sets a display name for the SIM card in the specified slot. This API uses a prom ...@@ -741,6 +1004,19 @@ Sets a display name for the SIM card in the specified slot. This API uses a prom
| --------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -772,6 +1048,19 @@ Obtains the name of the SIM card in the specified slot. This API uses an asynchr ...@@ -772,6 +1048,19 @@ Obtains the name of the SIM card in the specified slot. This API uses an asynchr
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -805,6 +1094,19 @@ Obtains the name of the SIM card in the specified slot. This API uses a promise ...@@ -805,6 +1094,19 @@ Obtains the name of the SIM card in the specified slot. This API uses a promise
| --------------------- | -------------------------------------- | | --------------------- | -------------------------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -836,6 +1138,19 @@ Sets a display number for the SIM card in the specified slot. This API uses an a ...@@ -836,6 +1138,19 @@ Sets a display number for the SIM card in the specified slot. This API uses an a
| number | string | Yes | SIM card number. | | number | string | Yes | SIM card number. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -871,6 +1186,19 @@ Sets a display number for the SIM card in the specified slot. This API uses a pr ...@@ -871,6 +1186,19 @@ Sets a display number for the SIM card in the specified slot. This API uses a pr
| -------------- | ------------------------------- | | -------------- | ------------------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -902,6 +1230,19 @@ Obtains the display number of the SIM card in the specified slot. This API uses ...@@ -902,6 +1230,19 @@ Obtains the display number of the SIM card in the specified slot. This API uses
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -935,6 +1276,19 @@ Obtains the display number of the SIM card in the specified slot. This API uses ...@@ -935,6 +1276,19 @@ Obtains the display number of the SIM card in the specified slot. This API uses
| --------------------- | --------------------------------- | | --------------------- | --------------------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -950,7 +1304,7 @@ promise.then(data => { ...@@ -950,7 +1304,7 @@ promise.then(data => {
activateSim(slotId: number, callback: AsyncCallback<void\>): void activateSim(slotId: number, callback: AsyncCallback<void\>): void
Activates the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Activates a SIM card in a specified card slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -965,6 +1319,19 @@ Activates the SIM card in the specified slot. This API uses an asynchronous call ...@@ -965,6 +1319,19 @@ Activates the SIM card in the specified slot. This API uses an asynchronous call
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -998,6 +1365,19 @@ Activates the SIM card in the specified slot. This API uses a promise to return ...@@ -998,6 +1365,19 @@ Activates the SIM card in the specified slot. This API uses a promise to return
| --------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1013,7 +1393,7 @@ promise.then(data => { ...@@ -1013,7 +1393,7 @@ promise.then(data => {
deactivateSim(slotId: number, callback: AsyncCallback<void\>): void deactivateSim(slotId: number, callback: AsyncCallback<void\>): void
Deactivates the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Disables the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1028,6 +1408,19 @@ Deactivates the SIM card in the specified slot. This API uses an asynchronous ca ...@@ -1028,6 +1408,19 @@ Deactivates the SIM card in the specified slot. This API uses an asynchronous ca
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1041,7 +1434,7 @@ sim.deactivateSim(0, (err, data) => { ...@@ -1041,7 +1434,7 @@ sim.deactivateSim(0, (err, data) => {
deactivateSim(slotId: number): Promise\<void\> deactivateSim(slotId: number): Promise\<void\>
Deactivates the SIM card in the specified slot. This API uses a promise to return the result. Disables the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1061,6 +1454,19 @@ Deactivates the SIM card in the specified slot. This API uses a promise to retur ...@@ -1061,6 +1454,19 @@ Deactivates the SIM card in the specified slot. This API uses a promise to retur
| --------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1090,7 +1496,21 @@ Sets the lock status of the SIM card in the specified slot. This API uses an asy ...@@ -1090,7 +1496,21 @@ Sets the lock status of the SIM card in the specified slot. This API uses an asy
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. |
| options | [LockInfo](#lockinfo8) | Yes | Lock information.<br>- **lockType**: [LockType](#locktype8)<br>- **password**: string<br>- **state**: [LockState](#lockstate8) | | options | [LockInfo](#lockinfo8) | Yes | Lock information.<br>- lockType: [LockType](#locktype8)<br>- password: string<br>- state: [LockState](#lockstate8) |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
...@@ -1123,7 +1543,7 @@ Sets the lock status of the SIM card in the specified slot. This API uses a prom ...@@ -1123,7 +1543,7 @@ Sets the lock status of the SIM card in the specified slot. This API uses a prom
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ---------------------- | ---- | ------------------------------------------------------------ | | ------- | ---------------------- | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| options | [LockInfo](#lockinfo8) | Yes | Lock information.<br>- **lockType**: [LockType](#locktype8)<br>- **password**: string<br>- **state**: [LockState](#lockstate8) | | options | [LockInfo](#lockinfo8) | Yes | Lock information.<br>- lockType: [LockType](#locktype8)<br>- password: string<br>- state: [LockState](#lockstate8) |
**Return value** **Return value**
...@@ -1131,6 +1551,20 @@ Sets the lock status of the SIM card in the specified slot. This API uses a prom ...@@ -1131,6 +1551,20 @@ Sets the lock status of the SIM card in the specified slot. This API uses a prom
| ---------------------------------------------------- | -------------------------------------------- | | ---------------------------------------------------- | -------------------------------------------- |
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1167,6 +1601,20 @@ Obtains the lock status of the SIM card in the specified slot. This API uses an ...@@ -1167,6 +1601,20 @@ Obtains the lock status of the SIM card in the specified slot. This API uses an
| callback | AsyncCallback\<[LockState](#lockstate8)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[LockState](#lockstate8)\> | Yes | Callback used to return the result. |
| options | [LockType](#locktype8) | Yes | Lock type.<br>- **1**: PIN lock<br>- **2**: PIN 2 lock| | options | [LockType](#locktype8) | Yes | Lock type.<br>- **1**: PIN lock<br>- **2**: PIN 2 lock|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1201,6 +1649,20 @@ Obtains the lock status of the SIM card in the specified slot. This API uses a p ...@@ -1201,6 +1649,20 @@ Obtains the lock status of the SIM card in the specified slot. This API uses a p
| ---------------------------------- | -------------------------------------------- | | ---------------------------------- | -------------------------------------------- |
| Promise<[LockState](#lockstate8)\> | Promise used to return the result.| | Promise<[LockState](#lockstate8)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1233,6 +1695,20 @@ Changes the PIN of the SIM card in the specified slot. This API uses an asynchro ...@@ -1233,6 +1695,20 @@ Changes the PIN of the SIM card in the specified slot. This API uses an asynchro
| newPin | string | Yes | New PIN. | | newPin | string | Yes | New PIN. |
| oldPin | string | Yes | Old PIN. | | oldPin | string | Yes | Old PIN. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1268,6 +1744,20 @@ Changes the PIN of the SIM card in the specified slot. This API uses a promise t ...@@ -1268,6 +1744,20 @@ Changes the PIN of the SIM card in the specified slot. This API uses a promise t
| ---------------------------------------------------- | --------------------------------------------- | | ---------------------------------------------------- | --------------------------------------------- |
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1300,6 +1790,20 @@ Changes PIN 2 of the SIM card in the specified slot. This API uses an asynchrono ...@@ -1300,6 +1790,20 @@ Changes PIN 2 of the SIM card in the specified slot. This API uses an asynchrono
| newPin2 | string | Yes | New PIN. | | newPin2 | string | Yes | New PIN. |
| oldPin2 | string | Yes | Old PIN. | | oldPin2 | string | Yes | Old PIN. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1335,6 +1839,20 @@ Changes PIN 2 of the SIM card in the specified slot. This API uses a promise to ...@@ -1335,6 +1839,20 @@ Changes PIN 2 of the SIM card in the specified slot. This API uses a promise to
| ---------------------------------------------------- | --------------------------------------------- | | ---------------------------------------------------- | --------------------------------------------- |
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1350,7 +1868,7 @@ promise.then(data => { ...@@ -1350,7 +1868,7 @@ promise.then(data => {
unlockPin(slotId: number, pin: string, callback: AsyncCallback<LockStatusResponse\>): void unlockPin(slotId: number, pin: string, callback: AsyncCallback<LockStatusResponse\>): void
Unlocks PIN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Unlocks the PIN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1366,6 +1884,20 @@ Unlocks PIN of the SIM card in the specified slot. This API uses an asynchronous ...@@ -1366,6 +1884,20 @@ Unlocks PIN of the SIM card in the specified slot. This API uses an asynchronous
| pin | string | Yes | PIN of the SIM card. | | pin | string | Yes | PIN of the SIM card. |
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)> | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1401,6 +1933,20 @@ Unlocks the PIN of the SIM card in the specified slot. This API uses a promise t ...@@ -1401,6 +1933,20 @@ Unlocks the PIN of the SIM card in the specified slot. This API uses a promise t
| ---------------------------------------------------- | -------------------------------------------------- | | ---------------------------------------------------- | -------------------------------------------------- |
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1415,7 +1961,7 @@ promise.then(data => { ...@@ -1415,7 +1961,7 @@ promise.then(data => {
## sim.unlockPuk<sup>7+</sup> ## sim.unlockPuk<sup>7+</sup>
unlockPuk(slotId: number, newPin: string, puk: string ,callback: AsyncCallback<LockStatusResponse\>): void unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback<LockStatusResponse\>): void
Unlocks the PUK of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Unlocks the PUK of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
...@@ -1434,6 +1980,20 @@ Unlocks the PUK of the SIM card in the specified slot. This API uses an asynchro ...@@ -1434,6 +1980,20 @@ Unlocks the PUK of the SIM card in the specified slot. This API uses an asynchro
| puk | string | Yes | PUK of the SIM card. | | puk | string | Yes | PUK of the SIM card. |
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1471,6 +2031,20 @@ Unlocks the PUK of the SIM card in the specified slot. This API uses a promise t ...@@ -1471,6 +2031,20 @@ Unlocks the PUK of the SIM card in the specified slot. This API uses a promise t
| ---------------------------------------------------- | -------------------------------------------------- | | ---------------------------------------------------- | -------------------------------------------------- |
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1504,6 +2078,20 @@ Unlocks PIN 2 of the SIM card in the specified slot. This API uses an asynchrono ...@@ -1504,6 +2078,20 @@ Unlocks PIN 2 of the SIM card in the specified slot. This API uses an asynchrono
| pin2 | string | Yes | PIN 2 of the SIM card. | | pin2 | string | Yes | PIN 2 of the SIM card. |
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1539,6 +2127,20 @@ Unlocks PIN 2 of the SIM card in the specified slot. This API uses a promise to ...@@ -1539,6 +2127,20 @@ Unlocks PIN 2 of the SIM card in the specified slot. This API uses a promise to
| ----------------------------------------------------- | -------------------------------------------------- | | ----------------------------------------------------- | -------------------------------------------------- |
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1572,6 +2174,20 @@ Unlocks PUK 2 of the SIM card in the specified slot. This API uses an asynchrono ...@@ -1572,6 +2174,20 @@ Unlocks PUK 2 of the SIM card in the specified slot. This API uses an asynchrono
| puk2 | string | Yes | PUK 2 of the SIM card. | | puk2 | string | Yes | PUK 2 of the SIM card. |
| callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[LockStatusResponse](#lockstatusresponse7)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1609,6 +2225,20 @@ Unlocks PUK 2 of the SIM card in the specified slot. This API uses a promise to ...@@ -1609,6 +2225,20 @@ Unlocks PUK 2 of the SIM card in the specified slot. This API uses a promise to
| ---------------------------------------------------- | -------------------------------------------------- | | ---------------------------------------------------- | -------------------------------------------------- |
| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1646,7 +2276,7 @@ console.log("Result: "+ sim.getMaxSimCount()) ...@@ -1646,7 +2276,7 @@ console.log("Result: "+ sim.getMaxSimCount())
getSimIccId(slotId: number, callback: AsyncCallback<string\>): void getSimIccId(slotId: number, callback: AsyncCallback<string\>): void
Obtains the IC card identity (ICCID) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the ICCID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1661,6 +2291,19 @@ Obtains the IC card identity (ICCID) of the SIM card in the specified slot. This ...@@ -1661,6 +2291,19 @@ Obtains the IC card identity (ICCID) of the SIM card in the specified slot. This
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1694,6 +2337,19 @@ Obtains the ICCID of the SIM card in the specified slot. This API uses a promise ...@@ -1694,6 +2337,19 @@ Obtains the ICCID of the SIM card in the specified slot. This API uses a promise
| ---------------- | ------------------------------------------- | | ---------------- | ------------------------------------------- |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1724,6 +2380,19 @@ Obtains the voice mailbox alpha identifier of the SIM card in the specified slot ...@@ -1724,6 +2380,19 @@ Obtains the voice mailbox alpha identifier of the SIM card in the specified slot
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1757,6 +2426,19 @@ Obtains the voice mailbox alpha identifier of the SIM card in the specified slot ...@@ -1757,6 +2426,19 @@ Obtains the voice mailbox alpha identifier of the SIM card in the specified slot
| ---------------- | ------------------------------------------------- | | ---------------- | ------------------------------------------------- |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1787,6 +2469,19 @@ Obtains the voice mailbox number of the SIM card in the specified slot. This API ...@@ -1787,6 +2469,19 @@ Obtains the voice mailbox number of the SIM card in the specified slot. This API
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1820,6 +2515,19 @@ Obtains the voice mailbox number of the SIM card in the specified slot. This API ...@@ -1820,6 +2515,19 @@ Obtains the voice mailbox number of the SIM card in the specified slot. This API
| ---------------- | ------------------------------------------------ | | ---------------- | ------------------------------------------------ |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1831,6 +2539,7 @@ promise.then(data => { ...@@ -1831,6 +2539,7 @@ promise.then(data => {
}); });
``` ```
## sim.setVoiceMailInfo<sup>8+</sup> ## sim.setVoiceMailInfo<sup>8+</sup>
setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback<void\>): void setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback<void\>): void
...@@ -1852,6 +2561,20 @@ Sets voice mailbox information for the SIM card in the specified slot. This API ...@@ -1852,6 +2561,20 @@ Sets voice mailbox information for the SIM card in the specified slot. This API
| mailNumber | string | Yes | Voice mailbox number. | | mailNumber | string | Yes | Voice mailbox number. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1887,6 +2610,20 @@ Sets voice mailbox information for the SIM card in the specified slot. This API ...@@ -1887,6 +2610,20 @@ Sets voice mailbox information for the SIM card in the specified slot. This API
| -------------- | ----------------------- | | -------------- | ----------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -1902,7 +2639,7 @@ promise.then(data => { ...@@ -1902,7 +2639,7 @@ promise.then(data => {
getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void
Obtains the mobile subscriber ISDN number (MSISDN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the MSISDN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1917,6 +2654,19 @@ Obtains the mobile subscriber ISDN number (MSISDN) of the SIM card in the specif ...@@ -1917,6 +2654,19 @@ Obtains the mobile subscriber ISDN number (MSISDN) of the SIM card in the specif
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1950,6 +2700,19 @@ Obtains the MSISDN of the SIM card in the specified slot. This API uses a promis ...@@ -1950,6 +2700,19 @@ Obtains the MSISDN of the SIM card in the specified slot. This API uses a promis
| ---------------- | -------------------------------------------- | | ---------------- | -------------------------------------------- |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1980,6 +2743,19 @@ Obtains the group identifier level 1 (GID1) of the SIM card in the specified slo ...@@ -1980,6 +2743,19 @@ Obtains the group identifier level 1 (GID1) of the SIM card in the specified slo
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2013,6 +2789,19 @@ Obtains the GID1 of the SIM card in the specified slot. This API uses a promise ...@@ -2013,6 +2789,19 @@ Obtains the GID1 of the SIM card in the specified slot. This API uses a promise
| ---------------- | ------------------------------------------------- | | ---------------- | ------------------------------------------------- |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2043,6 +2832,19 @@ Obtains the international mobile subscriber identity (IMSI) of the SIM card in t ...@@ -2043,6 +2832,19 @@ Obtains the international mobile subscriber identity (IMSI) of the SIM card in t
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2076,6 +2878,19 @@ Obtains the IMSI of the SIM card in the specified slot. This API uses a promise ...@@ -2076,6 +2878,19 @@ Obtains the IMSI of the SIM card in the specified slot. This API uses a promise
| ---------------- | ------------------------------------------- | | ---------------- | ------------------------------------------- |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2106,6 +2921,19 @@ Obtains the carrier configuration of the SIM card in the specified slot. This AP ...@@ -2106,6 +2921,19 @@ Obtains the carrier configuration of the SIM card in the specified slot. This AP
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<Array<[OperatorConfig](#operatorconfig8)\>> | Yes | Callback used to return the result. | | callback | AsyncCallback<Array<[OperatorConfig](#operatorconfig8)\>> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2139,6 +2967,19 @@ Obtains the carrier configuration of the SIM card in the specified slot. This AP ...@@ -2139,6 +2967,19 @@ Obtains the carrier configuration of the SIM card in the specified slot. This AP
| --------------------------------------------------- | ----------------------------- | | --------------------------------------------------- | ----------------------------- |
| Promise<Array<[OperatorConfig](#operatorconfig8)\>> | Promise used to return the result.| | Promise<Array<[OperatorConfig](#operatorconfig8)\>> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2167,8 +3008,22 @@ Queries contact numbers of the SIM card in the specified slot. This API uses an ...@@ -2167,8 +3008,22 @@ Queries contact numbers of the SIM card in the specified slot. This API uses an
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ---------------------------------------------------------- | | -------- | ------------------------------------------------------------ | ---- | ---------------------------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | | type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING|
| callback | AsyncCallback<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | Yes | Callback used to return the result. | | callback | AsyncCallback<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
...@@ -2196,13 +3051,27 @@ Queries contact numbers of the SIM card in the specified slot. This API uses a p ...@@ -2196,13 +3051,27 @@ Queries contact numbers of the SIM card in the specified slot. This API uses a p
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ----------- | ---- | ---------------------------------------------------------- | | ------ | ----------- | ---- | ---------------------------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | | type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------------------------ | ------------------------------ | | ------------------------------------------------------------ | ------------------------------ |
| Promise<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | Promise used to return the result.| | Promise<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
...@@ -2236,6 +3105,20 @@ Adds contact numbers for the SIM card in the specified slot. This API uses an as ...@@ -2236,6 +3105,20 @@ Adds contact numbers for the SIM card in the specified slot. This API uses an as
| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -2274,7 +3157,21 @@ Adds contact numbers for the SIM card in the specified slot. This API uses a pro ...@@ -2274,7 +3157,21 @@ Adds contact numbers for the SIM card in the specified slot. This API uses a pro
| Type | Description | | Type | Description |
| -------------- | --------------------------- | | -------------- | --------------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
...@@ -2308,16 +3205,32 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a ...@@ -2308,16 +3205,32 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | | --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | | type | [ContactType](#contacttype8) | Yes | Contact type.<br>- 1 : GENERAL_CONTACT<br>- 2 : FIXED_DIALING |
| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
let diallingNumbersInof = { let diallingNumbersInof = {
alphaTag: "alpha", alphaTag: "alpha",
number: "138xxxxxxxx" number: "138xxxxxxxx",
recordNumber: 123,
pin2: "1234"
}; };
sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => { sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
...@@ -2342,14 +3255,28 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a ...@@ -2342,14 +3255,28 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | | --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | | type | [ContactType](#contacttype8) | Yes | Contact type.<br>- 1 : GENERAL_CONTACT<br>- 2 : FIXED_DIALING |
| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------- | --------------------------- | | -------------- | --------------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
...@@ -2383,16 +3310,32 @@ Updates contact numbers for the SIM card in the specified slot. This API uses an ...@@ -2383,16 +3310,32 @@ Updates contact numbers for the SIM card in the specified slot. This API uses an
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | | --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | | type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING|
| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
let diallingNumbersInof = { let diallingNumbersInof = {
alphaTag: "alpha", alphaTag: "alpha",
number: "138xxxxxxxx" number: "138xxxxxxxx",
recordNumber: 123,
pin2: "1234"
}; };
sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => { sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
...@@ -2417,7 +3360,7 @@ Updates contact numbers for the SIM card in the specified slot. This API uses a ...@@ -2417,7 +3360,7 @@ Updates contact numbers for the SIM card in the specified slot. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | | --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | | type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING|
| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. |
**Return value** **Return value**
...@@ -2426,14 +3369,27 @@ Updates contact numbers for the SIM card in the specified slot. This API uses a ...@@ -2426,14 +3369,27 @@ Updates contact numbers for the SIM card in the specified slot. This API uses a
| -------------- | ----------------------------- | | -------------- | ----------------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
let diallingNumbersInof = { let diallingNumbersInof = {
alphaTag: "alpha", alphaTag: "alpha",
number: "138xxxxxxxx", number: "138xxxxxxxx",
recordNumber: 123, recordNumber: 123
pin2: "1234"
}; };
let promise = sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof); let promise = sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => { promise.then(data => {
...@@ -2461,7 +3417,20 @@ Sends an envelope command to the SIM card in the specified slot. This API uses a ...@@ -2461,7 +3417,20 @@ Sends an envelope command to the SIM card in the specified slot. This API uses a
| -------- | -------------------- | ---- | -------------------------------------- | | -------- | -------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| cmd | string | Yes | Envelope command. | | cmd | string | Yes | Envelope command. |
| callback | AsyncCallback<void\> | Yes | Yes | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -2497,6 +3466,19 @@ Sends an envelope command to the SIM card in the specified slot. This API uses a ...@@ -2497,6 +3466,19 @@ Sends an envelope command to the SIM card in the specified slot. This API uses a
| -------------- | --------------------------- | | -------------- | --------------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2525,9 +3507,22 @@ Sends a terminal response command to the SIM card in the specified slot. This AP ...@@ -2525,9 +3507,22 @@ Sends a terminal response command to the SIM card in the specified slot. This AP
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------- | ---- | -------------------------------------- | | -------- | -------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| cmd | string | Yes | Command | | cmd | string | Yes | Command. |
| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2554,7 +3549,7 @@ Sends a terminal response command to the SIM card in the specified slot. This AP ...@@ -2554,7 +3549,7 @@ Sends a terminal response command to the SIM card in the specified slot. This AP
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| cmd | string | Yes | Command | | cmd | string | Yes | Command. |
**Return value** **Return value**
...@@ -2562,6 +3557,19 @@ Sends a terminal response command to the SIM card in the specified slot. This AP ...@@ -2562,6 +3557,19 @@ Sends a terminal response command to the SIM card in the specified slot. This AP
| -------------- | --------------------------- | | -------------- | --------------------------- |
| Promise<void\> | Promise used to return the result.| | Promise<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -2573,11 +3581,12 @@ promise.then(data => { ...@@ -2573,11 +3581,12 @@ promise.then(data => {
}); });
``` ```
## sim.unlockSimLock<sup>8+</sup> ## sim.unlockSimLock<sup>8+</sup>
unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<LockStatusResponse\>): void unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<LockStatusResponse\>): void
Unlocks the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Unlocks the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -2593,6 +3602,20 @@ Unlocks the SIM card in the specified slot. This API uses an asynchronous callba ...@@ -2593,6 +3602,20 @@ Unlocks the SIM card in the specified slot. This API uses an asynchronous callba
| lockInfo | [PersoLockInfo](#persolockinfo8) | Yes | Personalized lock information. | | lockInfo | [PersoLockInfo](#persolockinfo8) | Yes | Personalized lock information. |
| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | | callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -2610,7 +3633,7 @@ sim.unlockSimLock(0, persoLockInfo, (err, data) => { ...@@ -2610,7 +3633,7 @@ sim.unlockSimLock(0, persoLockInfo, (err, data) => {
unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusResponse\> unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusResponse\>
Unlocks the SIM card in the specified slot. This API uses a promise to return the result. Unlocks the SIM card in the specified slot. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -2631,6 +3654,20 @@ Unlocks the SIM card in the specified slot. This API uses a promise to return th ...@@ -2631,6 +3654,20 @@ Unlocks the SIM card in the specified slot. This API uses a promise to return th
| ---------------------------------------------------- | ------------------------- | | ---------------------------------------------------- | ------------------------- |
| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| | Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301002 | SIM card operation error. |
**Example** **Example**
```js ```js
...@@ -2652,8 +3689,6 @@ getOpKey(slotId: number, callback: AsyncCallback<string\>): void ...@@ -2652,8 +3689,6 @@ getOpKey(slotId: number, callback: AsyncCallback<string\>): void
Obtains the opkey of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. Obtains the opkey of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
**Parameters** **Parameters**
...@@ -2661,14 +3696,35 @@ Obtains the opkey of the SIM card in the specified slot. This API uses an asynch ...@@ -2661,14 +3696,35 @@ Obtains the opkey of the SIM card in the specified slot. This API uses an asynch
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | -------------------------------------- | | -------- | ---------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 801 | Capability not supported. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
sim.getOpKey(0, (err, data) => { try {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); sim.getOpKey(0, (err, data) => {
}); if (err) {
console.log("getOpKey failed, err: " + JSON.stringify(err));
} else {
console.log('getOpKey successfully, data: ' + JSON.stringify(data));
}
});
} catch (err) {
console.log("getOpKey err: " + JSON.stringify(err));
}
``` ```
...@@ -2692,15 +3748,28 @@ Obtains the opkey of the SIM card in the specified slot. This API uses a promise ...@@ -2692,15 +3748,28 @@ Obtains the opkey of the SIM card in the specified slot. This API uses a promise
| ---------------- | ----------------------------------------- | | ---------------- | ----------------------------------------- |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 801 | Capability not supported. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let promise = sim.getOpKey(0); try {
promise.then(data => { let data = sim.getOpKey(0);
console.log(`getOpKey success, promise: data->${JSON.stringify(data)}`); console.log(`getOpKey success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { } catch (error) {
console.log(`getOpKey failed, promise: err->${JSON.stringify(err)}`); console.log(`getOpKey failed, promise: err->${JSON.stringify(error)}`);
}); }
``` ```
## sim.getOpName<sup>9+</sup> ## sim.getOpName<sup>9+</sup>
...@@ -2718,12 +3787,33 @@ Obtains the OpName of the SIM card in the specified slot. This API uses an async ...@@ -2718,12 +3787,33 @@ Obtains the OpName of the SIM card in the specified slot. This API uses an async
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 801 | Capability not supported. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
sim.getOpName(0, (err, data) => { try {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); sim.getOpName(0, (err, data) => {
}); if (err) {
console.log("getOpName failed, err: " + JSON.stringify(err));
} else {
console.log('getOpName successfully, data: ' + JSON.stringify(data));
}
});
} catch (err) {
console.log("getOpName err: " + JSON.stringify(err));
}
``` ```
...@@ -2747,15 +3837,28 @@ Obtains the OpName of the SIM card in the specified slot. This API uses a promis ...@@ -2747,15 +3837,28 @@ Obtains the OpName of the SIM card in the specified slot. This API uses a promis
| ---------------- | ------------------------------------------ | | ---------------- | ------------------------------------------ |
| Promise<string\> | Promise used to return the result.| | Promise<string\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 801 | Capability not supported. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
let promise = sim.getOpName(0); try {
promise.then(data => { let data = sim.getOpName(0);
console.log(`getOpName success, promise: data->${JSON.stringify(data)}`); console.log(`getOpName success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { } catch (error) {
console.log(`getOpName failed, promise: err->${JSON.stringify(err)}`); console.log(`getOpName failed, promise: err->${JSON.stringify(error)}`);
}); }
``` ```
## SimState ## SimState
...@@ -2781,16 +3884,16 @@ Enumerates SIM card types. ...@@ -2781,16 +3884,16 @@ Enumerates SIM card types.
| Name| Value| Description| | Name| Value| Description|
| ----- | ----- | ----- | | ----- | ----- | ----- |
|UNKNOWN_CARD | -1 | Unknown| |UNKNOWN_CARD | -1 | Unknown type.|
|SINGLE_MODE_SIM_CARD | 10 | Single-card (SIM)| |SINGLE_MODE_SIM_CARD | 10 | Single-card (SIM).|
|SINGLE_MODE_USIM_CARD | 20 | Single-card (USIM)| |SINGLE_MODE_USIM_CARD | 20 | Single-card (USIM).|
|SINGLE_MODE_RUIM_CARD | 30 | Single-card (RUIM)| |SINGLE_MODE_RUIM_CARD | 30 | Single-card (RUIM).|
|DUAL_MODE_CG_CARD | 40 | Dual-card (CDMA+GSM)| |DUAL_MODE_CG_CARD | 40 | Dual-card (CDMA+GSM).|
|CT_NATIONAL_ROAMING_CARD | 41 | China Telecom internal roaming card| |CT_NATIONAL_ROAMING_CARD | 41 | China Telecom internal roaming card.|
|CU_DUAL_MODE_CARD | 42 | China Unicom dual-mode card| |CU_DUAL_MODE_CARD | 42 | China Unicom dual-mode card.|
|DUAL_MODE_TELECOM_LTE_CARD | 43 | China Telecom dual-mode LTE card| |DUAL_MODE_TELECOM_LTE_CARD | 43 | China Telecom dual-mode LTE card.|
|DUAL_MODE_UG_CARD | 50 | Dual-mode card (UMTS+GSM)| |DUAL_MODE_UG_CARD | 50 | Dual-mode card (UMTS+GSM).|
|SINGLE_MODE_ISIM_CARD<sup>8+</sup> | 60 | Single-card (ISIM)| |SINGLE_MODE_ISIM_CARD<sup>8+</sup> | 60 | Single-card (ISIM).|
## LockType<sup>8+</sup> ## LockType<sup>8+</sup>
...@@ -2841,30 +3944,30 @@ Enumerates personalized lock types. ...@@ -2841,30 +3944,30 @@ Enumerates personalized lock types.
## LockStatusResponse<sup>7+</sup> ## LockStatusResponse<sup>7+</sup>
Defines the lock status response. Defines the personalized lock information.
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | --------------- | ------ | ---- | --------------------- |
| result | number | Yes | Operation result. | | result | number | Yes | Operation result. |
| remain?: number | number | Yes | Remaining attempts (can be null).| | remain?: number | number | No | Remaining attempts (can be null).|
## LockInfo<sup>8+</sup> ## LockInfo<sup>8+</sup>
Defines the lock information. Defines the personalized lock information.
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | -------- | ------------------------ | ---- | -------- |
| lockType | [LockType](#locktype8) | Yes | Lock type.| | lockType | [LockType](#locktype8) | Yes | Lock type.|
| password | string | Yes | Password. | | password | string | Yes | Password. |
| state | [LockState](#lockstate8) | Yes | Lock state.| | state | [LockState](#lockstate8) | Yes | Lock state.|
## PersoLockInfo<sup>8+</sup> ## PersoLockInfo<sup>8+</sup>
...@@ -2874,10 +3977,10 @@ Defines the personalized lock information. ...@@ -2874,10 +3977,10 @@ Defines the personalized lock information.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | -------- | -------------------------------- | ---- | ------------- |
| lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.| | lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.|
| password | string | Yes | Password. | | password | string | Yes | Password. |
## IccAccountInfo<sup>7+</sup> ## IccAccountInfo<sup>7+</sup>
...@@ -2887,15 +3990,15 @@ Defines the ICC account information. ...@@ -2887,15 +3990,15 @@ Defines the ICC account information.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | ---------- | ------- | ---- | ---------------- |
| simId | number | Yes | SIM card ID. | | simId | number | Yes | SIM card ID. |
| slotIndex | number | Yes | Card slot ID. | | slotIndex | number | Yes | Card slot ID. |
| isEsim | boolean | Yes | Whether the SIM card is an eSim card.| | isEsim | boolean | Yes | Whether the SIM card is an eSim card.|
| isActive | boolean | Yes | Whether the card is activated. | | isActive | boolean | Yes | Whether the card is activated. |
| iccId | string | Yes | ICCID number. | | iccId | string | Yes | ICCID number. |
| showName | string | Yes | SIM card display name. | | showName | string | Yes | SIM card display name. |
| showNumber | string | Yes | SIM card display number. | | showNumber | string | Yes | SIM card display number. |
## OperatorConfig<sup>8+</sup> ## OperatorConfig<sup>8+</sup>
...@@ -2905,10 +4008,10 @@ Defines the carrier configuration. ...@@ -2905,10 +4008,10 @@ Defines the carrier configuration.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description|
| -------- | ------- | --------- | ----------- | | ----- | ------ | ---- | ---- |
| field | string | Yes | Field. | | field | string | Yes | Field.|
| value | string | Yes | Value. | | value | string | Yes | Value. |
## DiallingNumbersInfo<sup>8+</sup> ## DiallingNumbersInfo<sup>8+</sup>
...@@ -2918,12 +4021,12 @@ Defines the contact number information. ...@@ -2918,12 +4021,12 @@ Defines the contact number information.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | ------------ | ------ | ---- | ---------- |
| alphaTag | string | Yes | Alpha tag. | | alphaTag | string | Yes | Tag. |
| number | string | Yes | Contact number. | | number | string | Yes | Call transfer number. |
| recordNumber | number | Yes | Record number.| | recordNumber | number | Yes | Record number.|
| pin2 | string | Yes | PIN 2.| | pin2 | string | Yes | PIN 2.|
## ContactType<sup>8+</sup> ## ContactType<sup>8+</sup>
...@@ -2934,7 +4037,7 @@ Enumerates contact types. ...@@ -2934,7 +4037,7 @@ Enumerates contact types.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description | | Name | Value | Description |
| -------------- | ---- | ---------- | | --------------- | ---- | ---------- |
| GENERAL_CONTACT | 1 | Common contact number.| | GENERAL_CONTACT | 1 | Common contact number.|
| FIXED_DIALING | 2 | Fixed dialing number. | | FIXED_DIALING | 2 | Fixed dialing number. |
...@@ -2946,8 +4049,8 @@ Enumerates carrier configuration keys. ...@@ -2946,8 +4049,8 @@ Enumerates carrier configuration keys.
**System capability**: SystemCapability.Telephony.CoreService **System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description | | Name | Value | Description |
| ------------------------------------------------------- | ---------------------------------------------------- | -------------------- | | ------------------------------------------------------- | ------------------------------------------------------ | -------------------- |
| KEY_VOICE_MAIL_NUMBER_STRING | "voice_mail_number_string" | Voice mailbox number. | | KEY_VOICE_MAIL_NUMBER_STRING | "voice_mail_number_string" | Voice mailbox number. |
| KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL | "ims_switch_on_by_default_bool" | Fixed dialing number. | | KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL | "ims_switch_on_by_default_bool" | Fixed dialing number. |
| KEY_HIDE_IMS_SWITCH_BOOL | "hide_ims_switch_bool" | Whether to hide the IMS switch. | | KEY_HIDE_IMS_SWITCH_BOOL | "hide_ims_switch_bool" | Whether to hide the IMS switch. |
...@@ -2960,7 +4063,7 @@ Enumerates carrier configuration keys. ...@@ -2960,7 +4063,7 @@ Enumerates carrier configuration keys.
| KEY_IMS_PREFER_FOR_EMERGENCY_BOOL | "ims_prefer_for_emergency_bool" | IMS preferences for emergency. | | KEY_IMS_PREFER_FOR_EMERGENCY_BOOL | "ims_prefer_for_emergency_bool" | IMS preferences for emergency. |
| KEY_CALL_WAITING_SERVICE_CLASS_INT | "call_waiting_service_class_int" | Call waiting service. | | KEY_CALL_WAITING_SERVICE_CLASS_INT | "call_waiting_service_class_int" | Call waiting service. |
| KEY_CALL_TRANSFER_VISIBILITY_BOOL | "call_transfer_visibility_bool" | Call transfer visibility. | | KEY_CALL_TRANSFER_VISIBILITY_BOOL | "call_transfer_visibility_bool" | Call transfer visibility. |
| KEY_IMS_CALL_DISCONNECT_REASONINFO_MAPPING_STRING_ARRAY | "ims_call_disconnect_reasoninfo_mapping_string_array" | List of IMS call disconnection reasons.| | KEY_IMS_CALL_DISCONNECT_REASON_INFO_MAPPING_STRING_ARRAY| "ims_call_disconnect_reason_info_mapping_string_array" | List of IMS call disconnection reasons.|
| KEY_FORCE_VOLTE_SWITCH_ON_BOOL | "force_volte_switch_on_bool" | Whether to forcibly turn on VoLTE. | | KEY_FORCE_VOLTE_SWITCH_ON_BOOL | "force_volte_switch_on_bool" | Whether to forcibly turn on VoLTE. |
| KEY_ENABLE_OPERATOR_NAME_CUST_BOOL | "enable_operator_name_cust_bool" | Whether to display the carrier name.| | KEY_ENABLE_OPERATOR_NAME_CUST_BOOL | "enable_operator_name_cust_bool" | Whether to display the carrier name.|
| KEY_OPERATOR_NAME_CUST_STRING | "operator_name_cust_string" | Carrier name. | | KEY_OPERATOR_NAME_CUST_STRING | "operator_name_cust_string" | Carrier name. |
......
...@@ -16,7 +16,7 @@ import sms from '@ohos.telephony.sms'; ...@@ -16,7 +16,7 @@ import sms from '@ohos.telephony.sms';
createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncCallback<ShortMessage\>\): void createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncCallback<ShortMessage\>\): void
Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This API uses an asynchronous callback to return the result. Creates an SMS instance based on the protocol data unit (PDU) and specified SMS protocol. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -44,7 +44,7 @@ sms.createMessage(pdu, specification, (err, data) => { ...@@ -44,7 +44,7 @@ sms.createMessage(pdu, specification, (err, data) => {
createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortMessage\> createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortMessage\>
Creates an SMS message instance based on the PDU and the specified SMS protocol. This API uses a promise to return the result. Creates an SMS instance based on the PDU and specified SMS protocol. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -81,7 +81,7 @@ sendMessage(options: SendMessageOptions): void ...@@ -81,7 +81,7 @@ sendMessage(options: SendMessageOptions): void
Sends an SMS message. Sends an SMS message.
**Required permission**: ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -114,7 +114,7 @@ sms.sendMessage(options); ...@@ -114,7 +114,7 @@ sms.sendMessage(options);
getDefaultSmsSlotId\(callback: AsyncCallback&lt;number&gt;\): void getDefaultSmsSlotId\(callback: AsyncCallback&lt;number&gt;\): void
Obtains the default slot of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result. Obtains the default slot ID of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -122,7 +122,7 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use ...@@ -122,7 +122,7 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ---------------------------------------- | | -------- | --------------------------- | ---- | ---------------------------------------- |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the result. <br>- **0**: card slot 1<br>- **1**: card slot 2| | callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the result.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Example** **Example**
...@@ -137,7 +137,7 @@ sms.getDefaultSmsSlotId((err, data) => { ...@@ -137,7 +137,7 @@ sms.getDefaultSmsSlotId((err, data) => {
getDefaultSmsSlotId\(\): Promise&lt;number&gt; getDefaultSmsSlotId\(\): Promise&lt;number&gt;
Obtains the default slot of the SIM card used to send SMS messages. This API uses a promise to return the result. Obtains the default slot ID of the SIM card used to send SMS messages. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -162,11 +162,11 @@ promise.then(data => { ...@@ -162,11 +162,11 @@ promise.then(data => {
setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback&lt;void&gt;\): void
Sets the default slot of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result. Sets the default slot ID of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permissions**: ohos.permission.SET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -174,9 +174,22 @@ Sets the default slot of the SIM card used to send SMS messages. This API uses a ...@@ -174,9 +174,22 @@ Sets the default slot of the SIM card used to send SMS messages. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------------------------------ | | -------- | ------------------------- | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: clearing the default configuration| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: Clears the default configuration.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -190,11 +203,11 @@ sms.setDefaultSmsSlotId(0, (err, data) => { ...@@ -190,11 +203,11 @@ sms.setDefaultSmsSlotId(0, (err, data) => {
setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt; setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt;
Sets the default slot of the SIM card used to send SMS messages. This API uses a promise to return the result. Sets the default slot ID of the SIM card used to send SMS messages. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE **Required permissions**: ohos.permission.SET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -202,13 +215,26 @@ Sets the default slot of the SIM card used to send SMS messages. This API uses a ...@@ -202,13 +215,26 @@ Sets the default slot of the SIM card used to send SMS messages. This API uses a
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ | | ------ | ------ | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: clearing the default configuration| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: Clears the default configuration.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| -------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result. | | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -229,7 +255,7 @@ Sets the short message service center (SMSC) address. This API uses an asynchron ...@@ -229,7 +255,7 @@ Sets the short message service center (SMSC) address. This API uses an asynchron
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission) **Required permissions**: ohos.permission.SET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -241,6 +267,18 @@ Sets the short message service center (SMSC) address. This API uses an asynchron ...@@ -241,6 +267,18 @@ Sets the short message service center (SMSC) address. This API uses an asynchron
| smscAddr | string | Yes | SMSC address. | | smscAddr | string | Yes | SMSC address. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -260,7 +298,7 @@ Sets the SMSC address. This API uses a promise to return the result. ...@@ -260,7 +298,7 @@ Sets the SMSC address. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission) **Required permissions**: ohos.permission.SET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -277,6 +315,18 @@ Sets the SMSC address. This API uses a promise to return the result. ...@@ -277,6 +315,18 @@ Sets the SMSC address. This API uses a promise to return the result.
| ------------------- | ------------------------------- | | ------------------- | ------------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -299,7 +349,7 @@ Obtains the SMSC address. This API uses an asynchronous callback to return the r ...@@ -299,7 +349,7 @@ Obtains the SMSC address. This API uses an asynchronous callback to return the r
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission) **Required permissions**: ohos.permission.GET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -310,6 +360,18 @@ Obtains the SMSC address. This API uses an asynchronous callback to return the r ...@@ -310,6 +360,18 @@ Obtains the SMSC address. This API uses an asynchronous callback to return the r
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -328,7 +390,7 @@ Obtains the SMSC address. This API uses a promise to return the result. ...@@ -328,7 +390,7 @@ Obtains the SMSC address. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission) **Required permissions**: ohos.permission.GET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -344,6 +406,18 @@ Obtains the SMSC address. This API uses a promise to return the result. ...@@ -344,6 +406,18 @@ Obtains the SMSC address. This API uses a promise to return the result.
| --------------------- | --------------------------------------------- | | --------------------- | --------------------------------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -360,7 +434,7 @@ promise.then(data => { ...@@ -360,7 +434,7 @@ promise.then(data => {
hasSmsCapability(): boolean hasSmsCapability(): boolean
Checks whether the current device can send and receive SMS messages. This API returns the result synchronously. Checks whether the current device can send and receive SMS messages. This API works in synchronous mode.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -383,7 +457,7 @@ Splits an SMS message into multiple segments. This API uses an asynchronous call ...@@ -383,7 +457,7 @@ Splits an SMS message into multiple segments. This API uses an asynchronous call
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -394,6 +468,18 @@ Splits an SMS message into multiple segments. This API uses an asynchronous call ...@@ -394,6 +468,18 @@ Splits an SMS message into multiple segments. This API uses an asynchronous call
| content | string | Yes | SMS message content. The value cannot be null.| | content | string | Yes | SMS message content. The value cannot be null.|
| callback | AsyncCallback<Array<string\>> | Yes | Callback used to return the result. | | callback | AsyncCallback<Array<string\>> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -412,7 +498,7 @@ Splits an SMS message into multiple segments. This API uses a promise to return ...@@ -412,7 +498,7 @@ Splits an SMS message into multiple segments. This API uses a promise to return
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -428,6 +514,18 @@ Splits an SMS message into multiple segments. This API uses a promise to return ...@@ -428,6 +514,18 @@ Splits an SMS message into multiple segments. This API uses a promise to return
| ----------------------- | ----------------------------------- | | ----------------------- | ----------------------------------- |
| Promise<Array<string\>> | Promise used to return the result.| | Promise<Array<string\>> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -448,7 +546,7 @@ Adds a SIM message. This API uses an asynchronous callback to return the result. ...@@ -448,7 +546,7 @@ Adds a SIM message. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -459,6 +557,18 @@ Adds a SIM message. This API uses an asynchronous callback to return the result. ...@@ -459,6 +557,18 @@ Adds a SIM message. This API uses an asynchronous callback to return the result.
| options | [SimMessageOptions](#simmessageoptions7) | Yes | SIM message options.| | options | [SimMessageOptions](#simmessageoptions7) | Yes | SIM message options.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -482,7 +592,7 @@ Adds a SIM message. This API uses a promise to return the result. ...@@ -482,7 +592,7 @@ Adds a SIM message. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -498,6 +608,18 @@ Adds a SIM message. This API uses a promise to return the result. ...@@ -498,6 +608,18 @@ Adds a SIM message. This API uses a promise to return the result.
| ------------------- | ----------------------------- | | ------------------- | ----------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -523,7 +645,7 @@ Deletes a SIM message. This API uses an asynchronous callback to return the resu ...@@ -523,7 +645,7 @@ Deletes a SIM message. This API uses an asynchronous callback to return the resu
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -535,6 +657,18 @@ Deletes a SIM message. This API uses an asynchronous callback to return the resu ...@@ -535,6 +657,18 @@ Deletes a SIM message. This API uses an asynchronous callback to return the resu
| msgIndex | number | Yes | Message index. | | msgIndex | number | Yes | Message index. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -554,7 +688,7 @@ Deletes a SIM message. This API uses a promise to return the result. ...@@ -554,7 +688,7 @@ Deletes a SIM message. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -571,6 +705,18 @@ Deletes a SIM message. This API uses a promise to return the result. ...@@ -571,6 +705,18 @@ Deletes a SIM message. This API uses a promise to return the result.
| ------------------- | ----------------------------- | | ------------------- | ----------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -592,7 +738,7 @@ Updates a SIM message. This API uses an asynchronous callback to return the resu ...@@ -592,7 +738,7 @@ Updates a SIM message. This API uses an asynchronous callback to return the resu
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -603,6 +749,18 @@ Updates a SIM message. This API uses an asynchronous callback to return the resu ...@@ -603,6 +749,18 @@ Updates a SIM message. This API uses an asynchronous callback to return the resu
| options | [UpdateSimMessageOptions](#updatesimmessageoptions7) | Yes | SIM message updating options.| | options | [UpdateSimMessageOptions](#updatesimmessageoptions7) | Yes | SIM message updating options.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -627,7 +785,7 @@ Updates a SIM message. This API uses a promise to return the result. ...@@ -627,7 +785,7 @@ Updates a SIM message. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES **Required permissions**: ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -643,6 +801,18 @@ Updates a SIM message. This API uses a promise to return the result. ...@@ -643,6 +801,18 @@ Updates a SIM message. This API uses a promise to return the result.
| ------------------- | ----------------------------- | | ------------------- | ----------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -669,7 +839,7 @@ Obtains all SIM card messages. This API uses an asynchronous callback to return ...@@ -669,7 +839,7 @@ Obtains all SIM card messages. This API uses an asynchronous callback to return
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS **Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -680,6 +850,18 @@ Obtains all SIM card messages. This API uses an asynchronous callback to return ...@@ -680,6 +850,18 @@ Obtains all SIM card messages. This API uses an asynchronous callback to return
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<Array<[SimShortMessage](#simshortmessage7)\>> | Yes | Callback used to return the result. | | callback | AsyncCallback<Array<[SimShortMessage](#simshortmessage7)\>> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -698,7 +880,7 @@ Obtains all SIM card messages. This API uses a promise to return the result. ...@@ -698,7 +880,7 @@ Obtains all SIM card messages. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS **Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -714,6 +896,18 @@ Obtains all SIM card messages. This API uses a promise to return the result. ...@@ -714,6 +896,18 @@ Obtains all SIM card messages. This API uses a promise to return the result.
| ------------------------------------------------------- | ---------------------------------- | | ------------------------------------------------------- | ---------------------------------- |
| PromiseArray<[SimShortMessage](#simshortmessage7)\>&gt; | Promise used to return the result.| | PromiseArray<[SimShortMessage](#simshortmessage7)\>&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -734,7 +928,7 @@ Sets the cell broadcast configuration. This API uses an asynchronous callback to ...@@ -734,7 +928,7 @@ Sets the cell broadcast configuration. This API uses an asynchronous callback to
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS **Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -745,6 +939,18 @@ Sets the cell broadcast configuration. This API uses an asynchronous callback to ...@@ -745,6 +939,18 @@ Sets the cell broadcast configuration. This API uses an asynchronous callback to
| options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.| | options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -769,7 +975,7 @@ Sets the cell broadcast configuration. This API uses a promise to return the res ...@@ -769,7 +975,7 @@ Sets the cell broadcast configuration. This API uses a promise to return the res
**System API**: This is a system API. **System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS **Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -785,6 +991,18 @@ Sets the cell broadcast configuration. This API uses a promise to return the res ...@@ -785,6 +991,18 @@ Sets the cell broadcast configuration. This API uses a promise to return the res
| ------------------- | ----------------------------- | | ------------------- | ----------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -820,7 +1038,18 @@ Obtains SMS message segment information. This API uses an asynchronous callback ...@@ -820,7 +1038,18 @@ Obtains SMS message segment information. This API uses an asynchronous callback
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| message | string | Yes | SMS message. | | message | string | Yes | SMS message. |
| force7bit | boolean | Yes | Whether to use 7-bit coding. | | force7bit | boolean | Yes | Whether to use 7-bit coding. |
| callback | | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[SmsSegmentsInfo](#smssegmentsinfo8)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -847,14 +1076,25 @@ Obtains SMS message segment information. This API uses a promise to return the r ...@@ -847,14 +1076,25 @@ Obtains SMS message segment information. This API uses a promise to return the r
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ------- | ---- | ----------------------------------------- | | --------- | ------- | ---- | ----------------------------------------- |
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| message | string | Yes | Message | | message | string | Yes | SMS message. |
| force7bit | boolean | Yes | Whether to use 7-bit coding. | | force7bit | boolean | Yes | Whether to use 7-bit coding. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------------------------------------------- | ----------------------------- | | ------------------------------------------------------- | ----------------------------- |
| | Promise used to return the result.| | Promise&lt;[SmsSegmentsInfo](#smssegmentsinfo8)&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
...@@ -885,6 +1125,17 @@ Checks whether SMS is supported on IMS. This API uses an asynchronous callback t ...@@ -885,6 +1125,17 @@ Checks whether SMS is supported on IMS. This API uses an asynchronous callback t
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -899,7 +1150,7 @@ sms.isImsSmsSupported(slotId, (err, data) => { ...@@ -899,7 +1150,7 @@ sms.isImsSmsSupported(slotId, (err, data) => {
isImsSmsSupported(slotId: number): Promise<boolean\> isImsSmsSupported(slotId: number): Promise<boolean\>
Checks whether SMS is supported on IMS. This API uses a promise to return the result. This API uses an asynchronous callback to return the result. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -917,6 +1168,17 @@ Checks whether SMS is supported on IMS. This API uses a promise to return the re ...@@ -917,6 +1168,17 @@ Checks whether SMS is supported on IMS. This API uses a promise to return the re
| ---------------------- | ----------------------- | | ---------------------- | ----------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -945,6 +1207,18 @@ Obtains the SMS format supported by the IMS. This API uses an asynchronous callb ...@@ -945,6 +1207,18 @@ Obtains the SMS format supported by the IMS. This API uses an asynchronous callb
| -------- | --------------------------- | ---- | ---------- | | -------- | --------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -970,6 +1244,18 @@ Obtains the SMS format supported by the IMS. This API uses a promise to return t ...@@ -970,6 +1244,18 @@ Obtains the SMS format supported by the IMS. This API uses a promise to return t
| --------------------- | -------------------------- | | --------------------- | -------------------------- |
| Promise&lt;string&gt; | Promise used to return the result. | | Promise&lt;string&gt; | Promise used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -998,6 +1284,17 @@ Decodes MMS messages. This API uses an asynchronous callback to return the resul ...@@ -998,6 +1284,17 @@ Decodes MMS messages. This API uses an asynchronous callback to return the resul
| mmsFilePathName | string \|Array<number\> | Yes | MMS message file path.| | mmsFilePathName | string \|Array<number\> | Yes | MMS message file path.|
| callback | AsyncCallback&lt;[MmsInformation](#mmsinformation8)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[MmsInformation](#mmsinformation8)&gt; | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1030,6 +1327,17 @@ Decodes MMS messages. This API uses a promise to return the result. ...@@ -1030,6 +1327,17 @@ Decodes MMS messages. This API uses a promise to return the result.
| --------------------------------------------------------- | --------------------------- | | --------------------------------------------------------- | --------------------------- |
| Promise&lt;&lt;[MmsInformation](#mmsinformation8)&gt;&gt; | Promise used to return the result.| | Promise&lt;&lt;[MmsInformation](#mmsinformation8)&gt;&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1046,7 +1354,7 @@ promise.then(data => { ...@@ -1046,7 +1354,7 @@ promise.then(data => {
encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void
Encodes MMS messages. This API uses an asynchronous callback to return the result. MMS message code. This API uses an asynchronous callback to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1059,6 +1367,17 @@ Encodes MMS messages. This API uses an asynchronous callback to return the resul ...@@ -1059,6 +1367,17 @@ Encodes MMS messages. This API uses an asynchronous callback to return the resul
| mms | [MmsInformation](#mmsinformation8) | Yes | MMS message information.| | mms | [MmsInformation](#mmsinformation8) | Yes | MMS message information.|
| callback | AsyncCallback&lt;Array<number\>&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;Array<number\>&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1081,7 +1400,7 @@ sms.encodeMms(mmsInformation, (err, data) => { ...@@ -1081,7 +1400,7 @@ sms.encodeMms(mmsInformation, (err, data) => {
encodeMms(mms: MmsInformation): Promise<Array<number\>> encodeMms(mms: MmsInformation): Promise<Array<number\>>
Encodes MMS messages. This API uses a promise to return the result. MMS message code. This API uses a promise to return the result.
**System API**: This is a system API. **System API**: This is a system API.
...@@ -1099,6 +1418,17 @@ Encodes MMS messages. This API uses a promise to return the result. ...@@ -1099,6 +1418,17 @@ Encodes MMS messages. This API uses a promise to return the result.
| ----------------------------- | ----------------------------------- | | ----------------------------- | ----------------------------------- |
| Promise&lt;Array<number\>&gt; | Promise used to return the result.| | Promise&lt;Array<number\>&gt; | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -1125,19 +1455,19 @@ Defines an SMS message instance. ...@@ -1125,19 +1455,19 @@ Defines an SMS message instance.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------- | --------- | ----------- | | ------------------------ | --------------------------------------- | ---- | ------------------------------------------------------------ |
| hasReplyPath | boolean | Yes |Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: The device returns a response based on the SMSC that sends the SMS message.| | hasReplyPath | boolean | Yes | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>TP-Reply-Path: The device returns a response based on the SMSC that sends the SMS message. |
| isReplaceMessage | boolean | Yes |Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.| | isReplaceMessage | boolean | Yes | Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.|
| isSmsStatusReportMessage | boolean | Yes |Whether the received SMS message is an SMS delivery status report. The default value is **false**.<br>**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.| | isSmsStatusReportMessage | boolean | Yes | Whether the received SMS message is an SMS delivery report. The default value is **false**.<br>SMS delivery report: a message sent from the SMSC to show the current status of the SMS message you delivered.|
| messageClass | [ShortMessageClass](#shortmessageclass) | Yes | SMS message type. | | messageClass | [ShortMessageClass](#shortmessageclass) | Yes | Enumerates SMS message types. |
| pdu | Array&lt;number&gt; | Yes | PDU in the SMS message. | | pdu | Array&lt;number&gt; | Yes | PDU in the SMS message. |
| protocolId | number | Yes | Protocol identifier used for delivering the SMS message. | | protocolId | number | Yes | Protocol identifier used for delivering the SMS message. |
| scAddress | string | Yes | SMSC address. | | scAddress | string | Yes | SMSC address. |
| scTimestamp | number | Yes | SMSC timestamp. | | scTimestamp | number | Yes | SMSC timestamp. |
| status | number | Yes | SMS message status sent by the SMSC in the **SMS-STATUS-REPORT** message.| | status | number | Yes | SMS message status sent by the SMSC in the **SMS-STATUS-REPORT** message.|
| visibleMessageBody | string | Yes | SMS message body. | | visibleMessageBody | string | Yes | SMS message body. |
| visibleRawAddress | string | Yes | Sender address. | | visibleRawAddress | string | Yes | Sender address. |
## ShortMessageClass ## ShortMessageClass
...@@ -1161,7 +1491,7 @@ Provides the options (including callbacks) for sending an SMS message. For examp ...@@ -1161,7 +1491,7 @@ Provides the options (including callbacks) for sending an SMS message. For examp
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| destinationHost | string | Yes | Destination address of the SMS message. | | destinationHost | string | Yes | Destination address of the SMS message. |
...@@ -1178,22 +1508,22 @@ Provides the callback for the SMS message sending result. It consists of three p ...@@ -1178,22 +1508,22 @@ Provides the callback for the SMS message sending result. It consists of three p
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------------- | ---- | ------------------------------------------------------------ | | ---------- | ------------------------------- | ---- | ----------------------------------------------------------------------------------------- |
| isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.| | isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.|
| result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. | | result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. |
| url | string | Yes | URI for storing the sent SMS message. | | url | string | Yes | URI for storing the sent SMS message. |
## IDeliveryShortMessageCallback ## IDeliveryShortMessageCallback
Provides the callback for the SMS message delivery report. Provides the callback for the SMS message delivery report.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------- | ---- | -------------- | | ---- | ------------------- | ---- | -------------- |
| pdu | Array&lt;number&gt; | Yes | SMS message delivery report.| | pdu | Array&lt;number&gt; | Yes | SMS message delivery report.|
## SendSmsResult ## SendSmsResult
...@@ -1209,7 +1539,6 @@ Enumerates SMS message sending results. ...@@ -1209,7 +1539,6 @@ Enumerates SMS message sending results.
| SEND_SMS_FAILURE_RADIO_OFF | 2 | Failed to send the SMS message because the modem is shut down. | | SEND_SMS_FAILURE_RADIO_OFF | 2 | Failed to send the SMS message because the modem is shut down. |
| SEND_SMS_FAILURE_SERVICE_UNAVAILABLE | 3 | Failed to send the SMS message because the network is unavailable or SMS message sending or receiving is not supported.| | SEND_SMS_FAILURE_SERVICE_UNAVAILABLE | 3 | Failed to send the SMS message because the network is unavailable or SMS message sending or receiving is not supported.|
## MmsInformation<sup>8+</sup> ## MmsInformation<sup>8+</sup>
Defines the MMS message information. Defines the MMS message information.
...@@ -1218,10 +1547,10 @@ Defines the MMS message information. ...@@ -1218,10 +1547,10 @@ Defines the MMS message information.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------------------------------------------ | ---- | --------- | | ----------- | ------------------------------------------------------------ | ---- | ---------- |
| messageType | [MessageType](#messagetype8) | Yes | Message type. | | messageType | [MessageType](#messagetype8) | Yes | Message type.|
| mmsType | [MmsSendReq](#mmssendreq8) \|[MmsSendConf](#mmssendconf8) \|[MmsNotificationInd](#mmsnotificationind8) \|[MmsRespInd](#mmsrespind8) \|[MmsRetrieveConf](#mmsretrieveconf8)\|[MmsAcknowledgeInd](#mmsacknowledgeind8)\|[MmsDeliveryInd](#mmsdeliveryind8)\|[MmsReadOrigInd](#mmsreadorigind8)\|[MmsReadRecInd](#mmsreadrecind8)| Yes | PDU header type.| | mmsType | [MmsSendReq](#mmssendreq8) \|[MmsSendConf](#mmssendconf8) \|[MmsNotificationInd](#mmsnotificationind8) \|[MmsRespInd](#mmsrespind8) \|[MmsRetrieveConf](#mmsretrieveconf8)\|[MmsAcknowledgeInd](#mmsacknowledgeind8)\|[MmsDeliveryInd](#mmsdeliveryind8)\|[MmsReadOrigInd](#mmsreadorigind8)\|[MmsReadRecInd](#mmsreadrecind8) | Yes | PDU header type.|
| attachment | Array<[MmsAttachment](#mmsattachment8)\> | No | Attachment. | | attachment | Array<[MmsAttachment](#mmsattachment8)\> | No | Attachment. |
## MmsSendReq<sup>8+</sup> ## MmsSendReq<sup>8+</sup>
...@@ -1232,13 +1561,13 @@ Defines an MMS message sending request. ...@@ -1232,13 +1561,13 @@ Defines an MMS message sending request.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------- | ------------------------------------ | ---- | ------------ | | ---------------- | ------------------------------------ | ---- | ------------ |
| from | [MmsAddress](#mmsaddress8) | Yes | MMS message source. | | from | [MmsAddress](#mmsaddress8) | Yes | MMS message source. |
| transactionId | string | Yes | Transaction ID. | | transactionId | string | Yes | Transaction ID. |
| contentType | string | Yes | Content type. | | contentType | string | Yes | Content type. |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| to | Array<[MmsAddress](#mmsaddress8)\> | No | Address to which the message is sent. | | to | Array<[MmsAddress](#mmsaddress8)\> | No | Destination address. |
| date | number | No | Date. | | date | number | No | Date. |
| cc | Array<[MmsAddress](#mmsaddress8)\> | No | Carbon copy. | | cc | Array<[MmsAddress](#mmsaddress8)\> | No | Carbon copy. |
| bcc | Array<[MmsAddress](#mmsaddress8)\> | No | Blind carbon copy. | | bcc | Array<[MmsAddress](#mmsaddress8)\> | No | Blind carbon copy. |
...@@ -1258,7 +1587,7 @@ Defines the MMS message sending configuration. ...@@ -1258,7 +1587,7 @@ Defines the MMS message sending configuration.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------- | ---------------------------------- | ---- | -------- | | ------------- | ---------------------------------- | ---- | -------- |
| responseState | number | Yes | Response status.| | responseState | number | Yes | Response status.|
| transactionId | string | Yes | Transaction ID. | | transactionId | string | Yes | Transaction ID. |
...@@ -1273,7 +1602,7 @@ Defines an MMS notification index. ...@@ -1273,7 +1602,7 @@ Defines an MMS notification index.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | ---------------------------------- | ---- | -------- | | --------------- | ---------------------------------- | ---- | -------- |
| transactionId | string | Yes | Transaction ID. | | transactionId | string | Yes | Transaction ID. |
| messageClass | number | Yes | Message class. | | messageClass | number | Yes | Message class. |
...@@ -1281,7 +1610,7 @@ Defines an MMS notification index. ...@@ -1281,7 +1610,7 @@ Defines an MMS notification index.
| expiry | number | Yes | Expiration. | | expiry | number | Yes | Expiration. |
| contentLocation | string | Yes | Content location.| | contentLocation | string | Yes | Content location.|
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| from | [MmsAddress](#mmsaddress8) | No | Source. | | from | [MmsAddress](#mmsaddress8) | No | Source address. |
| subject | string | No | Subject. | | subject | string | No | Subject. |
| deliveryReport | number | No | Status report.| | deliveryReport | number | No | Status report.|
| contentClass | number | No | Content class. | | contentClass | number | No | Content class. |
...@@ -1294,7 +1623,7 @@ Defines an MMS confirmation index. ...@@ -1294,7 +1623,7 @@ Defines an MMS confirmation index.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------- | ---------------------------------- | ---- | -------- | | ------------- | ---------------------------------- | ---- | -------- |
| transactionId | string | Yes | Transaction ID. | | transactionId | string | Yes | Transaction ID. |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
...@@ -1308,15 +1637,15 @@ Defines the MMS message retrieval configuration. ...@@ -1308,15 +1637,15 @@ Defines the MMS message retrieval configuration.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | ------------------------------------ | ---- | -------- | | -------------- | ------------------------------------ | ---- | -------- |
| transactionId | string | Yes | Transaction ID. | | transactionId | string | Yes | Transaction ID. |
| messageId | string | Yes | Message ID. | | messageId | string | Yes | Message ID. |
| date | number | Yes | Date. | | date | number | Yes | Date. |
| contentType | string | Yes | Content type.| | contentType | string | Yes | Content type.|
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Address to which the message is sent. | | to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address. |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| from | [MmsAddress](#mmsaddress8) | No | Source. | | from | [MmsAddress](#mmsaddress8) | No | Source address. |
| cc | Array<[MmsAddress](#mmsaddress8)\> | No | Carbon copy. | | cc | Array<[MmsAddress](#mmsaddress8)\> | No | Carbon copy. |
| subject | string | No | Subject. | | subject | string | No | Subject. |
| priority | [MmsPriorityType](#mmsprioritytype8) | No | Priority. | | priority | [MmsPriorityType](#mmsprioritytype8) | No | Priority. |
...@@ -1333,16 +1662,15 @@ Defines the original MMS message reading index. ...@@ -1333,16 +1662,15 @@ Defines the original MMS message reading index.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ---------------------------------- | ---- | -------- | | ---------- | ---------------------------------- | ---- | -------- |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| messageId | string | Yes | Message ID. | | messageId | string | Yes | Message ID. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Address to which the message is sent. | | to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source. | | from | [MmsAddress](#mmsaddress8) | Yes | Source address. |
| date | number | Yes | Date. | | date | number | Yes | Date. |
| readStatus | number | Yes | Read status.| | readStatus | number | Yes | Read status.|
## MmsReadRecInd<sup>8+</sup> ## MmsReadRecInd<sup>8+</sup>
Defines the MMS message reading index. Defines the MMS message reading index.
...@@ -1351,16 +1679,15 @@ Defines the MMS message reading index. ...@@ -1351,16 +1679,15 @@ Defines the MMS message reading index.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ---------------------------------- | ---- | -------- | | ---------- | ---------------------------------- | ---- | -------- |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| messageId | string | Yes | Message ID. | | messageId | string | Yes | Message ID. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination. | | to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source. | | from | [MmsAddress](#mmsaddress8) | Yes | Source address. |
| readStatus | number | Yes | Read state.| | readStatus | number | Yes | Read status.|
| date | number | No | Date. | | date | number | No | Date. |
## MmsAttachment<sup>8+</sup> ## MmsAttachment<sup>8+</sup>
Defines the attachment of an MMS message. Defines the attachment of an MMS message.
...@@ -1369,7 +1696,7 @@ Defines the attachment of an MMS message. ...@@ -1369,7 +1696,7 @@ Defines the attachment of an MMS message.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------------------- | ------------------------------------ | ---- | ------------------ | | ----------------------- | ------------------------------------ | ---- | ------------------ |
| contentId | string | Yes | Content ID. | | contentId | string | Yes | Content ID. |
| contentLocation | string | Yes | Content location. | | contentLocation | string | Yes | Content location. |
...@@ -1378,7 +1705,7 @@ Defines the attachment of an MMS message. ...@@ -1378,7 +1705,7 @@ Defines the attachment of an MMS message.
| contentType | string | Yes | Content type. | | contentType | string | Yes | Content type. |
| isSmil | boolean | Yes | Whether the synchronized multimedia integration language is used.| | isSmil | boolean | Yes | Whether the synchronized multimedia integration language is used.|
| path | string | No | Path. | | path | string | No | Path. |
| inBuff | Array<number\> | No | In the buffer | | inBuff | Array<number\> | No | Whether the message is in the buffer. |
| fileName | string | No | File name. | | fileName | string | No | File name. |
| charset | [MmsCharSets](#mmscharsets8) | No | Character set. | | charset | [MmsCharSets](#mmscharsets8) | No | Character set. |
...@@ -1390,20 +1717,20 @@ Defines an MMSC address. ...@@ -1390,20 +1717,20 @@ Defines an MMSC address.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ---------------------------- | ---- | ------ | | ------- | ---------------------------- | ---- | ------ |
| address | string | Yes | MMSC address. | | address | string | Yes | Network address. |
| charset | [MmsCharSets](#mmscharsets8) | Yes | Character set.| | charset | [MmsCharSets](#mmscharsets8) | Yes | Character set.|
## MessageType<sup>8+</sup> ## MessageType<sup>8+</sup>
Enumerates message types. Message type.
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| ------------------------- | ---- | -------------------- | | ------------------------- | ---- | -------------------- |
| TYPE_MMS_SEND_REQ | 128 | MMS message sending request. | | TYPE_MMS_SEND_REQ | 128 | MMS message sending request. |
| TYPE_MMS_SEND_CONF | 129 | MMS message sending configuration. | | TYPE_MMS_SEND_CONF | 129 | MMS message sending configuration. |
...@@ -1423,7 +1750,7 @@ Enumerates MMS message priorities. ...@@ -1423,7 +1750,7 @@ Enumerates MMS message priorities.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| ---------- | ---- | -------------- | | ---------- | ---- | -------------- |
| MMS_LOW | 128 | Low priority. | | MMS_LOW | 128 | Low priority. |
| MMS_NORMAL | 129 | Normal priority.| | MMS_NORMAL | 129 | Normal priority.|
...@@ -1437,7 +1764,7 @@ Enumerates MMS versions. ...@@ -1437,7 +1764,7 @@ Enumerates MMS versions.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| --------------- | ---- | ----------- | | --------------- | ---- | ----------- |
| MMS_VERSION_1_0 | 0x10 | MMS version 1_0.| | MMS_VERSION_1_0 | 0x10 | MMS version 1_0.|
| MMS_VERSION_1_1 | 0x11 | MMS version 1_1.| | MMS_VERSION_1_1 | 0x11 | MMS version 1_1.|
...@@ -1452,7 +1779,7 @@ Enumerates MMS character sets. ...@@ -1452,7 +1779,7 @@ Enumerates MMS character sets.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| --------------- | ------ | ------------------- | | --------------- | ------ | ------------------- |
| BIG5 | 0X07EA | BIG5 format. | | BIG5 | 0X07EA | BIG5 format. |
| ISO_10646_UCS_2 | 0X03E8 | ISO_10646_UCS_2 format.| | ISO_10646_UCS_2 | 0X03E8 | ISO_10646_UCS_2 format.|
...@@ -1477,7 +1804,7 @@ Enumerates disposition types. ...@@ -1477,7 +1804,7 @@ Enumerates disposition types.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| ---------- | ---- | -------- | | ---------- | ---- | -------- |
| FROM_DATA | 0 | Data source.| | FROM_DATA | 0 | Data source.|
| ATTACHMENT | 1 | Attachment. | | ATTACHMENT | 1 | Attachment. |
...@@ -1491,7 +1818,7 @@ Enumerates report types. ...@@ -1491,7 +1818,7 @@ Enumerates report types.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description| | Name | Value | Description|
| ------- | ---- | ---- | | ------- | ---- | ---- |
| MMS_YES | 128 | YES | | MMS_YES | 128 | YES |
| MMS_NO | 129 | NO | | MMS_NO | 129 | NO |
...@@ -1504,7 +1831,7 @@ Defines the cell broadcast configuration options. ...@@ -1504,7 +1831,7 @@ Defines the cell broadcast configuration options.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------- | -------------------- | ---- | ------------ | | -------------- | -------------------- | ---- | ------------ |
| slotId | number | Yes | Card slot ID. | | slotId | number | Yes | Card slot ID. |
| enable | boolean | Yes | Whether to enable cell broadcast. | | enable | boolean | Yes | Whether to enable cell broadcast. |
...@@ -1520,7 +1847,7 @@ Defines the SIM message status. ...@@ -1520,7 +1847,7 @@ Defines the SIM message status.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| ------------------------- | ---- | --------------------------- | | ------------------------- | ---- | --------------------------- |
| SIM_MESSAGE_STATUS_FREE | 0 | Free state. | | SIM_MESSAGE_STATUS_FREE | 0 | Free state. |
| SIM_MESSAGE_STATUS_READ | 1 | Read state. | | SIM_MESSAGE_STATUS_READ | 1 | Read state. |
...@@ -1530,13 +1857,13 @@ Defines the SIM message status. ...@@ -1530,13 +1857,13 @@ Defines the SIM message status.
## RanType<sup>7+</sup> ## RanType<sup>7+</sup>
Enumerates RAN types. RAN type.
**System API**: This is a system API. **System API**: This is a system API.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description| | Name | Value | Description|
| --------- | ---- | ---- | | --------- | ---- | ---- |
| TYPE_GSM | 1 | GSM | | TYPE_GSM | 1 | GSM |
| TYPE_CDMA | 2 | CMDA | | TYPE_CDMA | 2 | CMDA |
...@@ -1549,7 +1876,7 @@ Enumerates SMS encoding schemes. ...@@ -1549,7 +1876,7 @@ Enumerates SMS encoding schemes.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Value | Description | | Name | Value | Description |
| -------------------- | ---- | ------------ | | -------------------- | ---- | ------------ |
| SMS_ENCODING_UNKNOWN | 0 | Unknown code.| | SMS_ENCODING_UNKNOWN | 0 | Unknown code.|
| SMS_ENCODING_7BIT | 1 | 7-digit code. | | SMS_ENCODING_7BIT | 1 | 7-digit code. |
...@@ -1564,12 +1891,12 @@ Defines the SIM message options. ...@@ -1564,12 +1891,12 @@ Defines the SIM message options.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name| Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | -------------- | | ------ | -------------------------------------- | ---- | -------------- |
| slotId | number | Yes | Card slot ID. | | slotId | number | Yes | Card slot ID. |
| smsc | string | Yes | Short message service center.| | smsc | string | Yes | Short message service center.|
| pdu | string | Yes | Protocol data unit. | | pdu | string | Yes | Protocol data unit. |
| status | [SimMessageStatus](#simmessagestatus7) | Yes | Message status. | | status | [SimMessageStatus](#simmessagestatus7) | Yes | Status. |
## UpdateSimMessageOptions<sup>7+</sup> ## UpdateSimMessageOptions<sup>7+</sup>
...@@ -1579,7 +1906,7 @@ Defines the updating SIM message options. ...@@ -1579,7 +1906,7 @@ Defines the updating SIM message options.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | -------------------------------------- | ---- | -------------- | | --------- | -------------------------------------- | ---- | -------------- |
| slotId | number | Yes | Card slot ID. | | slotId | number | Yes | Card slot ID. |
| msgIndex | number | Yes | Message index. | | msgIndex | number | Yes | Message index. |
...@@ -1595,7 +1922,7 @@ Defines a SIM message. ...@@ -1595,7 +1922,7 @@ Defines a SIM message.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------- | -------------------------------------- | ---- | ------------- | | ---------------- | -------------------------------------- | ---- | ------------- |
| shortMessage | [ShortMessage](#shortmessage) | Yes | SMS message. | | shortMessage | [ShortMessage](#shortmessage) | Yes | SMS message. |
| simMessageStatus | [SimMessageStatus](#simmessagestatus7) | Yes | SIM message status.| | simMessageStatus | [SimMessageStatus](#simmessagestatus7) | Yes | SIM message status.|
...@@ -1609,12 +1936,12 @@ Defines an MMS message delivery index. ...@@ -1609,12 +1936,12 @@ Defines an MMS message delivery index.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ---------------------------------- | ---- | ------ | | --------- | ---------------------------------- | ---- | ------ |
| messageId | string | Yes | Message ID.| | messageId | string | Yes | Message ID.|
| date | number | Yes | Date. | | date | number | Yes | Date. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Address to which the message is sent.| | to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address.|
| status | number | Yes | Status. | | status | number | Yes | Status |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
## MmsRespInd<sup>8+</sup> ## MmsRespInd<sup>8+</sup>
...@@ -1625,7 +1952,7 @@ Defines an MMS response index. ...@@ -1625,7 +1952,7 @@ Defines an MMS response index.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------- | ---------------------------------- | ---- | -------- | | ------------- | ---------------------------------- | ---- | -------- |
| transactionId | string | Yes | Event ID. | | transactionId | string | Yes | Event ID. |
| status | number | Yes | Status. | | status | number | Yes | Status. |
...@@ -1640,7 +1967,7 @@ Defines the SMS message segment information. ...@@ -1640,7 +1967,7 @@ Defines the SMS message segment information.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------------- | ---------------------------------------- | ---- | ------------ | | -------------------- | ---------------------------------------- | ---- | ------------ |
| splitCount | number | Yes | Split count. | | splitCount | number | Yes | Split count. |
| encodeCount | number | Yes | Encoding count. | | encodeCount | number | Yes | Encoding count. |
......
# @ohos.telephony.data (Cellular Data) # @ohos.telephony.data (Cellular Data)
The **data** module provides basic mobile data management functions. You can obtain and set the default slot of the SIM card used for mobile data, and obtain the uplink and downlink connection status of cellular data services and connection status of the packet switched (PS) domain. Besides, you can check whether cellular data services and data roaming are enabled. The cellular data module provides basic mobile data management functions. You can obtain and set the default slot of the SIM card used for mobile data, and obtain the uplink and downlink connection status of cellular data services and connection status of the packet switched (PS) domain. Besides, you can check whether cellular data services and data roaming are enabled.
>**NOTE** >**NOTE**
> >
...@@ -98,6 +98,20 @@ This is a system API. ...@@ -98,6 +98,20 @@ This is a system API.
| slotId | number | Yes | SIM card slot ID. <br>**0**: card slot 1<br>**1**: card slot 2<br>**-1**: Clears the default configuration.| | slotId | number | Yes | SIM card slot ID. <br>**0**: card slot 1<br>**1**: card slot 2<br>**-1**: Clears the default configuration.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301001 | SIM card is not activated. |
**Example** **Example**
```js ```js
...@@ -130,6 +144,20 @@ This is a system API. ...@@ -130,6 +144,20 @@ This is a system API.
| --------------- | ------------------------------- | | --------------- | ------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300004 | Do not have sim card. |
| 8300999 | Unknown error code. |
| 8301001 | SIM card is not activated. |
**Example** **Example**
```js ```js
...@@ -251,6 +279,18 @@ Checks whether the cellular data service is enabled. This API uses an asynchrono ...@@ -251,6 +279,18 @@ Checks whether the cellular data service is enabled. This API uses an asynchrono
| -------- | ------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>**true**: The cellular data service is enabled.<br>**false**: The cellular data service is disabled.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>**true**: The cellular data service is enabled.<br>**false**: The cellular data service is disabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -275,6 +315,18 @@ Checks whether the cellular data service is enabled. This API uses a promise to ...@@ -275,6 +315,18 @@ Checks whether the cellular data service is enabled. This API uses a promise to
| ------------------ | ------------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result.<br>**true**: The cellular data service is enabled.<br>**false**: The cellular data service is disabled.| | Promise\<boolean\> | Promise used to return the result.<br>**true**: The cellular data service is enabled.<br>**false**: The cellular data service is disabled.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -303,6 +355,18 @@ Checks whether roaming is enabled for the cellular data service. This API uses a ...@@ -303,6 +355,18 @@ Checks whether roaming is enabled for the cellular data service. This API uses a
| slotId | number | Yes | Card slot ID.<br>**0**: card slot 1<br>**1**: card slot 2 | | slotId | number | Yes | Card slot ID.<br>**0**: card slot 1<br>**1**: card slot 2 |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>**true**: Roaming is enabled for the cellular data service.<br>**false**: Roaming is disabled for the cellular data service.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>**true**: Roaming is enabled for the cellular data service.<br>**false**: Roaming is disabled for the cellular data service.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -333,6 +397,18 @@ Checks whether roaming is enabled for the cellular data service. This API uses a ...@@ -333,6 +397,18 @@ Checks whether roaming is enabled for the cellular data service. This API uses a
| ------------------ | ------------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result.<br>**true**: Roaming is enabled for the cellular data service.<br>**false**: Roaming is disabled for the cellular data service.| | Promise\<boolean\> | Promise used to return the result.<br>**true**: Roaming is enabled for the cellular data service.<br>**false**: Roaming is disabled for the cellular data service.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -362,6 +438,18 @@ This is a system API. ...@@ -362,6 +438,18 @@ This is a system API.
| -------- | --------------------- | ---- | ---------- | | -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -388,6 +476,18 @@ This is a system API. ...@@ -388,6 +476,18 @@ This is a system API.
| --------------- | ----------------------- | | --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -417,6 +517,18 @@ This is a system API. ...@@ -417,6 +517,18 @@ This is a system API.
| -------- | --------------------- | ---- | ---------- | | -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -443,6 +555,18 @@ This is a system API. ...@@ -443,6 +555,18 @@ This is a system API.
| --------------- | --------------------------- | | --------------- | --------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -473,6 +597,18 @@ This is a system API. ...@@ -473,6 +597,18 @@ This is a system API.
| slotId | number | Yes | Card slot ID.<br>**0**: card slot 1<br>**1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>**0**: card slot 1<br>**1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -505,6 +641,18 @@ This is a system API. ...@@ -505,6 +641,18 @@ This is a system API.
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -535,6 +683,18 @@ This is a system API. ...@@ -535,6 +683,18 @@ This is a system API.
| slotId | number | Yes | Card slot ID.<br>**0**: card slot 1<br>**1**: card slot 2| | slotId | number | Yes | Card slot ID.<br>**0**: card slot 1<br>**1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
...@@ -567,6 +727,18 @@ This is a system API. ...@@ -567,6 +727,18 @@ This is a system API.
| --------------- | ------------------------- | | --------------- | ------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Error codes**
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).
| ID| Error Message |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**Example** **Example**
```js ```js
......
# Telephony Error Codes
## 8300001 Input Parameter Value Out of Range
**Error Message**
The input parameter value is out of range.
**Description**
This error code is reported if the value of the input parameter (for example, **slotId**) is not within the valid range. In this case, the API call will fail and the corresponding operation cannot be performed.
**Cause**
The input parameter value is invalid.
**Solution**
Enter a valid parameter value.
## 8300002 Service Connection Error
**Error Message**
Operation failed. Cannot connect to service.
**Description**
This error code is reported if the attempt to connect to a service fails.
**Cause**
Service startup or IPC connection has failed.
**Solution**
Operation error. Try again later.
## 8300003 System Internal Error
**Error Message**
System internal error.
**Description**
This error code is reported if an internal error has occurred.
**Cause**
The possible cause is that data read/write has failed because the network is abnormal.
**Solution**
Operation error. Try again later.
## 8300004 SIM Card Not Detected
**Error Message**
Do not have sim card.
**Description**
This error code is reported if no SIM card is detected.
**Cause**
No SIM card is inserted or the SIM card is not properly inserted.
**Solution**
Insert the SIM card or remove and insert the SIM card again.
## 8300999 Unknown Error
**Error Message**
Unknown error code.
**Description**
This error code is reported if an unknown error occurs.
**Cause**
An unexpected error occurs in the system. The possible cause is that error codes of the bottom layer are not within the processing range.
**Solution**
Operation error. Try again later.
## 8301001 SIM Card Not Activated
**Error Message**
SIM card is not activated.
**Description**
This error code is reported if the SIM card is not activated.
**Cause**
The SIM card is not activated.
**Solution**
Activate the SIM card.
## 8301002 Failed to Read or Update SIM Card Data
**Error Message**
SIM card operation error.
**Description**
This error code is reported if the attempt to read or update SIM card data has failed.
**Cause**
The SIM card does not support the operation, or the SIM card is damaged.
**Solution**
Contact the SIM card supplier, or replace the SIM card.
## 8301003 Incorrect SIM Card Configuration
**Error Message**
Operator config error.
**Description**
This error code is reported if the SIM card configuration is incorrect.
**Cause**
The configuration file delivered with the SIM card is not properly preconfigured.
**Solution**
Check whether the correct SIM card is inserted.
## 8401001 Failed to Connect to the UT
**Error Message**
UT is not connected.
**Description**
This error code is reported if the UT is not connected.
**Cause**
The current carrier does not support sending of UT requests over a Wi-Fi network, but the mobile phone is connected to the Wi-Fi network.
**Solution**
Disconnect the Wi-Fi connection, and send a new UT request.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册