diff --git a/en/application-dev/dfx/Readme-EN.md b/en/application-dev/dfx/Readme-EN.md index f46c27be2587586dfeb65552a0afe340b5a6187b..b8a4496e09420b3a7557e5c8b8996deaf14ce1c9 100644 --- a/en/application-dev/dfx/Readme-EN.md +++ b/en/application-dev/dfx/Readme-EN.md @@ -1,11 +1,8 @@ # 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) \ No newline at end of file + - [Development of Application Recovery](apprecovery-guidelines.md) diff --git a/en/application-dev/reference/apis/figures/Colorsucker.png b/en/application-dev/reference/apis/figures/Colorsucker.png new file mode 100644 index 0000000000000000000000000000000000000000..40e19e94e129682fdeb461cceef0f0a57c64d66d Binary files /dev/null and b/en/application-dev/reference/apis/figures/Colorsucker.png differ diff --git a/en/application-dev/reference/apis/figures/Copy.png b/en/application-dev/reference/apis/figures/Copy.png new file mode 100644 index 0000000000000000000000000000000000000000..212517131bf176661ae85c7513def022dbb50559 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Copy.png differ diff --git a/en/application-dev/reference/apis/figures/Cross.png b/en/application-dev/reference/apis/figures/Cross.png new file mode 100644 index 0000000000000000000000000000000000000000..58625855d1cd96ea8a29ab9c3c201d90ac717e83 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Cross.png differ diff --git a/en/application-dev/reference/apis/figures/Default.png b/en/application-dev/reference/apis/figures/Default.png new file mode 100644 index 0000000000000000000000000000000000000000..6308171fe9d612050376f6a5dfdc870e51bc92db Binary files /dev/null and b/en/application-dev/reference/apis/figures/Default.png differ diff --git a/en/application-dev/reference/apis/figures/East.png b/en/application-dev/reference/apis/figures/East.png new file mode 100644 index 0000000000000000000000000000000000000000..4942bc948a17e78c68538ccc3ae886bc0a548737 Binary files /dev/null and b/en/application-dev/reference/apis/figures/East.png differ diff --git a/en/application-dev/reference/apis/figures/Forbid.png b/en/application-dev/reference/apis/figures/Forbid.png new file mode 100644 index 0000000000000000000000000000000000000000..c5c43d4b4b8aaf6d53931586e519a583d064fec7 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Forbid.png differ diff --git a/en/application-dev/reference/apis/figures/Hand_Grabbing.png b/en/application-dev/reference/apis/figures/Hand_Grabbing.png new file mode 100644 index 0000000000000000000000000000000000000000..09ab3121d15e27a975fbaa228aadb2399e4492b9 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Hand_Grabbing.png differ diff --git a/en/application-dev/reference/apis/figures/Hand_Open.png b/en/application-dev/reference/apis/figures/Hand_Open.png new file mode 100644 index 0000000000000000000000000000000000000000..e1cb7a972ec2d372f0d75cbe80159c4a66e74e10 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Hand_Open.png differ diff --git a/en/application-dev/reference/apis/figures/Hand_Pointing.png b/en/application-dev/reference/apis/figures/Hand_Pointing.png new file mode 100644 index 0000000000000000000000000000000000000000..f0daa0dad6154a1846fb9fe4b7f441b3ab6f8b5b Binary files /dev/null and b/en/application-dev/reference/apis/figures/Hand_Pointing.png differ diff --git a/en/application-dev/reference/apis/figures/Help.png b/en/application-dev/reference/apis/figures/Help.png new file mode 100644 index 0000000000000000000000000000000000000000..ffea2f1c072f1682ca8e837ddb947352a553917e Binary files /dev/null and b/en/application-dev/reference/apis/figures/Help.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_East.png b/en/application-dev/reference/apis/figures/MID_Btn_East.png new file mode 100644 index 0000000000000000000000000000000000000000..921cd4ceea8d97ffb6d4c45008d6428cda998cce Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_East.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_North.png b/en/application-dev/reference/apis/figures/MID_Btn_North.png new file mode 100644 index 0000000000000000000000000000000000000000..5769575ddb435f5e8f5f8993d9edc13749376293 Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_North.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_North_East.png b/en/application-dev/reference/apis/figures/MID_Btn_North_East.png new file mode 100644 index 0000000000000000000000000000000000000000..3daf141241dec309c98ae10266bb153af163f3d9 Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_North_East.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_North_South.png b/en/application-dev/reference/apis/figures/MID_Btn_North_South.png new file mode 100644 index 0000000000000000000000000000000000000000..1f56c4cd8f1498293f5fc4a5ab2c321159fb07dd Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_North_South.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_North_South_West_East.png b/en/application-dev/reference/apis/figures/MID_Btn_North_South_West_East.png new file mode 100644 index 0000000000000000000000000000000000000000..b45dbde27e59121bdfc4e1752759176fb835027c Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_North_South_West_East.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_North_West.png b/en/application-dev/reference/apis/figures/MID_Btn_North_West.png new file mode 100644 index 0000000000000000000000000000000000000000..bde82d08f7a098106b4f4c31d55a84a989e25a8d Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_North_West.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_South.png b/en/application-dev/reference/apis/figures/MID_Btn_South.png new file mode 100644 index 0000000000000000000000000000000000000000..e7d5afb6f8f8b1b2939b9e18bdb8b8b3d9729f4d Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_South.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_South_East.png b/en/application-dev/reference/apis/figures/MID_Btn_South_East.png new file mode 100644 index 0000000000000000000000000000000000000000..44284a6e04a19ca8453b46ea81db099ad84cfaa2 Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_South_East.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_South_West.png b/en/application-dev/reference/apis/figures/MID_Btn_South_West.png new file mode 100644 index 0000000000000000000000000000000000000000..c8632f09160c51ca573d58d3ffb1370058b880ce Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_South_West.png differ diff --git a/en/application-dev/reference/apis/figures/MID_Btn_West.png b/en/application-dev/reference/apis/figures/MID_Btn_West.png new file mode 100644 index 0000000000000000000000000000000000000000..7460bc18d63e000689755b39b8ead3c3609ee4f5 Binary files /dev/null and b/en/application-dev/reference/apis/figures/MID_Btn_West.png differ diff --git a/en/application-dev/reference/apis/figures/Move.png b/en/application-dev/reference/apis/figures/Move.png new file mode 100644 index 0000000000000000000000000000000000000000..00f64e54dca0d0731b595b4ddc9e0f7294c40c72 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Move.png differ diff --git a/en/application-dev/reference/apis/figures/North.png b/en/application-dev/reference/apis/figures/North.png new file mode 100644 index 0000000000000000000000000000000000000000..b022ac2e92d4cfb07efde7f3bf4b7ada8454e594 Binary files /dev/null and b/en/application-dev/reference/apis/figures/North.png differ diff --git a/en/application-dev/reference/apis/figures/North_East.png b/en/application-dev/reference/apis/figures/North_East.png new file mode 100644 index 0000000000000000000000000000000000000000..f6134237f38cd681b319c95bf1b77017bc1524b4 Binary files /dev/null and b/en/application-dev/reference/apis/figures/North_East.png differ diff --git a/en/application-dev/reference/apis/figures/North_East_South_West.png b/en/application-dev/reference/apis/figures/North_East_South_West.png new file mode 100644 index 0000000000000000000000000000000000000000..908886aeb3f8df976bb67b2261e8e52e7222e622 Binary files /dev/null and b/en/application-dev/reference/apis/figures/North_East_South_West.png differ diff --git a/en/application-dev/reference/apis/figures/North_South.png b/en/application-dev/reference/apis/figures/North_South.png new file mode 100644 index 0000000000000000000000000000000000000000..b15678a6b178ca0d9b13f7c7f58d025ab7a1ce12 Binary files /dev/null and b/en/application-dev/reference/apis/figures/North_South.png differ diff --git a/en/application-dev/reference/apis/figures/North_West.png b/en/application-dev/reference/apis/figures/North_West.png new file mode 100644 index 0000000000000000000000000000000000000000..cfbe4c8910575c12afde4b5904d79b5beda0c162 Binary files /dev/null and b/en/application-dev/reference/apis/figures/North_West.png differ diff --git a/en/application-dev/reference/apis/figures/North_West_South_East.png b/en/application-dev/reference/apis/figures/North_West_South_East.png new file mode 100644 index 0000000000000000000000000000000000000000..09fa728fbb45082a0524c284b8906b91d7b3a6f7 Binary files /dev/null and b/en/application-dev/reference/apis/figures/North_West_South_East.png differ diff --git a/en/application-dev/reference/apis/figures/Resize_Left_Right.png b/en/application-dev/reference/apis/figures/Resize_Left_Right.png new file mode 100644 index 0000000000000000000000000000000000000000..83e7671e3ffea65260bdb36d8b392fa78d55cd4e Binary files /dev/null and b/en/application-dev/reference/apis/figures/Resize_Left_Right.png differ diff --git a/en/application-dev/reference/apis/figures/Resize_Up_Down.png b/en/application-dev/reference/apis/figures/Resize_Up_Down.png new file mode 100644 index 0000000000000000000000000000000000000000..db8bccf89b6e5260db3875a22b5200fabd30c23c Binary files /dev/null and b/en/application-dev/reference/apis/figures/Resize_Up_Down.png differ diff --git a/en/application-dev/reference/apis/figures/Screenshot_Cross.png b/en/application-dev/reference/apis/figures/Screenshot_Cross.png new file mode 100644 index 0000000000000000000000000000000000000000..27460c082507e71082d11cd8a20eee2fc24da28d Binary files /dev/null and b/en/application-dev/reference/apis/figures/Screenshot_Cross.png differ diff --git a/en/application-dev/reference/apis/figures/Screenshot_Cursor.png b/en/application-dev/reference/apis/figures/Screenshot_Cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..71abea4ca351988a92b8a5b2b2228321df31aecc Binary files /dev/null and b/en/application-dev/reference/apis/figures/Screenshot_Cursor.png differ diff --git a/en/application-dev/reference/apis/figures/South.png b/en/application-dev/reference/apis/figures/South.png new file mode 100644 index 0000000000000000000000000000000000000000..205f5cf5f59ce8318357e168eee0d66c119c233d Binary files /dev/null and b/en/application-dev/reference/apis/figures/South.png differ diff --git a/en/application-dev/reference/apis/figures/South_East.png b/en/application-dev/reference/apis/figures/South_East.png new file mode 100644 index 0000000000000000000000000000000000000000..f4a70d2d068271bfe10e4ce724ae27e4e5ba96d9 Binary files /dev/null and b/en/application-dev/reference/apis/figures/South_East.png differ diff --git a/en/application-dev/reference/apis/figures/South_West.png b/en/application-dev/reference/apis/figures/South_West.png new file mode 100644 index 0000000000000000000000000000000000000000..2ae8e9a9fa396bb6ed0f385b7b99b66830357a40 Binary files /dev/null and b/en/application-dev/reference/apis/figures/South_West.png differ diff --git a/en/application-dev/reference/apis/figures/Text_Cursor.png b/en/application-dev/reference/apis/figures/Text_Cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..7cd8d2200bc7455e562da003069702832db4eb20 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Text_Cursor.png differ diff --git a/en/application-dev/reference/apis/figures/West.png b/en/application-dev/reference/apis/figures/West.png new file mode 100644 index 0000000000000000000000000000000000000000..2cad91aca31f2e2b257c523e80e6fc2d71fa2cee Binary files /dev/null and b/en/application-dev/reference/apis/figures/West.png differ diff --git a/en/application-dev/reference/apis/figures/West_East.png b/en/application-dev/reference/apis/figures/West_East.png new file mode 100644 index 0000000000000000000000000000000000000000..6be4aa9d05f22a10cd00fa6aec36f95aee2b332d Binary files /dev/null and b/en/application-dev/reference/apis/figures/West_East.png differ diff --git a/en/application-dev/reference/apis/figures/Zoom_In.png b/en/application-dev/reference/apis/figures/Zoom_In.png new file mode 100644 index 0000000000000000000000000000000000000000..2e928ec070fcd05a44cd9b1abd041128287b0528 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Zoom_In.png differ diff --git a/en/application-dev/reference/apis/figures/Zoom_Out.png b/en/application-dev/reference/apis/figures/Zoom_Out.png new file mode 100644 index 0000000000000000000000000000000000000000..d675d0e517ba436724540a39f60dfa75c256f0d0 Binary files /dev/null and b/en/application-dev/reference/apis/figures/Zoom_Out.png differ diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md index 0ccd49a5dc2a8b8e3577b7614f8219573de7cf7d..6b6222abe96a415e28290892f8e6a215c1e98478 100644 --- a/en/application-dev/reference/apis/js-apis-call.md +++ b/en/application-dev/reference/apis/js-apis-call.md @@ -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**
+>**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(deprecated) dial\(phoneNumber: string, callback: AsyncCallback\): 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 | -| ----------- | ---------------------------- | ---- | -------------------------------- | -| phoneNumber | string | Yes | Phone number. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure | +| Name | Type | Mandatory| Description | +| ----------- | ---------------------------- | ---- | --------------------------------------- | +| phoneNumber | string | Yes | Phone number. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| **Example** @@ -40,23 +40,23 @@ call.dial("138xxxxxxxx", (err, data) => { ``` -## call.dial +## call.dial(deprecated) dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback\): 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<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure | +| phoneNumber | string | Yes | Phone number. | +| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| **Example** @@ -69,28 +69,28 @@ call.dial("138xxxxxxxx", { ``` -## call.dial +## call.dial(deprecated) dial\(phoneNumber: string, options?: DialOptions\): Promise -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. | +| phoneNumber | string | Yes | Phone number. | +| options | [DialOptions](#dialoptions) | No | Call option, which indicates whether the call is a voice call or video call.| **Return value** -| Type | Description | -| ---------------------- | ---------------------------------------------------------------- | -| Promise<boolean> | Promise used to return the result.
- **true**: success
- **false**: failure | +| Type | Description | +| ---------------------- | ------------------------------------------------------------ | +| Promise<boolean> | Promise used to return the result.
- **true**: success
- **false**: failure| **Example** @@ -105,6 +105,142 @@ promise.then(data => { }); ``` + +## call.dialCall9+ + +dialCall\(phoneNumber: string, callback: AsyncCallback\): 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<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 +call.dialCall("138xxxxxxxx", (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +## call.dialCall9+ + +dialCall\(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback\): void + +Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the result. + +**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<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 +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.dialCall9+ + +dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise + +Initiates a call. You can set call options as needed. This API uses a promise to return the result. + +**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<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 +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.makeCall7+ makeCall(phoneNumber: string, callback: AsyncCallback\): void @@ -115,16 +251,27 @@ 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<void> | Yes | Callback used to return the result. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Error codes** +For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). + +| ID| Error Message | +| -------- | -------------------------------------------- | +| 401 | Parameter error. | +| 8300001 | Invalid parameter value. | +| 8300002 | Operation failed. Cannot connect to service. | +| 8300003 | System internal error. | +| 8300999 | Unknown error code. | **Example** ```js -call.makeCall("138xxxxxxxx", err => { - console.log(`makeCall callback: err->${JSON.stringify(err)}`); +call.makeCall("138xxxxxxxx", err => { + console.log(`makeCall callback: err->${JSON.stringify(err)}`); }); ``` @@ -139,24 +286,35 @@ Launches the call screen and displays the dialed number. This API uses a promise **Parameters** -| Name | Type | Mandatory | Description | +| Name | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------- | -| phoneNumber | string | Yes | Phone number. | +| phoneNumber | string | Yes | Phone number.| **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 | +| -------- | -------------------------------------------- | +| 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.makeCall("138xxxxxxxx"); -promise.then(() => { - console.log(`makeCall success`); -}).catch(err => { - console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`); +let promise = call.makeCall("138xxxxxxxx"); +promise.then(() => { + console.log(`makeCall success`); +}).catch(err => { + console.error(`makeCall fail, promise: err->${JSON.stringify(err)}`); }); ``` @@ -170,9 +328,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to **Parameters** -| Name | Type | Mandatory | Description | +| Name | Type | Mandatory| Description | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Callback used to return the result.
- **true**: A call is in progress.
- **false**: No call is in progress. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Callback used to return the result.
- **true**: A call is in progress.
- **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<boolean> | Promise used to return the result. | +| Promise<boolean> | 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<[CallState](#callstate)> | Yes | Callback used to return the result. | +| callback | AsyncCallback<[CallState](#callstate)> | 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<[CallState](#callstate)> | Promise used to return the result. | +| Promise<[CallState](#callstate)> | 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.
- **false**: The device does not support voice calls. | +| boolean | - **true**: The device supports voice calls.
- **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<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. - **true**: The called number is an emergency number.
- **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\): 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 | -| ----------- | -------------------------------------------------- | ---- | -------------------------------------------- | -| phoneNumber | string | Yes | Phone number. | -| options | [EmergencyNumberOptions](#emergencynumberoptions7) | No | Phone number options. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number. | +| Name | Type | Mandatory| Description | +| ----------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ | +| phoneNumber | string | Yes | Phone number. | +| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. - **true**: The called number is an emergency number.
- **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 -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<boolean> | Promise used to return the result. | +| Promise<boolean> | 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<string> | Yes | Callback used to return the result. | +| callback | AsyncCallback<string> | Yes | Callback used to return the result.| + +**Error codes** +For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). + +| ID| Error Message | +| -------- | -------------------------------------------- | +| 401 | Parameter error. | +| 8300001 | Invalid parameter value. | +| 8300002 | Operation failed. Cannot connect to service. | +| 8300003 | System internal error. | +| 8300999 | Unknown error code. | **Example** @@ -386,7 +588,7 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => { formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\): 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<string> | Yes | Callback used to return the result. | +| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting options, for example, country code. | +| 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. | +| 8300999 | Unknown error code. | **Example** @@ -415,7 +628,7 @@ call.formatPhoneNumber("138xxxxxxxx", { formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise -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<string> | Promise used to return the result. | +| Promise<string> | Promise used to return the result.| + +**Error codes** +For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). + +| ID| Error Message | +| -------- | -------------------------------------------- | +| 401 | Parameter error. | +| 8300001 | Invalid parameter value. | +| 8300002 | Operation failed. Cannot connect to service. | +| 8300003 | System internal error. | +| 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<string> | Yes | Callback used to return the result. | +| callback | AsyncCallback<string> | Yes | Callback used to return the result.| + +**Error codes** +For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). + +| ID| Error Message | +| -------- | -------------------------------------------- | +| 401 | Parameter error. | +| 8300001 | Invalid parameter value. | +| 8300002 | Operation failed. Cannot connect to service. | +| 8300003 | System internal error. | +| 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<string> | Promise used to return the result. | +| Promise<string> | Promise used to return the result.| + +**Error codes** +For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). + +| ID| Error Message | +| -------- | -------------------------------------------- | +| 401 | Parameter error. | +| 8300001 | Invalid parameter value. | +| 8300002 | Operation failed. Cannot connect to service. | +| 8300003 | System internal error. | +| 8300999 | Unknown error code. | **Example** @@ -514,9 +760,9 @@ promise.then(data => { muteRinger\(callback: AsyncCallback\): 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<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 @@ -541,9 +798,9 @@ call.muteRinger((err, data) => { muteRinger\(\): Promise -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<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 @@ -566,13 +835,14 @@ promise.then(data => { }); ``` -## call.answer7+ -answer\(callId: number, callback: AsyncCallback\): void +## call.answerCall7+ + +answerCall\(callId: number, callback: AsyncCallback\): void -Answers a call based on the specified call ID. This API uses an asynchronous callback to return the result. +Answers a call. This API uses an asynchronous callback to return the result. -This is a system API. +**System API**: This is a system API. **Required permission**: ohos.permission.ANSWER_CALL @@ -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<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 -call.answer(1, (err, data) => { +call.answerCall(1, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` -## call.answer7+ +## call.answerCall7+ -answer(callId?: number\): Promise +answerCall(callId?: number\): Promise -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<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 -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.hangup7+ -hangup\(callId: number, callback: AsyncCallback\): void +## call.answerCall9+ -Ends a call. This API uses an asynchronous callback to return the result. +answerCall\(callback: AsyncCallback\): void + +Answers a call. This API uses an asynchronous callback to return the result. -This is a system API. +**System API**: This is a system API. **Required permission**: ohos.permission.ANSWER_CALL @@ -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<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 -call.hangup(1, (err, data) => { +call.answerCall((err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` -## call.answer9+ +## call.hangUpCall7+ -answer\(callback: AsyncCallback\): void +hangUpCall\(callId: number, callback: AsyncCallback\): 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<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 -call.answer((err, data) => { +call.hangUpCall(1, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` -## call.hangup7+ +## call.hangUpCall7+ -hangup\(callId?: number\): Promise +hangUpCall\(callId?: number\): Promise -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<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 -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.hangup9+ -hangup\(callback: AsyncCallback\): void +## call.hangUpCall9+ + +hangUpCall\(callback: AsyncCallback\): 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<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 -call.hangup((err, data) => { +call.hangUpCall((err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` -## call.reject7+ +## call.rejectCall7+ -reject(callId: number, callback: AsyncCallback\): void +rejectCall(callId: number, callback: AsyncCallback\): 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<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 -call.reject(1, (err, data) => { +call.rejectCall(1, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` -## call.reject7+ -reject\(callId: number, options: RejectMessageOptions, callback: AsyncCallback\): void +## call.rejectCall7+ + +rejectCall\(callId: number, options: RejectMessageOptions, callback: AsyncCallback\): void -Rejects a call based on the specified call ID and options. This API uses an asynchronous callback to return the result. +Rejects a call. This API uses an asynchronous callback to return the result. -This is a system API. +**System API**: This is a system API. **Required permission**: ohos.permission.ANSWER_CALL @@ -794,25 +1152,37 @@ This is a system API. | options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message. | | 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 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.reject7+ +## call.rejectCall7+ -reject(callId?: number, options?: RejectMessageOptions\): Promise +rejectCall(callId?: number, options?: RejectMessageOptions\): Promise -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<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 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.reject9+ +## call.rejectCall9+ -reject\(callback: AsyncCallback\): void +rejectCall\(callback: AsyncCallback\): 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<void> | 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.reject9+ +## call.rejectCall9+ -reject\(options: RejectMessageOptions, callback: AsyncCallback\): void +rejectCall\(options: RejectMessageOptions, callback: AsyncCallback\): 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<void> | 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 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<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 @@ -938,7 +1356,7 @@ holdCall\(callId: number\): Promise 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<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 @@ -973,7 +1403,7 @@ unHoldCall\(callId: number, callback: AsyncCallback\): void Unholds a call based on the specified call ID. This API uses an asynchronous callback to return the result. -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<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 @@ -1001,7 +1443,7 @@ unHoldCall\(callId: number\): Promise 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<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 @@ -1036,7 +1490,7 @@ switchCall\(callId: number, callback: AsyncCallback\): 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<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 @@ -1064,7 +1530,7 @@ switchCall\(callId: number\): Promise 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<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 @@ -1099,7 +1577,7 @@ combineConference\(callId: number, callback: AsyncCallback\): 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<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 @@ -1125,7 +1614,7 @@ combineConference\(callId: number\): Promise 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<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 | +| -------- | -------------------------------------------- | +| 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\): 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<number> | 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 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<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 | +| -------- | -------------------------------------------- | +| 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\>\): 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\> | 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\> 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<Array> | 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> | 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\> 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<Array> | 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- **0**: card slot 1
- **1**: card slot 2 | -| callback | AsyncCallback<[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.
- **0**: Call waiting is disabled.
- **1**: Call waiting is enabled.| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | +| callback | AsyncCallback<[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.

- **0**: Call waiting is disabled.
- **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 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<[CallWaitingStatus](#callwaitingstatus7)> | Promise used to return the result.
- **0**: Call waiting is disabled.
- **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- **false**: Disable call waiting.
- **true**: Enable call waiting.| | callback | AsyncCallback | 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 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<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 @@ -1461,9 +2076,9 @@ promise.then(data => { startDTMF\(callId: number, character: string, callback: AsyncCallback\): 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 | 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 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<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 | +| -------- | -------------------------------------------- | +| 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 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<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 @@ -1550,7 +2198,7 @@ stopDTMF\(callId: number\): Promise 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<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 | +| -------- | -------------------------------------------- | +| 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\): 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<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 | +| -------- | -------------------------------------------- | +| 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 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<boolean> | 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\): 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\): 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): 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\): 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\): 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\): 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\): 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\): 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\): 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<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. | +| 8300999 | Unknown error code. | + **Example** ```js @@ -1880,7 +2670,7 @@ isNewCallAllowed\(\): Promise 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<boolean> | 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 -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<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 @@ -1931,9 +2743,9 @@ call.separateConference(1, (err, data) => { separateConference\(callId: number\): Promise -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<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 | +| -------- | -------------------------------------------- | +| 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<[RestrictionStatus](#restrictionstatus8)> | 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 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<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 @@ -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<[CallTransferResult](#calltransferresult8)> | 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 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<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 @@ -2246,7 +3165,7 @@ isRinging\(callback: AsyncCallback\): 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<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 | +| -------- | -------------------------------------------- | +| 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 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<boolean> | 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 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<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 @@ -2327,7 +3281,7 @@ setMuted\(\): Promise 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<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 | +| -------- | -------------------------------------------- | +| 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 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<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 @@ -2379,7 +3355,7 @@ cancelMuted(): Promise 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<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 | +| -------- | -------------------------------------------- | +| 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.setAudioDevice9+ +## call.setAudioDevice8+ setAudioDevice\(device: AudioDevice, callback: AsyncCallback\): 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<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 @@ -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<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 @@ -2456,13 +3465,13 @@ call.setAudioDevice(1, audioDeviceOptions, (err, data) => { ``` -## call.setAudioDevice8+ +## call.setAudioDevice9+ setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise Sets the audio device for a call based on the specified options. This API uses a promise to return the result. -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<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 | +| -------- | -------------------------------------------- | +| 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, 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 | Yes | List of call numbers.| | 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 @@ -2528,7 +3559,7 @@ joinConference(mainCallId: number, callNumberList: Array): Promise 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<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 | +| -------- | -------------------------------------------- | +| 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 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.
- **0**: card slot 1
- **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 @@ -2652,7 +3728,7 @@ enableImsSwitch(slotId: number): Promise 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<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 @@ -2687,7 +3775,7 @@ disableImsSwitch(slotId: number, callback: AsyncCallback): 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.
- **0**: card slot 1
- **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 @@ -2714,7 +3814,7 @@ disableImsSwitch(slotId: number): Promise 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<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 @@ -2749,7 +3861,7 @@ isImsSwitchEnabled(slotId: number, callback: AsyncCallback): 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.
- **0**: card slot 1
- **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. | +| 8300999 | Unknown error code. | + **Example** ```js @@ -2774,7 +3897,7 @@ isImsSwitchEnabled(slotId: number): Promise 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<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 | +| -------- | -------------------------------------------- | +| 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,20 +3935,32 @@ 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 | -| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ | +| Name | Type | Mandatory| Description | +| ------------------------ | ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------- | | extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call| -| accountId 8+ | number | No | Account ID.
- **0**: card slot 1
- **1**: card slot 2
This is a system API. | -| videoState 8+ | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. | -| dialScene 8+ | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. | -| dialType 8+ | [DialType](#dialtype8) | No | Dialup type. This is a system API. | +| accountId 8+ | number | No | Account ID.
- **0**: card slot 1
- **1**: card slot 2
This is a system API. | +| videoState 8+ | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. | +| dialScene 8+ | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. | +| dialType 8+ | [DialType](#dialtype8) | No | Dialup type. This is a system API. | + +## DialCallOptions9+ + +Defines options for initiating a call. + +**System capability**: SystemCapability.Telephony.CallManager + +| Name | Type | Mandatory| Description | +| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ | +| accountId 9+ | number | No | Account ID.
- **0**: card slot 1
- **1**: card slot 2
This is a system API.| +| videoState 9+ | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. | +| dialScene 9+ | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. | +| dialType 9+ | [DialType](#dialtype8) | No | Dialup type. This is a system API. | ## CallState @@ -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.| ## EmergencyNumberOptions7+ -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.
- **0**: card slot 1
- **1**: card slot 2| ## NumberFormatOptions7+ -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**.| ## ImsCallMode8+ 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| ## CallRestrictionType8+ 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.| | startHour9+ | number | No | Hour in the start time.| | startMinute9+ | number | No | Minute in the start time.| -| endHour9+ | number | No | Hour in the end time.| +| endHour9+ | number | No | Minute in the end time.| | endMinute9+ | number | No | Minute in the end time.| ## CallTransferType8+ 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,11 +4098,11 @@ 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 -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | --------------- | ---------------------------------------- | ---- | -------------- | | accountNumber | string | Yes | Account number. | | speakerphoneOn | boolean | Yes | Speakerphone on.| @@ -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. ## VideoStateType7+ -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,11 +4182,11 @@ 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 -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------- | -------------------------------------------- | ---- | ------------ | | type | [CallRestrictionType](#callrestrictiontype8) | Yes | Call restriction type.| | password | string | Yes | Password. | @@ -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,11 +4209,11 @@ 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 -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ------- | ------------------------------------------ | ---- | -------------- | | eventId | [CallAbilityEventId](#callabilityeventid8) | Yes | Call ability event ID.| @@ -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,11 +4262,11 @@ 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 -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------------- | ------ | ---- | -------- | | messageContent | string | Yes | Message content.| @@ -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. | | startHour9+ | number | Yes | Hour in the start time.| | startMinute9+ | number | Yes | Minute in the start time.| -| endHour9+ | number | Yes | Hour in the end time.| +| endHour9+ | number | Yes | Minute in the end time.| | endMinute9+ | number | Yes | Minute in the end time.| ## CallWaitingStatus7+ 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. ## MmiCodeResult9+ -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 diff --git a/en/application-dev/reference/apis/js-apis-contact.md b/en/application-dev/reference/apis/js-apis-contact.md index 2778a143c65125eca650324e67a220ab60f64ead..bcc8b36fc9a93191258ed78edb68df61ccce4c28 100644 --- a/en/application-dev/reference/apis/js-apis-contact.md +++ b/en/application-dev/reference/apis/js-apis-contact.md @@ -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'}] }, { diff --git a/en/application-dev/reference/apis/js-apis-observer.md b/en/application-dev/reference/apis/js-apis-observer.md index ae5b7999bd7e579179920a73fcaea6116890ff70..2d56d02d2ec4e0f2117266569cb5bfd905f1b338 100644 --- a/en/application-dev/reference/apis/js-apis-observer.md +++ b/en/application-dev/reference/apis/js-apis-observer.md @@ -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\): 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\): 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.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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\): 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\>): 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\> | 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\>): 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.
- **0**: card slot 1
- **1**: card slot 2| +| type | string | Yes | Signal information change event. | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| | callback | Callback\> | 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\>): 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\> | 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.
**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.
- **0**: card slot 1
- **1**: card slot 2 | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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.
**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.
**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.
- **0**: card slot 1
- **1**: card slot 2 | +| type | string | Yes | Connection status change event of the cellular data link. | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **1**: card slot 2 | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **1**: card slot 2 | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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).| -| reason8+ | [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).| +| reason8+ | [LockReason](#lockreason8) | Yes | SIM card lock type. | diff --git a/en/application-dev/reference/apis/js-apis-pointer.md b/en/application-dev/reference/apis/js-apis-pointer.md index fc74447111636244fb54e604dba5c458a6e6e061..3a31a8179560f622bcf62e7d3c3640a72436beb5 100644 --- a/en/application-dev/reference/apis/js-apis-pointer.md +++ b/en/application-dev/reference/apis/js-apis-pointer.md @@ -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)| diff --git a/en/application-dev/reference/apis/js-apis-radio.md b/en/application-dev/reference/apis/js-apis-radio.md index ea662f7df4300bcc4bcad7be9391357896b74a8a..3902bb89800ffa1e043ea3a51690c92dc52b1511 100644 --- a/en/application-dev/reference/apis/js-apis-radio.md +++ b/en/application-dev/reference/apis/js-apis-radio.md @@ -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.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\ | 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\ | 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\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\\> | 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\\> | 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\ | Yes | Callback used to return the result.
- **true**: The radio service is enabled.
- **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.
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\ | Yes | Callback used to return the result.
- **true**: The radio service is enabled.
- **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\ | Promise used to return the result.
- **true**: The radio service is enabled.
- **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.
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\ | 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\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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\\> | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\\> | 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\\> | 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\ | 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\ | 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.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **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\ | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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\ | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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\ | 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\ | 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 @@ -1656,11 +2245,23 @@ 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.
- **0**: card slot 1
- **1**: card slot 2| +| Name | Type | Mandatory| Description | +| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **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\ | 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 @@ -1855,11 +2516,11 @@ 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.| - +| Name | Type | Mandatory| Description | +| --------------- | --------------------------- | ---- | ------------------ | +| signalType | [NetworkType](#networktype) | Yes | Signal strength type.| +| signalLevel | number | Yes | Signal strength level.| +| dBm9+| number | Yes | Signal strength, in dBm. | ## NetworkType diff --git a/en/application-dev/reference/apis/js-apis-sim.md b/en/application-dev/reference/apis/js-apis-sim.md index 0c0243c3dbe85939b1da5623baac1b3137926e15..3e17df01ff13c5e74e300989517ca606f8b2e069 100644 --- a/en/application-dev/reference/apis/js-apis-sim.md +++ b/en/application-dev/reference/apis/js-apis-sim.md @@ -1,6 +1,6 @@ -# @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** > @@ -121,7 +121,7 @@ promise.then(data => { hasOperatorPrivileges(slotId: number, callback: AsyncCallback\): void -Checks whether the application (caller) has been granted the operator permission. This API uses an asynchronous callback to return the result. +Checks whether the application (caller) has been granted the operator permission. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CoreService @@ -132,6 +132,18 @@ Checks whether the application (caller) has been granted the operator permission | slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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 -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\ | 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.
- **0**: card slot 1
- **1**: card slot 2 | -| callback | AsyncCallback\ | Yes | Callback used to return the result. which is an ISO country code, for example, **CN** (China).| +| callback | AsyncCallback\ | 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\ | 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\): 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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 @@ -287,7 +359,7 @@ promise.then(data => { getSimSpn\(slotId: number, callback: AsyncCallback\): void -Obtains the service provider name (SPN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. +Obtains the service provider name (SPN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CoreService @@ -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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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 @@ -311,7 +395,7 @@ sim.getSimSpn(0, (err, data) => { getSimSpn\(slotId: number\): Promise -Obtains the SPN of the SIM card in the specified slot. This API uses a promise to return the result. +Obtains the SPN of the SIM card in the specified slot. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CoreService @@ -327,6 +411,18 @@ Obtains the SPN of the SIM card in the specified slot. This API uses a promise t | ----------------- | ----------------------------------------- | | Promise\ | 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\): 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.
- **0**: card slot 1
- **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 -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.
- **0**: card slot 1
- **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.
- **0**: card slot 1
- **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 @@ -494,6 +650,18 @@ Checks whether the SIM card in the specified slot is installed. This API uses a | --------------------- | ---------------------------------- | | Promise<boolean> | 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): 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.
- **0**: card slot 1
- **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 -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\\> | 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\> | 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.
- **0**: card slot 1
- **1**: card slot 2
- **-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 @@ -676,6 +912,20 @@ Sets the default slot ID of the SIM card that provides voice services. This API | --------------- | ------------------------------- | | Promise\ | 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<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 @@ -741,6 +1004,19 @@ Sets a display name for the SIM card in the specified slot. This API uses a prom | --------------- | ------------------------------- | | Promise\ | 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.
- **0**: card slot 1
- **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 @@ -805,6 +1094,19 @@ Obtains the name 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 @@ -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<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 @@ -871,6 +1186,19 @@ Sets a display number for the SIM card in the specified slot. This API uses a pr | -------------- | ------------------------------- | | Promise | 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.
- **0**: card slot 1
- **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 @@ -935,6 +1276,19 @@ Obtains the display number of the SIM card in the specified slot. This API uses | --------------------- | --------------------------------- | | 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 @@ -950,7 +1304,7 @@ promise.then(data => { activateSim(slotId: number, callback: AsyncCallback): 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.
- **0**: card slot 1
- **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 @@ -998,6 +1365,19 @@ Activates the SIM card in the specified slot. This API uses a promise to return | --------------- | ------------------------------- | | Promise\ | 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 -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.
- **0**: card slot 1
- **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 @@ -1041,7 +1434,7 @@ sim.deactivateSim(0, (err, data) => { deactivateSim(slotId: number): Promise\ -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\ | 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.
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | -| options | [LockInfo](#lockinfo8) | Yes | Lock information.
- **lockType**: [LockType](#locktype8)
- **password**: string
- **state**: [LockState](#lockstate8) | +| options | [LockInfo](#lockinfo8) | Yes | Lock information.
- lockType: [LockType](#locktype8)
- password: string
- 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.
- **0**: card slot 1
- **1**: card slot 2 | -| options | [LockInfo](#lockinfo8) | Yes | Lock information.
- **lockType**: [LockType](#locktype8)
- **password**: string
- **state**: [LockState](#lockstate8) | +| options | [LockInfo](#lockinfo8) | Yes | Lock information.
- lockType: [LockType](#locktype8)
- password: string
- 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.
- **1**: PIN lock
- **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): 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<[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.unlockPuk7+ -unlockPuk(slotId: number, newPin: string, puk: string ,callback: AsyncCallback): void +unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback): 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<[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 @@ -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<[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 @@ -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<[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 @@ -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): 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback | 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 | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback | 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 | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback | 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 | 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.setVoiceMailInfo8+ setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback): 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 | 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 | 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): 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback | 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 | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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 | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | 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 | 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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback> | 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> | 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,8 +3008,22 @@ 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.
- **0**: card slot 1
- **1**: card slot 2 | -| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING | -| callback | AsyncCallback> | Yes | Callback used to return the result. | +| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING| +| callback | AsyncCallback> | 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** @@ -2196,13 +3051,27 @@ 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.
- **0**: card slot 1
- **1**: card slot 2 | -| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING | +| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING| **Return value** | Type | Description | | ------------------------------------------------------------ | ------------------------------ | -| Promise> | Promise used to return the result.| +| Promise> | 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** @@ -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 | 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 @@ -2274,7 +3157,21 @@ Adds contact numbers for the SIM card in the specified slot. This API uses a pro | Type | Description | | -------------- | --------------------------- | -| Promise | Promise used to return the result.| +| Promise | 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** @@ -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.
- **0**: card slot 1
- **1**: card slot 2 | -| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING | +| type | [ContactType](#contacttype8) | Yes | Contact type.
- 1 : GENERAL_CONTACT
- 2 : FIXED_DIALING | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | callback | AsyncCallback | 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,14 +3255,28 @@ 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.
- **0**: card slot 1
- **1**: card slot 2 | -| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING | +| type | [ContactType](#contacttype8) | Yes | Contact type.
- 1 : GENERAL_CONTACT
- 2 : FIXED_DIALING | | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | **Return value** | Type | Description | | -------------- | --------------------------- | -| Promise | Promise used to return the result.| +| Promise | 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** @@ -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.
- **0**: card slot 1
- **1**: card slot 2 | -| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING | +| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING| | diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | | callback | AsyncCallback | 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.
- **0**: card slot 1
- **1**: card slot 2 | -| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **2**: FIXED_DIALING | +| type | [ContactType](#contacttype8) | Yes | Contact type.
- **1**: GENERAL_CONTACT
- **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 | 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.
- **0**: card slot 1
- **1**: card slot 2| | cmd | string | Yes | Envelope command. | -| callback | AsyncCallback | Yes | Yes | +| callback | AsyncCallback | 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 | 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.
- **0**: card slot 1
- **1**: card slot 2| -| cmd | string | Yes | Command | +| cmd | string | Yes | Command. | | callback | AsyncCallback | 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.
- **0**: card slot 1
- **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 | 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,11 +3581,12 @@ promise.then(data => { }); ``` + ## sim.unlockSimLock8+ unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback): void -Unlocks the SIM card in the specified slot. This API uses an asynchronous callback to return the result. +Unlocks the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System API**: This is a system API. @@ -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 @@ -2610,7 +3633,7 @@ sim.unlockSimLock(0, persoLockInfo, (err, data) => { unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise -Unlocks the SIM card in the specified slot. This API uses a promise to return the result. +Unlocks the SIM card in the specified slot. This API uses a promise to return the result. **System API**: This is a system API. @@ -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): 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** @@ -2661,14 +3696,35 @@ Obtains the opkey of the SIM card in the specified slot. This API uses an asynch | Name | Type | Mandatory| Description | | -------- | ---------------------- | ---- | -------------------------------------- | | slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| -| callback | AsyncCallback | Yes | Callback used to return the result. | +| callback | AsyncCallback | 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 | 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.getOpName9+ @@ -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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback | 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 | 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_CARD8+ | 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_CARD8+ | 60 | Single-card (ISIM).| ## LockType8+ @@ -2841,30 +3944,30 @@ Enumerates personalized lock types. ## LockStatusResponse7+ -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 | -| -------- | ------- | --------- | ----------- | -| result | number | Yes | Operation result. | -| remain?: number | number | Yes | Remaining attempts (can be null).| +| Name | Type | Mandatory| Description | +| --------------- | ------ | ---- | --------------------- | +| result | number | Yes | Operation result. | +| remain?: number | number | No | Remaining attempts (can be null).| ## LockInfo8+ -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 | -| -------- | ------- | --------- | ----------- | -| lockType | [LockType](#locktype8) | Yes | Lock type.| -| password | string | Yes | Password. | -| state | [LockState](#lockstate8) | Yes | Lock state.| +| Name | Type | Mandatory| Description | +| -------- | ------------------------ | ---- | -------- | +| lockType | [LockType](#locktype8) | Yes | Lock type.| +| password | string | Yes | Password. | +| state | [LockState](#lockstate8) | Yes | Lock state.| ## PersoLockInfo8+ @@ -2874,10 +3977,10 @@ Defines the personalized lock information. **System capability**: SystemCapability.Telephony.CoreService -| Name | Type | Mandatory | Description | -| -------- | ------- | --------- | ----------- | -| lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.| -| password | string | Yes | Password. | +| Name | Type | Mandatory| Description | +| -------- | -------------------------------- | ---- | ------------- | +| lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.| +| password | string | Yes | Password. | ## IccAccountInfo7+ @@ -2887,15 +3990,15 @@ Defines the ICC account information. **System capability**: SystemCapability.Telephony.CoreService -| 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.| -| isActive | boolean | Yes | Whether the card is activated. | -| iccId | string | Yes | ICCID number. | -| showName | string | Yes | SIM card display name. | -| showNumber | string | Yes | SIM card display number. | +| 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.| +| isActive | boolean | Yes | Whether the card is activated. | +| iccId | string | Yes | ICCID number. | +| showName | string | Yes | SIM card display name. | +| showNumber | string | Yes | SIM card display number. | ## OperatorConfig8+ @@ -2905,10 +4008,10 @@ Defines the carrier configuration. **System capability**: SystemCapability.Telephony.CoreService -| Name | Type | Mandatory | Description | -| -------- | ------- | --------- | ----------- | -| field | string | Yes | Field. | -| value | string | Yes | Value. | +| Name | Type | Mandatory| Description| +| ----- | ------ | ---- | ---- | +| field | string | Yes | Field.| +| value | string | Yes | Value. | ## DiallingNumbersInfo8+ @@ -2918,12 +4021,12 @@ Defines the contact number information. **System capability**: SystemCapability.Telephony.CoreService -| Name | Type | Mandatory | Description | -| -------- | ------- | --------- | ----------- | -| alphaTag | string | Yes | Alpha tag. | -| number | string | Yes | Contact number. | -| recordNumber | number | Yes | Record number.| -| pin2 | string | Yes | PIN 2.| +| Name | Type | Mandatory| Description | +| ------------ | ------ | ---- | ---------- | +| alphaTag | string | Yes | Tag. | +| number | string | Yes | Call transfer number. | +| recordNumber | number | Yes | Record number.| +| pin2 | string | Yes | PIN 2.| ## ContactType8+ @@ -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. | @@ -2946,8 +4049,8 @@ Enumerates carrier configuration keys. **System capability**: SystemCapability.Telephony.CoreService -| Name | Value | Description | -| ------------------------------------------------------- | ---------------------------------------------------- | -------------------- | +| 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. | diff --git a/en/application-dev/reference/apis/js-apis-sms.md b/en/application-dev/reference/apis/js-apis-sms.md index 901e3b258b7aa73530935baa81a6366f7aa50e65..fa060c0d474ef8b0fdca74e517bfebca03f44b7a 100644 --- a/en/application-dev/reference/apis/js-apis-sms.md +++ b/en/application-dev/reference/apis/js-apis-sms.md @@ -16,7 +16,7 @@ import sms from '@ohos.telephony.sms'; createMessage\(pdu: Array<number>, specification: string, callback: AsyncCallback\): 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<number>, specification: string\): Promise -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<number>\): 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<number> | Yes | Callback used to return the result.
- **0**: card slot 1
- **1**: card slot 2| +| callback | AsyncCallback<number> | Yes | Callback used to return the result.
- **0**: card slot 1
- **1**: card slot 2| **Example** @@ -137,7 +137,7 @@ sms.getDefaultSmsSlotId((err, data) => { getDefaultSmsSlotId\(\): Promise<number> -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<void>\): 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.
- **0**: card slot 1
- **1**: card slot 2
- **-1**: clearing the default configuration| +| slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2
- **-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. | + **Example** ```js @@ -190,11 +203,11 @@ sms.setDefaultSmsSlotId(0, (err, data) => { setDefaultSmsSlotId\(slotId: number\): Promise<void> -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.
- **0**: card slot 1
- **1**: card slot 2
- **-1**: clearing the default configuration| +| slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2
- **-1**: Clears the default configuration.| **Return value** -| Type | Description | -| -------------- | ------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| --------------- | ------------------------------- | +| Promise\ | 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<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 @@ -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<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 @@ -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.
- **0**: card slot 1
- **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 @@ -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<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 @@ -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> | 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> | 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<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 @@ -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<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 @@ -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<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 @@ -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<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 @@ -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<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 @@ -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<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 @@ -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.
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback> | 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)\>> | 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<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 @@ -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<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 @@ -820,7 +1038,18 @@ Obtains SMS message segment information. This API uses an asynchronous callback | slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **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<[SmsSegmentsInfo](#smssegmentsinfo8)> | 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.
- **0**: card slot 1
- **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<[SmsSegmentsInfo](#smssegmentsinfo8)> | 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.
- **0**: card slot 1
- **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. | +| 8300999 | Unknown error code. | + **Example** ```js @@ -899,7 +1150,7 @@ sms.isImsSmsSupported(slotId, (err, data) => { isImsSmsSupported(slotId: number): Promise -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<boolean> | 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<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 @@ -970,6 +1244,18 @@ Obtains the SMS format supported by the IMS. This API uses a promise to return 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 | +| -------- | -------------------------------------------- | +| 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 | Yes | MMS message file path.| | callback | AsyncCallback<[MmsInformation](#mmsinformation8)> | 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<<[MmsInformation](#mmsinformation8)>> | 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>): 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<Array> | 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> -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<Array> | 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,19 +1455,19 @@ 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**.
**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**.
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**.
**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. | -| pdu | Array<number> | Yes | PDU in the SMS message. | -| protocolId | number | Yes | Protocol identifier used for delivering the SMS message. | -| scAddress | string | Yes | SMSC address. | -| scTimestamp | number | Yes | SMSC timestamp. | -| status | number | Yes | SMS message status sent by the SMSC in the **SMS-STATUS-REPORT** message.| -| visibleMessageBody | string | Yes | SMS message body. | -| visibleRawAddress | string | Yes | Sender address. | +| Name | Type | Mandatory| Description | +| ------------------------ | --------------------------------------- | ---- | ------------------------------------------------------------ | +| hasReplyPath | boolean | Yes | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.
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**.
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**.
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<number> | Yes | PDU in the SMS message. | +| protocolId | number | Yes | Protocol identifier used for delivering the SMS message. | +| scAddress | string | Yes | SMSC address. | +| scTimestamp | number | Yes | SMSC timestamp. | +| status | number | Yes | SMS message status sent by the SMSC in the **SMS-STATUS-REPORT** message.| +| visibleMessageBody | string | Yes | SMS message body. | +| visibleRawAddress | string | Yes | Sender address. | ## ShortMessageClass @@ -1161,7 +1491,7 @@ Provides the options (including callbacks) for sending an SMS message. For examp **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages.
- **0**: card slot 1
- **1**: card slot 2 | | destinationHost | string | Yes | Destination address of the SMS message. | @@ -1178,22 +1508,22 @@ Provides the callback for the SMS message sending result. It consists of three p **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | -| ---------- | ------------------------------- | ---- | ------------------------------------------------------------ | +| Name | Type | Mandatory| Description | +| ---------- | ------------------------------- | ---- | ----------------------------------------------------------------------------------------- | | isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.| -| result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. | -| url | string | Yes | URI for storing the sent SMS message. | +| result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. | +| url | string | Yes | URI for storing the sent SMS message. | ## IDeliveryShortMessageCallback -Provides the callback for the SMS message delivery report. +Provides the callback for the SMS message delivery report. **System capability**: SystemCapability.Telephony.SmsMms | Name| Type | Mandatory| Description | -| ------ | ------------------- | ---- | -------------- | -| pdu | Array<number> | Yes | SMS message delivery report.| +| ---- | ------------------- | ---- | -------------- | +| pdu | Array<number> | Yes | SMS message delivery report.| ## SendSmsResult @@ -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.| - ## MmsInformation8+ Defines the MMS message information. @@ -1218,10 +1547,10 @@ 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.| +| 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.| | attachment | Array<[MmsAttachment](#mmsattachment8)\> | No | Attachment. | ## MmsSendReq8+ @@ -1232,13 +1561,13 @@ Defines an MMS message sending request. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------------- | ------------------------------------ | ---- | ------------ | | from | [MmsAddress](#mmsaddress8) | Yes | MMS message source. | | 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. | @@ -1258,7 +1587,7 @@ Defines the MMS message sending configuration. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ------------- | ---------------------------------- | ---- | -------- | | responseState | number | Yes | Response status.| | transactionId | string | Yes | Transaction ID. | @@ -1273,7 +1602,7 @@ Defines an MMS notification index. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | --------------- | ---------------------------------- | ---- | -------- | | transactionId | string | Yes | Transaction ID. | | messageClass | number | Yes | Message class. | @@ -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. | @@ -1294,7 +1623,7 @@ Defines an MMS confirmation index. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ------------- | ---------------------------------- | ---- | -------- | | transactionId | string | Yes | Transaction ID. | | version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | @@ -1308,15 +1637,15 @@ Defines the MMS message retrieval configuration. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------------- | ------------------------------------ | ---- | -------- | | transactionId | string | Yes | Transaction ID. | | 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. | @@ -1333,16 +1662,15 @@ Defines the original MMS message reading index. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------- | ---------------------------------- | ---- | -------- | | 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.| - ## MmsReadRecInd8+ Defines the MMS message reading index. @@ -1351,16 +1679,15 @@ Defines the MMS message reading index. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------- | ---------------------------------- | ---- | -------- | -| version | [MmsVersionType](#mmsversiontype8) | Yes | Version | +| version | [MmsVersionType](#mmsversiontype8) | Yes | Version. | | messageId | string | Yes | Message ID. | -| 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. | - ## MmsAttachment8+ Defines the attachment of an MMS message. @@ -1369,7 +1696,7 @@ Defines the attachment of an MMS message. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------------------- | ------------------------------------ | ---- | ------------------ | | contentId | string | Yes | Content ID. | | contentLocation | string | Yes | Content location. | @@ -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 | No | In the buffer | +| inBuff | Array | No | Whether the message is in the buffer. | | fileName | string | No | File name. | | charset | [MmsCharSets](#mmscharsets8) | No | Character set. | @@ -1390,20 +1717,20 @@ Defines an MMSC address. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ------- | ---------------------------- | ---- | ------ | -| address | string | Yes | MMSC address. | +| address | string | Yes | Network address. | | charset | [MmsCharSets](#mmscharsets8) | Yes | Character set.| ## MessageType8+ -Enumerates message types. +Message type. **System API**: This is a system API. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | ------------------------- | ---- | -------------------- | | TYPE_MMS_SEND_REQ | 128 | MMS message sending request. | | TYPE_MMS_SEND_CONF | 129 | MMS message sending configuration. | @@ -1423,7 +1750,7 @@ Enumerates MMS message priorities. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | ---------- | ---- | -------------- | | MMS_LOW | 128 | Low priority. | | MMS_NORMAL | 129 | Normal priority.| @@ -1437,7 +1764,7 @@ Enumerates MMS versions. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | --------------- | ---- | ----------- | | MMS_VERSION_1_0 | 0x10 | MMS version 1_0.| | MMS_VERSION_1_1 | 0x11 | MMS version 1_1.| @@ -1452,7 +1779,7 @@ Enumerates MMS character sets. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | --------------- | ------ | ------------------- | | BIG5 | 0X07EA | BIG5 format. | | ISO_10646_UCS_2 | 0X03E8 | ISO_10646_UCS_2 format.| @@ -1477,7 +1804,7 @@ Enumerates disposition types. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | ---------- | ---- | -------- | | FROM_DATA | 0 | Data source.| | ATTACHMENT | 1 | Attachment. | @@ -1491,7 +1818,7 @@ Enumerates report types. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description| +| Name | Value | Description| | ------- | ---- | ---- | | MMS_YES | 128 | YES | | MMS_NO | 129 | NO | @@ -1504,7 +1831,7 @@ Defines the cell broadcast configuration options. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------------- | -------------------- | ---- | ------------ | | slotId | number | Yes | Card slot ID. | | enable | boolean | Yes | Whether to enable cell broadcast. | @@ -1520,7 +1847,7 @@ Defines the SIM message status. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | ------------------------- | ---- | --------------------------- | | SIM_MESSAGE_STATUS_FREE | 0 | Free state. | | SIM_MESSAGE_STATUS_READ | 1 | Read state. | @@ -1530,13 +1857,13 @@ Defines the SIM message status. ## RanType7+ -Enumerates RAN types. +RAN type. **System API**: This is a system API. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description| +| Name | Value | Description| | --------- | ---- | ---- | | TYPE_GSM | 1 | GSM | | TYPE_CDMA | 2 | CMDA | @@ -1549,7 +1876,7 @@ Enumerates SMS encoding schemes. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Value | Description | +| Name | Value | Description | | -------------------- | ---- | ------------ | | SMS_ENCODING_UNKNOWN | 0 | Unknown code.| | SMS_ENCODING_7BIT | 1 | 7-digit code. | @@ -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. | ## UpdateSimMessageOptions7+ @@ -1579,7 +1906,7 @@ Defines the updating SIM message options. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | --------- | -------------------------------------- | ---- | -------------- | | slotId | number | Yes | Card slot ID. | | msgIndex | number | Yes | Message index. | @@ -1595,7 +1922,7 @@ Defines a SIM message. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------------- | -------------------------------------- | ---- | ------------- | | shortMessage | [ShortMessage](#shortmessage) | Yes | SMS message. | | simMessageStatus | [SimMessageStatus](#simmessagestatus7) | Yes | SIM message status.| @@ -1609,12 +1936,12 @@ Defines an MMS message delivery index. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | --------- | ---------------------------------- | ---- | ------ | | 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. | ## MmsRespInd8+ @@ -1625,7 +1952,7 @@ Defines an MMS response index. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ------------- | ---------------------------------- | ---- | -------- | | transactionId | string | Yes | Event ID. | | status | number | Yes | Status. | @@ -1640,7 +1967,7 @@ Defines the SMS message segment information. **System capability**: SystemCapability.Telephony.SmsMms -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------------------- | ---------------------------------------- | ---- | ------------ | | splitCount | number | Yes | Split count. | | encodeCount | number | Yes | Encoding count. | diff --git a/en/application-dev/reference/apis/js-apis-telephony-data.md b/en/application-dev/reference/apis/js-apis-telephony-data.md index f1c9ad362175bd709d27bc4c7aec0059b413221e..8d913cb0c597bb8a0c5de46361d51d4582ae9ed7 100644 --- a/en/application-dev/reference/apis/js-apis-telephony-data.md +++ b/en/application-dev/reference/apis/js-apis-telephony-data.md @@ -1,6 +1,6 @@ # @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.
**0**: card slot 1
**1**: card slot 2
**-1**: Clears the default configuration.| | callback | AsyncCallback\ | 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\ | 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\ | Yes | Callback used to return the result.
**true**: The cellular data service is enabled.
**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\ | Promise used to return the result.
**true**: The cellular data service is enabled.
**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.
**0**: card slot 1
**1**: card slot 2 | | callback | AsyncCallback\ | Yes | Callback used to return the result.
**true**: Roaming is enabled for the cellular data service.
**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\ | Promise used to return the result.
**true**: Roaming is enabled for the cellular data service.
**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\ | 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\ | 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\ | 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\ | 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.
**0**: card slot 1
**1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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.
**0**: card slot 1
**1**: card slot 2| | callback | AsyncCallback\ | 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\ | 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 diff --git a/en/application-dev/reference/errorcodes/errorcode-telephony.md b/en/application-dev/reference/errorcodes/errorcode-telephony.md new file mode 100644 index 0000000000000000000000000000000000000000..f90efffed3589a42344d27fcbbf641872e295a96 --- /dev/null +++ b/en/application-dev/reference/errorcodes/errorcode-telephony.md @@ -0,0 +1,172 @@ +# 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.