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

!4966 翻译已完成4351

Merge pull request !4966 from shawn_he/4351-a
...@@ -5,7 +5,6 @@ The call module provides call management functions, including making calls, redi ...@@ -5,7 +5,6 @@ The call module provides call management functions, including making calls, redi
To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange). To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange).
>**NOTE**<br> >**NOTE**<br>
>
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. >The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -27,10 +26,10 @@ Initiates a call. This API uses an asynchronous callback to return the result. ...@@ -27,10 +26,10 @@ Initiates a call. This API uses an asynchronous callback to return the result.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- | | ----------- | ---------------------------- | ---- | -------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure |
**Example** **Example**
...@@ -53,11 +52,11 @@ Initiates a call. You can set call options as needed. This API uses an asynchron ...@@ -53,11 +52,11 @@ Initiates a call. You can set call options as needed. This API uses an asynchron
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- | | ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. | | options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure |
**Example** **Example**
...@@ -82,16 +81,16 @@ Initiates a call. You can set call options as needed. This API uses a promise to ...@@ -82,16 +81,16 @@ Initiates a call. You can set call options as needed. This API uses a promise to
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | -------------------------------------- | | ----------- | --------------------------- | ---- | -------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call.| | options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------- | ------------------------------------------------------------ | | ---------------------- | ---------------------------------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure| | Promise&lt;boolean&gt; | Promise used to return the result.<br>- **true**: success<br>- **false**: failure |
**Example** **Example**
...@@ -116,10 +115,10 @@ Launches the call screen and displays the dialed number. This API uses an asynch ...@@ -116,10 +115,10 @@ Launches the call screen and displays the dialed number. This API uses an asynch
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------- | ---- | ------------------------------------------ | | ----------- | ------------------------- | ---- | ------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -140,15 +139,15 @@ Launches the call screen and displays the dialed number. This API uses a promise ...@@ -140,15 +139,15 @@ Launches the call screen and displays the dialed number. This API uses a promise
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------- | | ----------- | ------ | ---- | ---------- |
| phoneNumber | string | Yes | Phone number.| | phoneNumber | string | Yes | Phone number. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | --------------------------------- | | ------------------- | --------------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -171,9 +170,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to ...@@ -171,9 +170,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress. |
**Example** **Example**
...@@ -196,7 +195,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu ...@@ -196,7 +195,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu
| Type | Description | | Type | Description |
| ---------------------- | --------------------------------------- | | ---------------------- | --------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -220,9 +219,9 @@ Obtains the call status. This API uses an asynchronous callback to return the re ...@@ -220,9 +219,9 @@ Obtains the call status. This API uses an asynchronous callback to return the re
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | -------------------------------------------- | ---- | ------------------------------------ | | -------- | -------------------------------------------- | ---- | ------------------------------------ |
| callback | AsyncCallback&lt;[CallState](#callstate)&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;[CallState](#callstate)&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -245,7 +244,7 @@ Obtains the call status. This API uses a promise to return the result. ...@@ -245,7 +244,7 @@ Obtains the call status. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| -------------------------------------- | --------------------------------------- | | -------------------------------------- | --------------------------------------- |
| Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result.| | Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -270,7 +269,7 @@ Checks whether a device supports voice calls. ...@@ -270,7 +269,7 @@ Checks whether a device supports voice calls.
| Type | Description | | Type | Description |
| ------- | ------------------------------------------------------------ | | ------- | ------------------------------------------------------------ |
| boolean | - **true**: The device supports voice calls.<br>- **false**: The device does not support voice calls.| | boolean | - **true**: The device supports voice calls.<br>- **false**: The device does not support voice calls. |
```js ```js
let result = call.hasVoiceCapability(); let result = call.hasVoiceCapability();
...@@ -287,10 +286,10 @@ Checks whether the called number is an emergency number. This API uses an asynch ...@@ -287,10 +286,10 @@ Checks whether the called number is an emergency number. This API uses an asynch
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number. |
**Example** **Example**
...@@ -311,11 +310,11 @@ Checks whether the called number is an emergency number based on the phone numbe ...@@ -311,11 +310,11 @@ Checks whether the called number is an emergency number based on the phone numbe
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------------- | ---- | -------------------------------------------- | | ----------- | -------------------------------------------------- | ---- | -------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option. | | options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number. |
**Example** **Example**
...@@ -336,16 +335,16 @@ Checks whether the called number is an emergency number based on the phone numbe ...@@ -336,16 +335,16 @@ Checks whether the called number is an emergency number based on the phone numbe
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------------- | ---- | -------------- | | ----------- | -------------------------------------------------- | ---- | -------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option.| | options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------- | --------------------------------------------------- | | ---------------------- | --------------------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -370,10 +369,10 @@ A formatted phone number is a standard numeric string, for example, 555 0100. ...@@ -370,10 +369,10 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ------------------------------------ | | ----------- | --------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -395,11 +394,11 @@ A formatted phone number is a standard numeric string, for example, 555 0100. ...@@ -395,11 +394,11 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------- | ---- | ------------------------------------ | | ----------- | -------------------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code. | | options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -424,16 +423,16 @@ A formatted phone number is a standard numeric string, for example, 555 0100. ...@@ -424,16 +423,16 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------- | ---- | ---------------------- | | ----------- | -------------------------------------------- | ---- | ---------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code.| | options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------- | | --------------------- | ------------------------------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -460,11 +459,11 @@ The phone number must match the specified country code. For example, for a China ...@@ -460,11 +459,11 @@ The phone number must match the specified country code. For example, for a China
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ----------------------------------------------------- | | ----------- | --------------------------- | ---- | ----------------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -491,16 +490,16 @@ All country codes are supported. ...@@ -491,16 +490,16 @@ All country codes are supported.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------------------------------- | | ----------- | ------ | ---- | ---------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.| | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------------------------ | | --------------------- | ------------------------------------------------------------ |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -521,7 +520,7 @@ Provides an option for determining whether a call is a video call. ...@@ -521,7 +520,7 @@ Provides an option for determining whether a call is a video call.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | ------- | ---- | ------------------------------------------------------------ | | ------ | ------- | ---- | ------------------------------------------------------------ |
| extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call| | extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
...@@ -536,7 +535,7 @@ Enumerates call states. ...@@ -536,7 +535,7 @@ Enumerates call states.
| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. | | CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. |
| CALL_STATE_IDLE | 0 | No call is in progress. | | CALL_STATE_IDLE | 0 | No call is in progress. |
| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. | | CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. |
| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.| | CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting. |
## EmergencyNumberOptions<sup>7+</sup> ## EmergencyNumberOptions<sup>7+</sup>
...@@ -544,7 +543,7 @@ Provides an option for determining whether a number is an emergency number for t ...@@ -544,7 +543,7 @@ Provides an option for determining whether a number is an emergency number for t
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name| Type | Mandatory| Description | | Name| Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------------------- | | ------ | ------ | ---- | ---------------------------------------------- |
| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
...@@ -554,6 +553,6 @@ Provides an option for number formatting. ...@@ -554,6 +553,6 @@ Provides an option for number formatting.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------------------------------------------------- | | ----------- | ------ | ---- | ---------------------------------------------------------- |
| countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.| | countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**. |
...@@ -89,7 +89,7 @@ Obtains a collection of thread, process, and alarm rules that have been added. ...@@ -89,7 +89,7 @@ Obtains a collection of thread, process, and alarm rules that have been added.
| Type | Description | | Type | Description |
| ------ | ---------------------- | | ------ | ---------------------- |
| bigint | Collection of added rules.| | bigint | Collection of added rules. |
**Example** **Example**
...@@ -98,7 +98,7 @@ Obtains a collection of thread, process, and alarm rules that have been added. ...@@ -98,7 +98,7 @@ Obtains a collection of thread, process, and alarm rules that have been added.
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
// Obtain the collection of added rules. // Obtain the collection of added rules.
hichecker.getRule(); // return 1n; hichecker.getRule(); // Return 1n.
``` ```
## hichecker.contains ## hichecker.contains
...@@ -113,13 +113,13 @@ Checks whether the specified rule exists in the collection of added rules. If th ...@@ -113,13 +113,13 @@ Checks whether the specified rule exists in the collection of added rules. If th
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------- | | ------ | ------ | ---- | ---------------- |
| rule | bigint | Yes | Rule to be checked.| | rule | bigint | Yes | Rule to be checked. |
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------- | ---------------------------------------------------------- | | ------- | ---------------------------------------------------------- |
| boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise.| | boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise. |
**Example** **Example**
...@@ -128,6 +128,6 @@ Checks whether the specified rule exists in the collection of added rules. If th ...@@ -128,6 +128,6 @@ Checks whether the specified rule exists in the collection of added rules. If th
hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
// Check whether the added rule exists in the collection of added rules. // Check whether the added rule exists in the collection of added rules.
hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // return true; hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // Return true
hichecker.contains(hichecker.RULE_CAUTION_PRINT_LOG); // return false; hichecker.contains(hichecker.RULE_CAUTION_PRINT_LOG); // Return false
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册