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

!5109 【英文】翻译已完成4642

Merge pull request !5109 from shawn_he/4642-a
...@@ -21,15 +21,15 @@ Provides the constants of all rule types. ...@@ -21,15 +21,15 @@ Provides the constants of all rule types.
| Name | Type| Description | | Name | Type| Description |
| ---------------------------------- | -------- | ------------------------------------------------------ | | ---------------------------------- | -------- | ------------------------------------------------------ |
| RULE_CAUTION_PRINT_LOG | bigInt | Alarm rule, which is programmed to print a log when an alarm is generated. | | RULE_CAUTION_PRINT_LOG | bigint | Alarm rule, which is programmed to print a log when an alarm is generated. |
| RULE_CAUTION_TRIGGER_CRASH | bigInt | Alarm rule, which is programmed to force the application to exit when an alarm is generated. | | RULE_CAUTION_TRIGGER_CRASH | bigint | Alarm rule, which is programmed to force the application to exit when an alarm is generated. |
| RULE_THREAD_CHECK_SLOW_PROCESS | bigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. | | RULE_THREAD_CHECK_SLOW_PROCESS | bigint | Caution rule, which is programmed to detect whether any time-consuming function is invoked. |
| RULE_CHECK_ABILITY_CONNECTION_LEAK | bigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. | | RULE_CHECK_ABILITY_CONNECTION_LEAK | bigint | Caution rule, which is programmed to detect whether ability leakage has occurred. |
## hichecker.addRule ## hichecker.addRule
addRule(rule: bigInt): void addRule(rule: bigint): void
Adds one or more rules. HiChecker detects unexpected operations or gives feedback based on the added rules. Adds one or more rules. HiChecker detects unexpected operations or gives feedback based on the added rules.
...@@ -39,7 +39,7 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac ...@@ -39,7 +39,7 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------- | | ------ | ------ | ---- | ---------------- |
| rule | bigInt | Yes | Rule to be added.| | rule | bigint | Yes | Rule to be added.|
**Example** **Example**
...@@ -54,7 +54,7 @@ hichecker.addRule( ...@@ -54,7 +54,7 @@ hichecker.addRule(
## hichecker.removeRule ## hichecker.removeRule
removeRule(rule: bigInt): void removeRule(rule: bigint): void
Removes one or more rules. The removed rules will become ineffective. Removes one or more rules. The removed rules will become ineffective.
...@@ -64,7 +64,7 @@ Removes one or more rules. The removed rules will become ineffective. ...@@ -64,7 +64,7 @@ Removes one or more rules. The removed rules will become ineffective.
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------- | | ------ | ------ | ---- | ---------------- |
| rule | bigInt | Yes | Rule to be removed.| | rule | bigint | Yes | Rule to be removed.|
**Example** **Example**
...@@ -79,7 +79,7 @@ hichecker.removeRule( ...@@ -79,7 +79,7 @@ hichecker.removeRule(
## hichecker.getRule ## hichecker.getRule
getRule(): bigInt getRule(): bigint
Obtains a collection of thread, process, and alarm rules that have been added. 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. ...@@ -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,12 +98,12 @@ Obtains a collection of thread, process, and alarm rules that have been added. ...@@ -98,12 +98,12 @@ 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
contains(rule: bigInt): boolean contains(rule: bigint): boolean
Checks whether the specified rule exists in the collection of added rules. If the rule is of the thread level, this operation is performed only on the current thread. Checks whether the specified rule exists in the collection of added rules. If the rule is of the thread level, this operation is performed only on the current thread.
...@@ -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;
``` ```
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
## Modules to Import ## Modules to Import
```js ```
import sms from '@ohos.telephony.sms'; import sms from '@ohos.telephony.sms';
``` ```
## sms.createMessage ## sms.createMessage
createMessage\(pdu: Array<number\>, specification: string, callback: AsyncCallback<ShortMessage\>\): void createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncCallback<ShortMessage\>\): void
Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This API uses an asynchronous callback to return the result. Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This API uses an asynchronous callback to return the result.
...@@ -28,7 +28,7 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp ...@@ -28,7 +28,7 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp
**Example** **Example**
```js ```
const specification = '3gpp'; const specification = '3gpp';
// Display PDUs using numbers in an array, for example, [0x08, 0x91, ...]. // Display PDUs using numbers in an array, for example, [0x08, 0x91, ...].
const pdu = [0x08, 0x91]; const pdu = [0x08, 0x91];
...@@ -40,7 +40,7 @@ sms.createMessage(pdu, specification, (err, data) => { ...@@ -40,7 +40,7 @@ sms.createMessage(pdu, specification, (err, data) => {
## sms.createMessage ## sms.createMessage
createMessage\(pdu: Array<number\>, specification: string\): Promise<ShortMessage\> createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortMessage\>
Creates an SMS message instance based on the PDU and the specified SMS protocol. This API uses a promise to return the result. Creates an SMS message instance based on the PDU and the specified SMS protocol. This API uses a promise to return the result.
...@@ -61,7 +61,7 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol. ...@@ -61,7 +61,7 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol.
**Example** **Example**
```js ```
const specification = '3gpp'; const specification = '3gpp';
// Display PDUs using numbers in an array, for example, [0x08, 0x91, ...]. // Display PDUs using numbers in an array, for example, [0x08, 0x91, ...].
const pdu = [0x08, 0x91]; const pdu = [0x08, 0x91];
...@@ -91,7 +91,7 @@ Sends an SMS message. ...@@ -91,7 +91,7 @@ Sends an SMS message.
**Example** **Example**
```js ```
let sendCallback = function (err, data) { let sendCallback = function (err, data) {
console.log(`sendCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`sendCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
} }
...@@ -110,7 +110,7 @@ sms.sendMessage(options); ...@@ -110,7 +110,7 @@ sms.sendMessage(options);
## sms.getDefaultSmsSlotId<sup>7+</sup> ## sms.getDefaultSmsSlotId<sup>7+</sup>
getDefaultSmsSlotId\(callback: AsyncCallback<number\>\): void getDefaultSmsSlotId\(callback: AsyncCallback&lt;number&gt;\): void
Obtains the default slot of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result. Obtains the default slot of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result.
...@@ -124,7 +124,7 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use ...@@ -124,7 +124,7 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use
**Example** **Example**
```js ```
sms.getDefaultSmsSlotId((err, data) => { sms.getDefaultSmsSlotId((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
}); });
...@@ -133,7 +133,7 @@ sms.getDefaultSmsSlotId((err, data) => { ...@@ -133,7 +133,7 @@ sms.getDefaultSmsSlotId((err, data) => {
## sms.getDefaultSmsSlotId<sup>7+</sup> ## sms.getDefaultSmsSlotId<sup>7+</sup>
getDefaultSmsSlotId\(\): Promise<number\> getDefaultSmsSlotId\(\): Promise&lt;number&gt;
Obtains the default slot of the SIM card used to send SMS messages. This API uses a promise to return the result. Obtains the default slot of the SIM card used to send SMS messages. This API uses a promise to return the result.
...@@ -143,11 +143,11 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use ...@@ -143,11 +143,11 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use
| Type | Description | | Type | Description |
| --------------- | ------------------------------------------------------------ | | --------------- | ------------------------------------------------------------ |
| Promise<number> | Promise used to return the result.<br>- **0**: card slot 1<br>- **1**: card slot 2| | Promise&lt;number&gt; | Promise used to return the result.<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Example** **Example**
```js ```
let promise = sms.getDefaultSmsSlotId(); let promise = sms.getDefaultSmsSlotId();
promise.then(data => { promise.then(data => {
console.log(`getDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`); console.log(`getDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`);
...@@ -179,7 +179,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -179,7 +179,7 @@ This is a system API and cannot be called by third-party applications.
**Example** **Example**
```js ```
let slotId = 0; let slotId = 0;
let smscAddr = '+861xxxxxxxxxx'; let smscAddr = '+861xxxxxxxxxx';
sms.setSmscAddr(slotId, smscAddr, (err,data) => { sms.setSmscAddr(slotId, smscAddr, (err,data) => {
...@@ -215,7 +215,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -215,7 +215,7 @@ This is a system API and cannot be called by third-party applications.
**Example** **Example**
```js ```
let slotId = 0; let slotId = 0;
let smscAddr = '+861xxxxxxxxxx'; let smscAddr = '+861xxxxxxxxxx';
let promise = sms.setSmscAddr(slotId, smscAddr); let promise = sms.setSmscAddr(slotId, smscAddr);
...@@ -248,7 +248,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -248,7 +248,7 @@ This is a system API and cannot be called by third-party applications.
**Example** **Example**
```js ```
let slotId = 0; let slotId = 0;
sms.getSmscAddr(slotId, (err, data) => { sms.getSmscAddr(slotId, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
...@@ -282,7 +282,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -282,7 +282,7 @@ This is a system API and cannot be called by third-party applications.
**Example** **Example**
```js ```
let slotId = 0; let slotId = 0;
let promise = sms.getSmscAddr(slotId); let promise = sms.getSmscAddr(slotId);
promise.then(data => { promise.then(data => {
...@@ -306,7 +306,7 @@ Checks whether the current device can send and receive SMS messages. This API wo ...@@ -306,7 +306,7 @@ Checks whether the current device can send and receive SMS messages. This API wo
| ------- | ------------------------------------------------------------ | | ------- | ------------------------------------------------------------ |
| boolean | - **true**: The device can send and receive SMS messages.<br>- **false**: The device cannot send or receive SMS messages.| | boolean | - **true**: The device can send and receive SMS messages.<br>- **false**: The device cannot send or receive SMS messages.|
```js ```
let result = sms.hasSmsCapability(); let result = sms.hasSmsCapability();
console.log(`hasSmsCapability: ${JSON.stringify(result)}`); console.log(`hasSmsCapability: ${JSON.stringify(result)}`);
``` ```
...@@ -319,7 +319,7 @@ Defines an SMS message instance. ...@@ -319,7 +319,7 @@ Defines an SMS message instance.
| Name | Type | Description | | Name | Type | Description |
| ------------------------ | --------------------------------------- | ------------------------------------------------------------ | | ------------------------ | --------------------------------------- | ------------------------------------------------------------ |
| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.| | hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: the path in which the device can reply to the SMS message through the originating SMSC.|
| isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.| | isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.|
| isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.<br>**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.| | isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.<br>**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.|
| messageClass | [ShortMessageClass](#shortmessageclass) | SMS message type. | | messageClass | [ShortMessageClass](#shortmessageclass) | SMS message type. |
...@@ -390,7 +390,7 @@ Provides the callback for the SMS message sending result. Return the SMS deliver ...@@ -390,7 +390,7 @@ Provides the callback for the SMS message sending result. Return the SMS deliver
## SendSmsResult ## SendSmsResult
SMS message sending result. Enumerates SMS message sending results.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
......
# Redirecting to the Dial Screen # Redirecting to the Dial Screen
You can use this service for your application to redirect users to the dial screen and display the dialed number. When the **makeCall** API is called, the phone or tablet will automatically display the dial screen. On this screen, the user can choose to make an audio or video call and specify the SIM card. You can use this service for your application to redirect users to the dial screen and display the dialed number. When the **makeCall** API is called, the device will automatically display the dial screen. On this screen, the user can choose to make an audio or video call and specify the SIM card.
## Available APIs ## Available APIs
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册