未验证 提交 e32c956b 编写于 作者: O openharmony_ci 提交者: Gitee

!15631 翻译已完成15320+15169+14959+14880+14188+14202

Merge pull request !15631 from shawn_he/15320-b
# DFX
- Application Event Logging
- [Development of Application Event Logging](hiappevent-guidelines.md)
- Performance Tracing
- [Development of Performance Tracing](hitracemeter-guidelines.md)
- Distributed Call Chain Tracing
- [Development of Distributed Call Chain Tracing](hitracechain-guidelines.md)
- [Development of Application Event Logging](hiappevent-guidelines.md)
- [Development of Performance Tracing](hitracemeter-guidelines.md)
- [Development of Distributed Call Chain Tracing](hitracechain-guidelines.md)
- Error Management
- [Development of Error Manager](errormanager-guidelines.md)
- [Development of Application Recovery](apprecovery-guidelines.md)
......@@ -134,7 +134,7 @@ After the callback triggers **appRecovery.saveAppState()**, **onSaveState(state,
- Restore data.
After the callback triggers **appRecovery.restartApp()**, the application is restarted. After the restart, **onSaveState(state, wantParams)** of **MainAbility** is called, and the saved data is in **parameters** of **want**.
After the callback triggers **appRecovery.restartApp()**, the application is restarted. After the restart, **onCreate(want, launchParam)** of **MainAbility** is called, and the saved data is in **parameters** of **want**.
```ts
storage: LocalStorage
......
......@@ -37,10 +37,10 @@ When an asynchronous callback is used, the return value can be processed directl
## Development Example
```ts
import Ability from '@ohos.application.Ability'
import errorManager from '@ohos.application.errorManager'
import errorManager from '@ohos.app.ability.errorManager';
var registerId = -1;
var callback = {
let registerId = -1;
let callback = {
onUnhandledException: function (errMsg) {
console.log(errMsg);
}
......@@ -48,13 +48,13 @@ var callback = {
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate")
registerId = errorManager.registerErrorObserver(callback);
registerId = errorManager.on("error", callback);
globalThis.abilityWant = want;
}
onDestroy() {
console.log("[Demo] MainAbility onDestroy")
errorManager.unregisterErrorObserver(registerId, (result) => {
errorManager.off("error", registerId, (result) => {
console.log("[Demo] result " + result.code + ";" + result.message)
});
}
......
......@@ -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).
>**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.
## Modules to Import
```js
import call from '@ohos.telephony.call';
```
## call.dial
## call.dial<sup>(deprecated)</sup>
dial\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void
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
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ---------------------------- | ---- | -------------------------------- |
| Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| 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**
......@@ -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
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
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
| options | [DialOptions](#dialoptions) | No | 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 |
| 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|
**Example**
......@@ -69,28 +69,28 @@ call.dial("138xxxxxxxx", {
```
## call.dial
## call.dial<sup>(deprecated)</sup>
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
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | -------------------------------------- |
| 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**
| 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**
......@@ -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>
makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void
......@@ -115,10 +251,21 @@ Launches the call screen and displays the dialed number. This API uses an asynch
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | ------------------------- | ---- | ------------------------------------------ |
| 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**
......@@ -139,15 +286,26 @@ Launches the call screen and displays the dialed number. This API uses a promise
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------- |
| phoneNumber | string | Yes | Phone number. |
| phoneNumber | string | Yes | Phone number.|
**Return value**
| 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**
......@@ -170,9 +328,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to
**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**
......@@ -195,7 +353,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu
| Type | Description |
| ---------------------- | --------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result. |
| Promise&lt;boolean&gt; | Promise used to return the result.|
**Example**
......@@ -219,9 +377,9 @@ Obtains the call status. This API uses an asynchronous callback to return the re
**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**
......@@ -244,7 +402,7 @@ Obtains the call status. This API uses a promise to return the result.
| 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**
......@@ -269,7 +427,7 @@ Checks whether a device supports voice calls.
| 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
let result = call.hasVoiceCapability();
......@@ -286,10 +444,21 @@ Checks whether the called number is an emergency number. This API uses an asynch
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| 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**
......@@ -304,17 +473,28 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
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
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------------- | ---- | -------------------------------------------- |
| Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | No | Phone number options. |
| 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. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone 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**
......@@ -329,22 +509,33 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, data) => {
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
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------------- | ---- | -------------- |
| phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number options. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | No | Phone number.|
**Return value**
| 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**
......@@ -369,10 +560,21 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ------------------------------------ |
| 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**
......@@ -386,7 +588,7 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
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.
......@@ -394,11 +596,22 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. |
| options | [NumberFormatOptions](#numberformatoptions7) | No | Number formatting options, for example, country code. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting options, for example, country code. |
| 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**
......@@ -415,7 +628,7 @@ call.formatPhoneNumber("138xxxxxxxx", {
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.
......@@ -423,16 +636,27 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | -------------------------------------------- | ---- | ---------------------- |
| 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**
| 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**
......@@ -459,11 +683,22 @@ The phone number must match the specified country code. For example, for a China
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ----------------------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
| 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**
......@@ -488,16 +723,27 @@ All country codes are supported.
**Parameters**
| Name | Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------------------------------------- |
| 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**
| 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**
......@@ -514,9 +760,9 @@ promise.then(data => {
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
......@@ -528,6 +774,17 @@ This is a system API.
| ----------- | ------------------------- | ---- | ---------- |
| 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**
```js
......@@ -541,9 +798,9 @@ call.muteRinger((err, data) => {
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
......@@ -555,6 +812,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -566,13 +835,14 @@ promise.then(data => {
});
```
## call.answer<sup>7+</sup>
answer\(callId: number, callback: AsyncCallback<void\>\): void
## call.answerCall<sup>7+</sup>
Answers a call based on the specified call ID. This API uses an asynchronous callback to return the result.
answerCall\(callId: number, callback: AsyncCallback<void\>\): void
This is a system API.
Answers a call. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -585,22 +855,34 @@ This is a system API.
| 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. |
**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.answer(1, (err, data) => {
call.answerCall(1, (err, 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
......@@ -618,24 +900,37 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
let promise = call.answer(1);
let promise = call.answerCall(1);
promise.then(data => {
console.log(`answer success, promise: data->${JSON.stringify(data)}`);
console.log(`answerCall success, promise: data->${JSON.stringify(data)}`);
}).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
This is a system API.
Answers a call. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -645,25 +940,36 @@ This is a system API.
| 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.|
**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.hangup(1, (err, data) => {
call.answerCall((err, 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
......@@ -673,24 +979,37 @@ This is a system API.
| 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. |
**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.answer((err, data) => {
call.hangUpCall(1, (err, 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
......@@ -708,24 +1027,37 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
let promise = call.hangup(1);
let promise = call.hangUpCall(1);
promise.then(data => {
console.log(`hangup success, promise: data->${JSON.stringify(data)}`);
console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`);
}).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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -737,22 +1069,35 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- |
| 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.hangup((err, data) => {
call.hangUpCall((err, 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
......@@ -765,22 +1110,35 @@ This is a system API.
| 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. |
**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.reject(1, (err, data) => {
call.rejectCall(1, (err, 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>
Rejects a call based on the specified call ID and options. This API uses an asynchronous callback to return the result.
rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
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
......@@ -794,25 +1152,37 @@ This is a system API.
| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message. |
| 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
let rejectMessageOptions={
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)}`);
});
```
## 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
......@@ -831,28 +1201,40 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
let rejectMessageOptions={
messageContent: "Unknown number blocked"
}
let promise = call.reject(1, rejectMessageOptions);
let promise = call.rejectCall(1, rejectMessageOptions);
promise.then(data => {
console.log(`reject success, promise: data->${JSON.stringify(data)}`);
console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`);
}).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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -864,22 +1246,34 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- |
| 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
call.reject((err, data) => {
call.rejectCall((err, 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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -892,13 +1286,25 @@ This is a system API.
| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message.|
| 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
let rejectMessageOptions={
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)}`);
});
```
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -923,6 +1329,18 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -956,6 +1374,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -986,6 +1416,18 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
......@@ -1019,6 +1461,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -1036,7 +1490,7 @@ switchCall\(callId: number, callback: AsyncCallback<void\>\): void
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
......@@ -1049,6 +1503,18 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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
......@@ -1064,7 +1530,7 @@ switchCall\(callId: number\): Promise<void\>
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
......@@ -1082,6 +1548,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1110,6 +1588,17 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1141,6 +1630,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1169,6 +1669,18 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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**
```js
......@@ -1184,7 +1696,7 @@ getMainCallId\(callId: number\): Promise<number\>
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
......@@ -1200,6 +1712,17 @@ This is a system API.
| ------------------- | ------------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1228,6 +1751,17 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1259,6 +1793,17 @@ This is a system API.
| ----------------------------- | ----------------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1287,6 +1832,17 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1318,6 +1874,17 @@ This is a system API.
| ----------------------------- | --------------------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
......@@ -1346,7 +1913,19 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| 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**
......@@ -1363,7 +1942,7 @@ getCallWaitingStatus\(slotId: number\): Promise<CallWaitingStatus\>
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
......@@ -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.|
**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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -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.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1446,6 +2049,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -1461,9 +2076,9 @@ promise.then(data => {
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
......@@ -1475,6 +2090,17 @@ This is a system API.
| character | string | Yes | DTMF code. |
| 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**
```js
......@@ -1490,7 +2116,7 @@ startDTMF\(callId: number, character: string\): Promise<void\>
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
......@@ -1507,6 +2133,17 @@ This is a system API.
| ------------------- | ----------------------- |
| 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**
```js
......@@ -1524,7 +2161,7 @@ stopDTMF\(callId: number, callback: AsyncCallback<void\>\): void
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
......@@ -1535,6 +2172,17 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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**
```js
......@@ -1550,7 +2198,7 @@ stopDTMF\(callId: number\): Promise<void\>
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
......@@ -1566,6 +2214,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1595,6 +2254,18 @@ This is a system API.
| -------- | ---------------------------- | ---- | ---------- |
| 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**
```js
......@@ -1610,7 +2281,7 @@ isInEmergencyCall\(\): Promise<boolean\>
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
......@@ -1622,6 +2293,18 @@ This is a system API.
| ---------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1652,6 +2335,18 @@ This is a system API.
| type | string | Yes | Call details change during a call.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1679,6 +2374,18 @@ This is a system API.
| type | string | Yes | Call event change during a call.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1706,6 +2413,18 @@ This is a system API.
| type | string | Yes | Cause of the call disconnection.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1733,6 +2452,18 @@ This is a system API.
| type | string | Yes | Man-machine interface (MMI) code 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1757,9 +2488,21 @@ This is a system API.
| 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. |
**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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1787,6 +2530,18 @@ This is a system API.
| type | string | Yes | Unsubscription from call event changes when a call ends.|
| 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**
```js
......@@ -1801,7 +2556,7 @@ off\(type: 'callDisconnectedCause', callback?: Callback<DisconnectedDetails\>\):
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
......@@ -1814,6 +2569,18 @@ This is a system API.
| type | 'callDisconnectedCause' | Yes | Unsubscription from the call disconnection cause when a call ends.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -1841,6 +2608,18 @@ This is a system API.
| type | 'mmiCodeResult' | Yes | MMI code 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -1865,6 +2644,17 @@ This is a system API.
| -------- | ---------------------------- | ---- | ---------- |
| 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**
```js
......@@ -1880,7 +2670,7 @@ isNewCallAllowed\(\): Promise<boolean\>
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
......@@ -1890,6 +2680,17 @@ This is a system API.
| ---------------------- | --------------------------- |
| 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**
```js
......@@ -1905,9 +2706,9 @@ promise.then(data => {
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
......@@ -1918,6 +2719,17 @@ This is a system API.
| callId | number | Yes | Call ID. |
| 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**
```js
......@@ -1931,9 +2743,9 @@ call.separateConference(1, (err, data) => {
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
......@@ -1949,6 +2761,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
......@@ -1980,6 +2803,18 @@ This is a system API.
| type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type. |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
......@@ -2014,6 +2849,18 @@ This is a system API.
| ------------------------------------------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -2045,6 +2892,18 @@ This is a system API.
| info | [CallRestrictionInfo](#callrestrictioninfo8) | Yes | Call restriction information. |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -2084,6 +2943,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
......@@ -2120,10 +2991,22 @@ This is a system API.
| type | [CallTransferType](#calltransfertype8) | Yes | Call transfer type. |
| 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**
```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)}`);
});
```
......@@ -2135,7 +3018,7 @@ getCallTransferInfo\(slotId: number, type: CallTransferType): Promise<CallTransf
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
......@@ -2154,6 +3037,18 @@ This is a system API.
| --------------------------------------------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -2185,6 +3080,18 @@ This is a system API.
| info | [CallTransferInfo](#calltransferinfo8) | Yes | Call transfer information. |
| 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
......@@ -2205,7 +3112,7 @@ setCallTransfer\(slotId: number, info: CallTransferInfo): Promise<void\>
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
......@@ -2224,6 +3131,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -2258,6 +3177,18 @@ This is a system API.
| -------- | ---------------------------- | ---- | ---------- |
| 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**
```js
......@@ -2273,7 +3204,7 @@ isRinging\(\): Promise<boolean\>
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
......@@ -2285,6 +3216,18 @@ This is a system API.
| ---------------------- | --------------------------- |
| 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**
```js
......@@ -2302,7 +3245,7 @@ setMuted\(callback: AsyncCallback<void\>\): void
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
......@@ -2312,6 +3255,17 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- |
| 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**
```js
......@@ -2327,7 +3281,7 @@ setMuted\(\): Promise<void\>
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
......@@ -2337,6 +3291,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -2354,7 +3319,7 @@ cancelMuted(callback: AsyncCallback<void\>): void
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
......@@ -2364,6 +3329,17 @@ This is a system API.
| -------- | ------------------------- | ---- | ---------- |
| 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**
```js
......@@ -2379,7 +3355,7 @@ cancelMuted(): Promise<void\>
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
......@@ -2389,6 +3365,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -2400,13 +3387,13 @@ promise.then(data => {
});
```
## call.setAudioDevice<sup>9+</sup>
## call.setAudioDevice<sup>8+</sup>
setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
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
......@@ -2417,6 +3404,17 @@ This is a system API.
| device | [AudioDevice](#audiodevice8) | Yes | Audio device.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2444,6 +3442,17 @@ This is a system API.
| options | [AudioDeviceOptions](#audiodeviceoptions9) | Yes | Audio device parameters.|
| 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**
```js
......@@ -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\>
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
......@@ -2479,6 +3488,17 @@ This is a system API.
| ------------------- | ------------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2511,6 +3531,17 @@ This is a system API.
| callNumberList | Array<string\> | Yes | List of call numbers.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2545,6 +3576,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2577,6 +3619,17 @@ This is a system API.
| mode | [ImsCallMode](#imscallmode8) | Yes | IMS call mode.|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2608,6 +3661,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -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|
| 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
......@@ -2652,7 +3728,7 @@ enableImsSwitch(slotId: number): Promise<void\>
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
......@@ -2670,6 +3746,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
......@@ -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|
| 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
......@@ -2714,7 +3814,7 @@ disableImsSwitch(slotId: number): Promise<void\>
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
......@@ -2732,6 +3832,18 @@ This is a system API.
| ------------------- | --------------------------- |
| 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
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -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|
| 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**
```js
......@@ -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.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2790,6 +3913,17 @@ This is a system API.
| ------------------- | --------------------------- |
| 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**
```js
......@@ -2801,21 +3935,33 @@ promise.then(data => {
});
```
## DialOptions
Defines the dialup options.
Provides an option for determining whether a call is a video call.
**System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description |
| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ |
| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- |
| 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. |
| 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. |
| 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
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_IDLE | 0 | No call is in progress. |
| 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>
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
| Name| Type | Mandatory | Description |
| Name | Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------------------------------- |
| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
## NumberFormatOptions<sup>7+</sup>
Defines the number formatting options.
Provides an option for number formatting.
**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>
Enumerates IMS call modes.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2869,23 +4015,23 @@ This is a system API.
Enumerates audio devices.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
| Name | Value | Description |
| -------------------- | ---- | ------------ |
| DEVICE_EARPIECE | 0 | Earpiece. |
| DEVICE_SPEAKER | 1 | Speaker.|
| DEVICE_WIRED_HEADSET | 2 | Wired headset.|
| DEVICE_EARPIECE | 0 | Headset device. |
| DEVICE_SPEAKER | 1 | Speaker device.|
| DEVICE_WIRED_HEADSET | 2 | Wired headset device.|
| DEVICE_BLUETOOTH_SCO | 3 | Bluetooth SCO device. |
| DEVICE_MIC | 4 | Microphone. |
| DEVICE_MIC | 4 | Microphone device|
## CallRestrictionType<sup>8+</sup>
Enumerates call restriction types.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2904,7 +4050,7 @@ This is a system API.
Defines the call transfer information.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2915,14 +4061,14 @@ This is a system API.
| settingType | [CallTransferSettingType](#calltransfersettingtype8) | Yes | Call transfer setting type.|
| startHour<sup>9+</sup> | number | No | Hour 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.|
## CallTransferType<sup>8+</sup>
Enumerates call transfer types.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2937,7 +4083,7 @@ This is a system API.
Enumerates call transfer setting types.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2952,7 +4098,7 @@ This is a system API.
Defines the call attribute options.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2973,7 +4119,7 @@ This is a system API.
Enumerates conference states.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -2988,7 +4134,7 @@ This is a system API.
Enumerates call types.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3001,9 +4147,9 @@ This is a system API.
## 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
......@@ -3016,7 +4162,7 @@ This is a system API.
Enumerates detailed call states.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3036,7 +4182,7 @@ This is a system API.
Defines the call restriction information.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3050,7 +4196,7 @@ This is a system API.
Enumerates call restriction modes.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3063,7 +4209,7 @@ This is a system API.
Defines the call event options.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3075,7 +4221,7 @@ This is a system API.
Enumerates call ability event IDs.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3088,7 +4234,7 @@ This is a system API.
Enumerates dialup scenarios.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3102,7 +4248,7 @@ This is a system API.
Enumerates dialup types.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3116,7 +4262,7 @@ This is a system API.
Defines options for the call rejection message.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3128,7 +4274,7 @@ This is a system API.
Defines the call transfer result.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3138,14 +4284,14 @@ This is a system API.
| number | string | Yes | Call transfer number. |
| startHour<sup>9+</sup> | number | Yes | Hour 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.|
## CallWaitingStatus<sup>7+</sup>
Enumerates call waiting states.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3158,7 +4304,7 @@ This is a system API.
Enumerates call restriction states.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3171,7 +4317,7 @@ This is a system API.
Enumerates call transfer states.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3184,7 +4330,7 @@ This is a system API.
Defines the cause of a call disconnection.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3197,7 +4343,7 @@ This is a system API.
Enumerates causes of call disconnection.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3287,7 +4433,7 @@ This is a system API.
Defines the MMI code result.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......@@ -3298,9 +4444,9 @@ This is a system API.
## 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
......@@ -3313,7 +4459,7 @@ This is a system API.
Defines audio device options.
This is a system API.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CallManager
......
......@@ -166,6 +166,7 @@ Updates a contact based on the specified contact information. This API uses an a
```js
contact.updateContact({
id: 1,
name: {fullName: 'xxx'},
phoneNumbers: [{phoneNumber: '138xxxxxxxx'}]
}, (err) => {
......@@ -200,6 +201,7 @@ Updates a contact based on the specified contact information and attributes. Thi
```js
contact.updateContact({
id: 1,
name: {fullName: 'xxx'},
phoneNumbers: [{phoneNumber: '138xxxxxxxx'}]
}, {
......@@ -241,6 +243,7 @@ Updates a contact based on the specified contact information and attributes. Thi
```js
let promise = contact.updateContact({
id: 1,
name: {fullName: 'xxx'},
phoneNumbers: [{phoneNumber: '138xxxxxxxx'}]
}, {
......
......@@ -9,7 +9,7 @@ The **observer** module provides event subscription management functions. You ca
## Modules to Import
```js
```
import observer from '@ohos.telephony.observer'
```
......@@ -17,7 +17,7 @@ import observer from '@ohos.telephony.observer'
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
......@@ -30,6 +30,18 @@ Registers an observer for network status change events. This API uses an asynchr
| 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).|
**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
......@@ -43,7 +55,7 @@ observer.on('networkStateChange', data =>{
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
......@@ -54,9 +66,21 @@ Registers an observer for network status change events of the SIM card in the sp
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| 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).|
**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
......@@ -70,7 +94,7 @@ observer.on('networkStateChange', {slotId: 0}, data =>{
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**
>
......@@ -85,6 +109,14 @@ Unregisters the observer for network status change events. This API uses an asyn
| 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).|
| 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**
```js
......@@ -101,7 +133,7 @@ observer.off('networkStateChange');
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
......@@ -109,9 +141,21 @@ Registers an observer for signal status change events. This API uses an asynchro
| 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).|
**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
......@@ -125,7 +169,7 @@ observer.on('signalInfoChange', data =>{
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
......@@ -133,10 +177,22 @@ Registers an observer for signal status change events of the SIM card in the spe
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| type | string | Yes | Signal status change event. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| type | string | Yes | Signal information change event. |
| 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).|
**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
......@@ -150,7 +206,7 @@ observer.on('signalInfoChange', {slotId: 0}, data =>{
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**
>
......@@ -162,9 +218,20 @@ Unregisters the observer for signal status change events. This API uses an async
| 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).|
**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**
```js
......@@ -182,7 +249,7 @@ observer.off('signalInfoChange');
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
......@@ -193,6 +260,17 @@ Registers an observer for call status change events. This API uses an asynchrono
| 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.|
**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**
```js
......@@ -206,7 +284,7 @@ observer.on('callStateChange', value =>{
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
......@@ -215,9 +293,20 @@ Registers an observer for call status change events. This API uses an asynchrono
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| 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.|
**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**
```js
......@@ -231,7 +320,7 @@ observer.on('callStateChange', {slotId: 0}, value =>{
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**
>
......@@ -246,6 +335,17 @@ Unregisters the observer for call status change events. This API uses an asynchr
| 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.|
**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**
```js
......@@ -263,7 +363,7 @@ observer.off('callStateChange');
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
......@@ -271,9 +371,20 @@ Registers an observer for connection status change events of the cellular data c
| 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).|
**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**
```js
......@@ -287,7 +398,7 @@ observer.on('cellularDataConnectionStateChange', value =>{
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
......@@ -295,10 +406,21 @@ Registers an observer for connection status change events of the cellular data c
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Connection status change event of the cellular data connection. |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| 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 |
| 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**
```js
......@@ -312,7 +434,7 @@ observer.on('cellularDataConnectionStateChange', {slotId: 0}, value =>{
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**
>
......@@ -324,9 +446,20 @@ Unregisters the observer for connection status change events of the cellular dat
| 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).|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -377,9 +521,20 @@ Registers an observer for the uplink and downlink data flow status change events
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| 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).|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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. |
| 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**
```js
......@@ -458,9 +635,20 @@ Registers an observer for status change events of the SIM card in the specified
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| 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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -531,8 +730,8 @@ Enumerates SIM card types and states.
**System capability**: SystemCapability.Telephony.StateRegistry
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| 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).|
| reason<sup>8+</sup> | [LockReason](#lockreason8) | Yes| SIM card lock type.|
| Name | Type | Mandatory| Description |
| ------------------- | ----------------------------------- | ---- | -------------------------------------------------------- |
| 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).|
| reason<sup>8+</sup> | [LockReason](#lockreason8) | Yes | SIM card lock type. |
......@@ -420,44 +420,44 @@ Enumerates mouse pointer styles.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
| Name | Value | Description |
| -------------------------------- | ---- | ------ |
| DEFAULT | 0 | Default |
| EAST | 1 | East arrow |
| WEST | 2 | West arrow |
| SOUTH | 3 | South arrow |
| NORTH | 4 | North arrow |
| WEST_EAST | 5 | West-east arrow |
| NORTH_SOUTH | 6 | North-south arrow |
| NORTH_EAST | 7 | North-east arrow |
| NORTH_WEST | 8 | North-west arrow |
| SOUTH_EAST | 9 | South-east arrow |
| SOUTH_WEST | 10 | South-west arrow |
| NORTH_EAST_SOUTH_WEST | 11 | North-east and south-west adjustment|
| NORTH_WEST_SOUTH_EAST | 12 | North-west and south-east adjustment|
| CROSS | 13 | Cross (accurate selection) |
| CURSOR_COPY | 14 | Copy cursor |
| CURSOR_FORBID | 15 | Forbid cursor |
| COLOR_SUCKER | 16 | Sucker |
| HAND_GRABBING | 17 | Grabbing hand |
| HAND_OPEN | 18 | Opening hand |
| HAND_POINTING | 19 | Hand-shaped pointer |
| HELP | 20 | Help |
| MOVE | 21 | Move |
| RESIZE_LEFT_RIGHT | 22 | Left and right resizing|
| RESIZE_UP_DOWN | 23 | Up and down resizing|
| SCREENSHOT_CHOOSE | 24 | Screenshot crosshair|
| SCREENSHOT_CURSOR | 25 | Screenshot cursor |
| TEXT_CURSOR | 26 | Text cursor |
| ZOOM_IN | 27 | Zoom in |
| ZOOM_OUT | 28 | Zoom out |
| MIDDLE_BTN_EAST | 29 | Scrolling east |
| MIDDLE_BTN_WEST | 30 | Scrolling west |
| MIDDLE_BTN_SOUTH | 31 | Scrolling south |
| MIDDLE_BTN_NORTH | 32 | Scrolling north |
| MIDDLE_BTN_NORTH_SOUTH | 33 | Scrolling north-south |
| MIDDLE_BTN_NORTH_EAST | 34 | Scrolling north-east |
| MIDDLE_BTN_NORTH_WEST | 35 | Scrolling north-west |
| MIDDLE_BTN_SOUTH_EAST | 36 | Scrolling south-east |
| MIDDLE_BTN_SOUTH_WEST | 37 | Scrolling south-west |
| MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | Moving as a cone in four directions|
| Name | Value | Description |Legend|
| -------------------------------- | ---- | ------ |------ |
| DEFAULT | 0 | Default |![Default.png](./figures/Default.png)|
| EAST | 1 | East arrow |![East.png](./figures/East.png)|
| WEST | 2 | West arrow |![West.png](./figures/West.png)|
| SOUTH | 3 | South arrow |![South.png](./figures/South.png)|
| NORTH | 4 | North arrow |![North.png](./figures/North.png)|
| WEST_EAST | 5 | West-east arrow |![West_East.png](./figures/West_East.png)|
| NORTH_SOUTH | 6 | North-south arrow |![North_South.png](./figures/North_South.png)|
| NORTH_EAST | 7 | North-east arrow |![North_East.png](./figures/North_East.png)|
| NORTH_WEST | 8 | North-west arrow |![North_West.png](./figures/North_West.png)|
| SOUTH_EAST | 9 | South-east arrow |![South_East.png](./figures/South_East.png)|
| 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.png](./figures/North_East_South_West.png)|
| 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.png](./figures/Cross.png)|
| CURSOR_COPY | 14 | Copy cursor |![Copy.png](./figures/Copy.png)|
| CURSOR_FORBID | 15 | Forbid cursor |![Forbid.png](./figures/Forbid.png)|
| COLOR_SUCKER | 16 | Sucker |![Colorsucker.png](./figures/Colorsucker.png)|
| HAND_GRABBING | 17 | Grabbing hand |![Hand_Grabbing.png](./figures/Hand_Grabbing.png)|
| HAND_OPEN | 18 | Opening hand |![Hand_Open.png](./figures/Hand_Open.png)|
| HAND_POINTING | 19 | Hand-shaped pointer |![Hand_Poniting.png](./figures/Hand_Pointing.png)|
| HELP | 20 | Help |![Help.png](./figures/Help.png)|
| MOVE | 21 | Move |![Move.png](./figures/Move.png)|
| 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.png](./figures/Resize_Up_Down.png)|
| SCREENSHOT_CHOOSE | 24 | Screenshot crosshair|![Screenshot_Cross.png](./figures/Screenshot_Cross.png)|
| SCREENSHOT_CURSOR | 25 | Screenshot cursor |![Screenshot_Cursor.png](./figures/Screenshot_Cursor.png)|
| TEXT_CURSOR | 26 | Text cursor |![Text_Cursor.png](./figures/Text_Cursor.png)|
| ZOOM_IN | 27 | Zoom in |![Zoom_In.png](./figures/Zoom_In.png)|
| ZOOM_OUT | 28 | Zoom out |![Zoom_Out.png](./figures/Zoom_Out.png)|
| MIDDLE_BTN_EAST | 29 | Scrolling east |![MID_Btn_East.png](./figures/MID_Btn_East.png)|
| MIDDLE_BTN_WEST | 30 | Scrolling west |![MID_Btn_West.png](./figures/MID_Btn_West.png)|
| MIDDLE_BTN_SOUTH | 31 | Scrolling south | ![MID_Btn_South.png](./figures/MID_Btn_South.png) |
| MIDDLE_BTN_NORTH | 32 | Scrolling north |![MID_Btn_North.png](./figures/MID_Btn_North.png)|
| 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 |![MID_Btn_North_East.png](./figures/MID_Btn_North_East.png)|
| 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 |![MID_Btn_South_East.png](./figures/MID_Btn_South_East.png)|
| 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|![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
| 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. |
**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
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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 |
| 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**
```js
......@@ -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).|
**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**
```js
......@@ -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.|
**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**
```js
......@@ -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.|
**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**
```js
......@@ -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 |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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.|
**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
......@@ -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 |
| 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**
```js
......@@ -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.|
**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
......@@ -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 |
| 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**
```js
......@@ -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. |
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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.|
**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
......@@ -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 |
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -1179,6 +1591,18 @@ Sets the network selection mode. This API uses an asynchronous callback to retur
| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes | Network selection mode.|
| 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**
```js
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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|
| 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**
```js
......@@ -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.|
**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
......@@ -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. |
| 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**
```js
......@@ -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.|
**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
......@@ -1657,10 +2246,22 @@ Obtains the preferred network for the SIM card in the specified slot. This API u
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- |
| 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. |
**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
......@@ -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.|
**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
......@@ -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. |
| 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**
```js
......@@ -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.|
**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
......@@ -1789,6 +2426,18 @@ Enables listening for **imsRegStateChange** events. This API uses an asynchronou
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| 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**
```js
......@@ -1818,6 +2467,18 @@ Disables listening for **imsRegStateChange** events. This API uses an asynchrono
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| 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**
```js
......@@ -1856,10 +2517,10 @@ Defines the signal strength.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ----------------- |
| --------------- | --------------------------- | ---- | ------------------ |
| signalType | [NetworkType](#networktype) | Yes | Signal strength type.|
| signalLevel | number | Yes | Signal strength level.|
| dBm<sup>9+</sup>| number | Yes | Signal strength, in dBm. |
## 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**
>
......@@ -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|
| 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**
```js
......@@ -144,7 +156,7 @@ sim.hasOperatorPrivileges(0, (err, data) => {
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
......@@ -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.|
**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**
```js
......@@ -184,7 +208,19 @@ Obtains the ISO country code of the SIM card in the specified slot. This API use
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ---------------------------------------- |
| 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**
......@@ -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).|
**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**
```js
......@@ -231,7 +279,7 @@ promise.then(data => {
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
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -343,7 +439,7 @@ promise.then(data => {
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
......@@ -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|
| 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**
```js
......@@ -367,7 +475,7 @@ sim.getSimState(0, (err, data) => {
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
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -509,7 +677,7 @@ promise.then(data => {
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.
......@@ -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|
| 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**
```js
......@@ -537,7 +719,7 @@ sim.getSimAccountInfo(0, (err, data) => {
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.
......@@ -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.|
**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**
```js
......@@ -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.|
**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**
```js
......@@ -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.|
**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**
```js
......@@ -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.|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -950,7 +1304,7 @@ promise.then(data => {
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.
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1013,7 +1393,7 @@ promise.then(data => {
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.
......@@ -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|
| 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**
```js
......@@ -1041,7 +1434,7 @@ sim.deactivateSim(0, (err, data) => {
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.
......@@ -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.|
**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**
```js
......@@ -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 |
| 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**
......@@ -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 |
| ------- | ---------------------- | ---- | ------------------------------------------------------------ |
| 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**
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1350,7 +1868,7 @@ promise.then(data => {
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.
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1415,7 +1961,7 @@ promise.then(data => {
## 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.
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1646,7 +2276,7 @@ console.log("Result: "+ sim.getMaxSimCount())
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.
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1831,6 +2539,7 @@ promise.then(data => {
});
```
## sim.setVoiceMailInfo<sup>8+</sup>
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
| mailNumber | string | Yes | Voice mailbox number. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1902,7 +2639,7 @@ promise.then(data => {
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.
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -2167,9 +3008,23 @@ Queries contact numbers of the SIM card in the specified slot. This API uses an
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ---------------------------------------------------------- |
| 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. |
**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**
```js
......@@ -2196,7 +3051,7 @@ Queries contact numbers of the SIM card in the specified slot. This API uses a p
| Name| Type | Mandatory| Description |
| ------ | ----------- | ---- | ---------------------------------------------------------- |
| 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**
......@@ -2204,6 +3059,20 @@ Queries contact numbers of the SIM card in the specified slot. This API uses a p
| ------------------------------------------------------------ | ------------------------------ |
| 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**
```js
......@@ -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. |
| 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**
```js
......@@ -2276,6 +3159,20 @@ Adds contact numbers for the SIM card in the specified slot. This API uses a pro
| -------------- | --------------------------- |
| 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**
```js
......@@ -2308,16 +3205,32 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a
| Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| 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. |
| 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**
```js
let diallingNumbersInof = {
alphaTag: "alpha",
number: "138xxxxxxxx"
number: "138xxxxxxxx",
recordNumber: 123,
pin2: "1234"
};
sim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
......@@ -2342,7 +3255,7 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a
| Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| 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. |
**Return value**
......@@ -2351,6 +3264,20 @@ Deletes contact numbers from the SIM card in the specified slot. This API uses a
| -------------- | --------------------------- |
| 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**
```js
......@@ -2383,16 +3310,32 @@ Updates contact numbers for the SIM card in the specified slot. This API uses an
| Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| 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. |
| 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**
```js
let diallingNumbersInof = {
alphaTag: "alpha",
number: "138xxxxxxxx"
number: "138xxxxxxxx",
recordNumber: 123,
pin2: "1234"
};
sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err, 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
| Name | Type | Mandatory| Description |
| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- |
| 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. |
**Return value**
......@@ -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.|
**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**
```js
let diallingNumbersInof = {
alphaTag: "alpha",
number: "138xxxxxxxx",
recordNumber: 123,
pin2: "1234"
recordNumber: 123
};
let promise = sim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof);
promise.then(data => {
......@@ -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|
| 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**
......@@ -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.|
**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**
```js
......@@ -2525,9 +3507,22 @@ Sends a terminal response command to the SIM card in the specified slot. This AP
| Name | Type | Mandatory| Description |
| -------- | -------------------- | ---- | -------------------------------------- |
| 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. |
**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**
```js
......@@ -2554,7 +3549,7 @@ Sends a terminal response command to the SIM card in the specified slot. This AP
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- |
| 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**
......@@ -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.|
**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**
```js
......@@ -2573,6 +3581,7 @@ promise.then(data => {
});
```
## sim.unlockSimLock<sup>8+</sup>
unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<LockStatusResponse\>): void
......@@ -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. |
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -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.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
......@@ -2663,12 +3698,33 @@ Obtains the opkey of the SIM card in the specified slot. This API uses an asynch
| 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. |
**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**
```js
sim.getOpKey(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
try {
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
| ---------------- | ----------------------------------------- |
| 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**
```js
let promise = sim.getOpKey(0);
promise.then(data => {
try {
let data = sim.getOpKey(0);
console.log(`getOpKey success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.log(`getOpKey failed, promise: err->${JSON.stringify(err)}`);
});
} catch (error) {
console.log(`getOpKey failed, promise: err->${JSON.stringify(error)}`);
}
```
## 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
| 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. |
**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**
```js
sim.getOpName(0, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
try {
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
| ---------------- | ------------------------------------------ |
| 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**
```js
let promise = sim.getOpName(0);
promise.then(data => {
try {
let data = sim.getOpName(0);
console.log(`getOpName success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.log(`getOpName failed, promise: err->${JSON.stringify(err)}`);
});
} catch (error) {
console.log(`getOpName failed, promise: err->${JSON.stringify(error)}`);
}
```
## SimState
......@@ -2781,16 +3884,16 @@ Enumerates SIM card types.
| Name| Value| Description|
| ----- | ----- | ----- |
|UNKNOWN_CARD | -1 | Unknown|
|SINGLE_MODE_SIM_CARD | 10 | Single-card (SIM)|
|SINGLE_MODE_USIM_CARD | 20 | Single-card (USIM)|
|SINGLE_MODE_RUIM_CARD | 30 | Single-card (RUIM)|
|DUAL_MODE_CG_CARD | 40 | Dual-card (CDMA+GSM)|
|CT_NATIONAL_ROAMING_CARD | 41 | China Telecom internal roaming 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_UG_CARD | 50 | Dual-mode card (UMTS+GSM)|
|SINGLE_MODE_ISIM_CARD<sup>8+</sup> | 60 | Single-card (ISIM)|
|UNKNOWN_CARD | -1 | Unknown type.|
|SINGLE_MODE_SIM_CARD | 10 | Single-card (SIM).|
|SINGLE_MODE_USIM_CARD | 20 | Single-card (USIM).|
|SINGLE_MODE_RUIM_CARD | 30 | Single-card (RUIM).|
|DUAL_MODE_CG_CARD | 40 | Dual-card (CDMA+GSM).|
|CT_NATIONAL_ROAMING_CARD | 41 | China Telecom internal roaming 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_UG_CARD | 50 | Dual-mode card (UMTS+GSM).|
|SINGLE_MODE_ISIM_CARD<sup>8+</sup> | 60 | Single-card (ISIM).|
## LockType<sup>8+</sup>
......@@ -2841,27 +3944,27 @@ Enumerates personalized lock types.
## LockStatusResponse<sup>7+</sup>
Defines the lock status response.
Defines the personalized lock information.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| Name | Type | Mandatory| Description |
| --------------- | ------ | ---- | --------------------- |
| 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>
Defines the lock information.
Defines the personalized lock information.
**System API**: This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------- |
| lockType | [LockType](#locktype8) | Yes | Lock type.|
| password | string | Yes | Password. |
| state | [LockState](#lockstate8) | Yes | Lock state.|
......@@ -2874,8 +3977,8 @@ Defines the personalized lock information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| Name | Type | Mandatory| Description |
| -------- | -------------------------------- | ---- | ------------- |
| lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.|
| password | string | Yes | Password. |
......@@ -2887,8 +3990,8 @@ Defines the ICC account information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| Name | Type | Mandatory| Description |
| ---------- | ------- | ---- | ---------------- |
| simId | number | Yes | SIM card ID. |
| slotIndex | number | Yes | Card slot ID. |
| isEsim | boolean | Yes | Whether the SIM card is an eSim card.|
......@@ -2905,9 +4008,9 @@ Defines the carrier configuration.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| field | string | Yes | Field. |
| Name | Type | Mandatory| Description|
| ----- | ------ | ---- | ---- |
| field | string | Yes | Field.|
| value | string | Yes | Value. |
## DiallingNumbersInfo<sup>8+</sup>
......@@ -2918,10 +4021,10 @@ Defines the contact number information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| alphaTag | string | Yes | Alpha tag. |
| number | string | Yes | Contact number. |
| Name | Type | Mandatory| Description |
| ------------ | ------ | ---- | ---------- |
| alphaTag | string | Yes | Tag. |
| number | string | Yes | Call transfer number. |
| recordNumber | number | Yes | Record number.|
| pin2 | string | Yes | PIN 2.|
......@@ -2934,7 +4037,7 @@ Enumerates contact types.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| -------------- | ---- | ---------- |
| --------------- | ---- | ---------- |
| GENERAL_CONTACT | 1 | Common contact number.|
| FIXED_DIALING | 2 | Fixed dialing number. |
......@@ -2947,7 +4050,7 @@ Enumerates carrier configuration keys.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| ------------------------------------------------------- | ---------------------------------------------------- | -------------------- |
| ------------------------------------------------------- | ------------------------------------------------------ | -------------------- |
| 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_HIDE_IMS_SWITCH_BOOL | "hide_ims_switch_bool" | Whether to hide the IMS switch. |
......@@ -2960,7 +4063,7 @@ Enumerates carrier configuration keys.
| 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_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_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. |
......
......@@ -16,7 +16,7 @@ import sms from '@ohos.telephony.sms';
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
......@@ -44,7 +44,7 @@ sms.createMessage(pdu, specification, (err, data) => {
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
......@@ -81,7 +81,7 @@ sendMessage(options: SendMessageOptions): void
Sends an SMS message.
**Required permission**: ohos.permission.SEND_MESSAGES
**Required permissions**: ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -114,7 +114,7 @@ sms.sendMessage(options);
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
......@@ -122,7 +122,7 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use
| 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**
......@@ -137,7 +137,7 @@ sms.getDefaultSmsSlotId((err, data) => {
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
......@@ -162,11 +162,11 @@ promise.then(data => {
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.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
**Required permissions**: ohos.permission.SET_TELEPHONY_STATE
**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
| 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. |
**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**
```js
......@@ -190,11 +203,11 @@ sms.setDefaultSmsSlotId(0, (err, data) => {
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.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE
**Required permissions**: ohos.permission.SET_TELEPHONY_STATE
**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
| 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**
| 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**
......@@ -229,7 +255,7 @@ Sets the short message service center (SMSC) address. This API uses an asynchron
**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
......@@ -241,6 +267,18 @@ Sets the short message service center (SMSC) address. This API uses an asynchron
| smscAddr | string | Yes | SMSC address. |
| 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
......@@ -260,7 +298,7 @@ Sets the SMSC address. This API uses a promise to return the result.
**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
......@@ -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.|
**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
......@@ -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.
**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
......@@ -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|
| 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**
```js
......@@ -328,7 +390,7 @@ Obtains the SMSC address. This API uses a promise to return the result.
**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
......@@ -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.|
**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
......@@ -360,7 +434,7 @@ promise.then(data => {
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
......@@ -383,7 +457,7 @@ Splits an SMS message into multiple segments. This API uses an asynchronous call
**System API**: This is a system API.
**Required permission**: ohos.permission.SEND_MESSAGES
**Required permissions**: ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -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.|
| 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**
```js
......@@ -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.
**Required permission**: ohos.permission.SEND_MESSAGES
**Required permissions**: ohos.permission.SEND_MESSAGES
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -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.|
**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
......@@ -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.
**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
......@@ -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.|
| 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
......@@ -482,7 +592,7 @@ Adds a SIM message. This API uses a promise to return the result.
**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
......@@ -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.|
**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
......@@ -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.
**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
......@@ -535,6 +657,18 @@ Deletes a SIM message. This API uses an asynchronous callback to return the resu
| msgIndex | number | Yes | Message index. |
| 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
......@@ -554,7 +688,7 @@ Deletes a SIM message. This API uses a promise to return the result.
**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
......@@ -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.|
**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
......@@ -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.
**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
......@@ -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.|
| 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
......@@ -627,7 +785,7 @@ Updates a SIM message. This API uses a promise to return the result.
**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
......@@ -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.|
**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
......@@ -669,7 +839,7 @@ Obtains all SIM card messages. This API uses an asynchronous callback to return
**System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS
**Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -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|
| 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**
```js
......@@ -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.
**Required permission**: ohos.permission.RECEIVE_SMS
**Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -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.|
**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
......@@ -734,7 +928,7 @@ Sets the cell broadcast configuration. This API uses an asynchronous callback to
**System API**: This is a system API.
**Required permission**: ohos.permission.RECEIVE_SMS
**Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -745,6 +939,18 @@ Sets the cell broadcast configuration. This API uses an asynchronous callback to
| options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.|
| 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
......@@ -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.
**Required permission**: ohos.permission.RECEIVE_SMS
**Required permissions**: ohos.permission.RECEIVE_SMS
**System capability**: SystemCapability.Telephony.SmsMms
......@@ -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.|
**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
......@@ -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|
| message | string | Yes | SMS message. |
| 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**
......@@ -847,14 +1076,25 @@ Obtains SMS message segment information. This API uses a promise to return the r
| Name | Type | Mandatory| Description |
| --------- | ------- | ---- | ----------------------------------------- |
| 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. |
**Return value**
| 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**
......@@ -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|
| 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**
```js
......@@ -899,7 +1150,7 @@ sms.isImsSmsSupported(slotId, (err, data) => {
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.
......@@ -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.|
**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**
```js
......@@ -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.|
**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
......@@ -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. |
**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
......@@ -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.|
| 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**
```js
......@@ -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.|
**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**
```js
......@@ -1046,7 +1354,7 @@ promise.then(data => {
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.
......@@ -1059,6 +1367,17 @@ Encodes MMS messages. This API uses an asynchronous callback to return the resul
| mms | [MmsInformation](#mmsinformation8) | Yes | MMS message information.|
| 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**
```js
......@@ -1081,7 +1400,7 @@ sms.encodeMms(mmsInformation, (err, data) => {
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.
......@@ -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.|
**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**
```js
......@@ -1125,12 +1455,12 @@ Defines an SMS message instance.
**System capability**: SystemCapability.Telephony.SmsMms
| 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.|
| 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.|
| messageClass | [ShortMessageClass](#shortmessageclass) | Yes | SMS message type. |
| 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. |
| 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 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 | Enumerates SMS message types. |
| pdu | Array&lt;number&gt; | Yes | PDU in the SMS message. |
| protocolId | number | Yes | Protocol identifier used for delivering the SMS message. |
| scAddress | string | Yes | SMSC address. |
......@@ -1179,7 +1509,7 @@ Provides the callback for the SMS message sending result. It consists of three p
**System capability**: SystemCapability.Telephony.SmsMms
| 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**.|
| result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. |
| url | string | Yes | URI for storing the sent SMS message. |
......@@ -1192,7 +1522,7 @@ Provides the callback for the SMS message delivery report.
**System capability**: SystemCapability.Telephony.SmsMms
| Name| Type | Mandatory| Description |
| ------ | ------------------- | ---- | -------------- |
| ---- | ------------------- | ---- | -------------- |
| pdu | Array&lt;number&gt; | Yes | SMS message delivery report.|
......@@ -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_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>
Defines the MMS message information.
......@@ -1219,9 +1548,9 @@ Defines the MMS message information.
**System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description |
| ----------- | ------------------------------------------------------------ | ---- | --------- |
| 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.|
| ----------- | ------------------------------------------------------------ | ---- | ---------- |
| 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.|
| attachment | Array<[MmsAttachment](#mmsattachment8)\> | No | Attachment. |
## MmsSendReq<sup>8+</sup>
......@@ -1238,7 +1567,7 @@ Defines an MMS message sending request.
| transactionId | string | Yes | Transaction ID. |
| contentType | string | Yes | Content type. |
| 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. |
| cc | Array<[MmsAddress](#mmsaddress8)\> | No | Carbon copy. |
| bcc | Array<[MmsAddress](#mmsaddress8)\> | No | Blind carbon copy. |
......@@ -1281,7 +1610,7 @@ Defines an MMS notification index.
| expiry | number | Yes | Expiration. |
| contentLocation | string | Yes | Content location.|
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| from | [MmsAddress](#mmsaddress8) | No | Source. |
| from | [MmsAddress](#mmsaddress8) | No | Source address. |
| subject | string | No | Subject. |
| deliveryReport | number | No | Status report.|
| contentClass | number | No | Content class. |
......@@ -1314,9 +1643,9 @@ Defines the MMS message retrieval configuration.
| messageId | string | Yes | Message ID. |
| date | number | Yes | Date. |
| contentType | string | Yes | Content type.|
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Address to which the message is sent. |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version |
| from | [MmsAddress](#mmsaddress8) | No | Source. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address. |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| from | [MmsAddress](#mmsaddress8) | No | Source address. |
| cc | Array<[MmsAddress](#mmsaddress8)\> | No | Carbon copy. |
| subject | string | No | Subject. |
| priority | [MmsPriorityType](#mmsprioritytype8) | No | Priority. |
......@@ -1337,12 +1666,11 @@ Defines the original MMS message reading index.
| ---------- | ---------------------------------- | ---- | -------- |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| messageId | string | Yes | Message ID. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Address to which the message is sent. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source address. |
| date | number | Yes | Date. |
| readStatus | number | Yes | Read status.|
## MmsReadRecInd<sup>8+</sup>
Defines the MMS message reading index.
......@@ -1353,14 +1681,13 @@ Defines the MMS message reading index.
| Name | Type | Mandatory| Description |
| ---------- | ---------------------------------- | ---- | -------- |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
| messageId | string | Yes | Message ID. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source. |
| readStatus | number | Yes | Read state.|
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source address. |
| readStatus | number | Yes | Read status.|
| date | number | No | Date. |
## MmsAttachment<sup>8+</sup>
Defines the attachment of an MMS message.
......@@ -1378,7 +1705,7 @@ Defines the attachment of an MMS message.
| contentType | string | Yes | Content type. |
| isSmil | boolean | Yes | Whether the synchronized multimedia integration language is used.|
| 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. |
| charset | [MmsCharSets](#mmscharsets8) | No | Character set. |
......@@ -1392,12 +1719,12 @@ Defines an MMSC address.
| Name | Type | Mandatory| Description |
| ------- | ---------------------------- | ---- | ------ |
| address | string | Yes | MMSC address. |
| address | string | Yes | Network address. |
| charset | [MmsCharSets](#mmscharsets8) | Yes | Character set.|
## MessageType<sup>8+</sup>
Enumerates message types.
Message type.
**System API**: This is a system API.
......@@ -1530,7 +1857,7 @@ Defines the SIM message status.
## RanType<sup>7+</sup>
Enumerates RAN types.
RAN type.
**System API**: This is a system API.
......@@ -1564,12 +1891,12 @@ Defines the SIM message options.
**System capability**: SystemCapability.Telephony.SmsMms
| Name| Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | -------------- |
| slotId | number | Yes | Card slot ID. |
| smsc | string | Yes | Short message service center.|
| pdu | string | Yes | Protocol data unit. |
| status | [SimMessageStatus](#simmessagestatus7) | Yes | Message status. |
| status | [SimMessageStatus](#simmessagestatus7) | Yes | Status. |
## UpdateSimMessageOptions<sup>7+</sup>
......@@ -1613,8 +1940,8 @@ Defines an MMS message delivery index.
| --------- | ---------------------------------- | ---- | ------ |
| messageId | string | Yes | Message ID.|
| date | number | Yes | Date. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Address to which the message is sent.|
| status | number | Yes | Status. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination address.|
| status | number | Yes | Status |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. |
## MmsRespInd<sup>8+</sup>
......
......@@ -50,4 +50,3 @@ Defines attributes of the current locale.
| language | string | Yes | No | Language, for example, **zh**.|
| countryOrRegion | string | Yes | No | Country or region, for example, **CN** or **US**.|
| dir | string | Yes | No | Text layout direction. The value can be:<br>- **ltr**: from left to right<br>- **rtl**: from right to left|
| unicodeSetting<sup>5+</sup> | string | Yes | No | Unicode language key set determined by the locale. If current locale does not have a specific key set, an empty set is returned.<br>For example, **{"nu":"arab"}** indicates that current locale uses Arabic numerals.|
# @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**
>
......@@ -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.|
| 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**
```js
......@@ -130,6 +144,20 @@ This is a system API.
| --------------- | ------------------------------- |
| 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**
```js
......@@ -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.|
**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
......@@ -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.|
**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
......@@ -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 |
| 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**
```js
......@@ -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.|
**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
......@@ -362,6 +438,18 @@ This is a system API.
| -------- | --------------------- | ---- | ---------- |
| 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**
```js
......@@ -388,6 +476,18 @@ This is a system API.
| --------------- | ----------------------- |
| 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**
```js
......@@ -417,6 +517,18 @@ This is a system API.
| -------- | --------------------- | ---- | ---------- |
| 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**
```js
......@@ -443,6 +555,18 @@ This is a system API.
| --------------- | --------------------------- |
| 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**
```js
......@@ -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|
| 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**
```js
......@@ -505,6 +641,18 @@ This is a system API.
| --------------- | ------------------------- |
| 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**
```js
......@@ -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|
| 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**
```js
......@@ -567,6 +727,18 @@ This is a system API.
| --------------- | ------------------------- |
| 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**
```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.
先完成此消息的编辑!
想要评论请 注册