diff --git a/en/application-dev/reference/apis/js-apis-contact.md b/en/application-dev/reference/apis/js-apis-contact.md index 610f802066ab324e80c663d61513b062f9dfc9bf..e9ac02205ed355fb1a0933f449ebd9b304277adc 100644 --- a/en/application-dev/reference/apis/js-apis-contact.md +++ b/en/application-dev/reference/apis/js-apis-contact.md @@ -465,8 +465,6 @@ selectContact(callback: AsyncCallback<Array<Contact>>): void Selects a contact. This API uses an asynchronous callback to return the result. -This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. - **Permission required**: ohos.permission.READ_CONTACTS **System capability**: SystemCapability.Applications.Contacts and SystemCapability.Applications.ContactsData @@ -495,8 +493,6 @@ selectContact(): Promise<Array<Contact>> Selects a contact. This API uses a promise to return the result. -This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. - **Permission required**: ohos.permission.READ_CONTACTS **System capability**: SystemCapability.Applications.Contacts and SystemCapability.Applications.ContactsData diff --git a/en/application-dev/reference/apis/js-apis-hichecker.md b/en/application-dev/reference/apis/js-apis-hichecker.md index 914533beb47d9d4505fa7624d06f89f7a1e45984..ec2833f49fca4f4f570ac45f25cdefaa5741702e 100644 --- a/en/application-dev/reference/apis/js-apis-hichecker.md +++ b/en/application-dev/reference/apis/js-apis-hichecker.md @@ -1,6 +1,8 @@ # HiChecker -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+HiChecker is provided for you to check issues that may be easily ignored during development of OpenHarmony applications (including system-built and third-party applications). Such issues include calling of time-consuming functions by key application threads, event distribution and execution timeout in application processes, and ability resource leakage in application processes. The issues are recorded in logs or lead to process crashes explicitly so that you can find and rectify them. + +> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -11,7 +13,7 @@ import hichecker from '@ohos.hichecker'; ``` -## Constants +## Constant Provides the constants of all rule types. @@ -19,16 +21,15 @@ Provides the constants of all rule types. | Name | Type| Description | | ---------------------------------- | -------- | ------------------------------------------------------ | -| 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\_THREAD\_CHECK\_SLOW\_PROCESS | BigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. | -| RULE\_CHECK\_SLOW\_EVENT | BigInt | Caution rule, which is programmed to detect whether the event distribution or processing time has exceeded the specified time threshold. | -| RULE\_CHECK\_ABILITY\_CONNECTION\_LEAK| BigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. | +| 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_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. | ## 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. @@ -36,9 +37,9 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac **Parameters** -| Name | Type | Mandatory | Description | +| Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------- | -| rule | BigInt | Yes | Rule to be added. | +| rule | bigint | Yes | Rule to be added.| **Example** @@ -53,7 +54,7 @@ hichecker.addRule( ## hichecker.removeRule -removeRule(rule: BigInt): void +removeRule(rule: bigint): void Removes one or more rules. The removed rules will become ineffective. @@ -61,9 +62,9 @@ Removes one or more rules. The removed rules will become ineffective. **Parameters** -| Name | Type | Mandatory | Description | +| Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------- | -| rule | BigInt | Yes | Rule to be removed. | +| rule | bigint | Yes | Rule to be removed.| **Example** @@ -78,7 +79,7 @@ hichecker.removeRule( ## hichecker.getRule -getRule(): BigInt +getRule(): bigint Obtains a collection of thread, process, and alarm rules that have been added. @@ -88,7 +89,7 @@ Obtains a collection of thread, process, and alarm rules that have been added. | Type | Description | | ------ | ---------------------- | -| BigInt | Collection of added rules. | +| bigint | Collection of added rules.| **Example** @@ -97,12 +98,12 @@ Obtains a collection of thread, process, and alarm rules that have been added. hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // Obtain the collection of added rules. -hichecker.getRule(); // Return 1n. +hichecker.getRule(); // return 1n; ``` ## 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. @@ -110,15 +111,15 @@ Checks whether the specified rule exists in the collection of added rules. If th **Parameters** -| Name | Type | Mandatory | Description | +| Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------- | -| rule | BigInt | Yes | Rule to be checked. | +| rule | bigint | Yes | Rule to be checked.| **Return value** | 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** @@ -127,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); // 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_CAUTION_PRINT_LOG); // Return false. -``` \ No newline at end of file +hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // return true; +hichecker.contains(hichecker.RULE_CAUTION_PRINT_LOG); // return false; +``` diff --git a/en/application-dev/reference/apis/js-apis-sms.md b/en/application-dev/reference/apis/js-apis-sms.md index 85e8f3f411ea91289ecfcb410eae43b6ea4e57b6..a264817ec018ad6a7fe22888ea0f7a3c5f223fcf 100644 --- a/en/application-dev/reference/apis/js-apis-sms.md +++ b/en/application-dev/reference/apis/js-apis-sms.md @@ -6,13 +6,13 @@ ## Modules to Import -```js +``` import sms from '@ohos.telephony.sms'; ``` ## sms.createMessage -createMessage\(pdu: Array, specification: string, callback: AsyncCallback\): void +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. @@ -28,7 +28,7 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp **Example** -```js +``` const specification = '3gpp'; // Display PDUs using numbers in an array, for example, [0x08, 0x91, ...]. const pdu = [0x08, 0x91]; @@ -40,7 +40,7 @@ sms.createMessage(pdu, specification, (err, data) => { ## sms.createMessage -createMessage\(pdu: Array, specification: string\): Promise +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. @@ -61,7 +61,7 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol. **Example** -```js +``` const specification = '3gpp'; // Display PDUs using numbers in an array, for example, [0x08, 0x91, ...]. const pdu = [0x08, 0x91]; @@ -91,7 +91,7 @@ Sends an SMS message. **Example** -```js +``` let sendCallback = function (err, data) { console.log(`sendCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); } @@ -110,7 +110,7 @@ sms.sendMessage(options); ## sms.getDefaultSmsSlotId7+ -getDefaultSmsSlotId\(callback: AsyncCallback\): void +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. @@ -124,7 +124,7 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use **Example** -```js +``` sms.getDefaultSmsSlotId((err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); @@ -133,7 +133,7 @@ sms.getDefaultSmsSlotId((err, data) => { ## sms.getDefaultSmsSlotId7+ -getDefaultSmsSlotId\(\): Promise +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. @@ -143,11 +143,11 @@ Obtains the default slot of the SIM card used to send SMS messages. This API use | Type | Description | | --------------- | ------------------------------------------------------------ | -| Promise | Promise used to return the result.
- **0**: card slot 1
- **1**: card slot 2| +| Promise<number> | Promise used to return the result.
- **0**: card slot 1
- **1**: card slot 2| **Example** -```js +``` let promise = sms.getDefaultSmsSlotId(); promise.then(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. **Example** -```js +``` let slotId = 0; let smscAddr = '+861xxxxxxxxxx'; sms.setSmscAddr(slotId, smscAddr, (err,data) => { @@ -215,7 +215,7 @@ This is a system API and cannot be called by third-party applications. **Example** -```js +``` let slotId = 0; let smscAddr = '+861xxxxxxxxxx'; let promise = sms.setSmscAddr(slotId, smscAddr); @@ -248,7 +248,7 @@ This is a system API and cannot be called by third-party applications. **Example** -```js +``` let slotId = 0; sms.getSmscAddr(slotId, (err, 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. **Example** -```js +``` let slotId = 0; let promise = sms.getSmscAddr(slotId); promise.then(data => { @@ -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.
- **false**: The device cannot send or receive SMS messages.| -```js +``` let result = sms.hasSmsCapability(); console.log(`hasSmsCapability: ${JSON.stringify(result)}`); ``` @@ -319,7 +319,7 @@ Defines an SMS message instance. | Name | Type | Description | | ------------------------ | --------------------------------------- | ------------------------------------------------------------ | -| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.
**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**.
**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**.
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**.
**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. | @@ -390,7 +390,7 @@ Provides the callback for the SMS message sending result. Return the SMS deliver ## SendSmsResult -SMS message sending result. +Enumerates SMS message sending results. **System capability**: SystemCapability.Telephony.SmsMms diff --git a/en/application-dev/reference/apis/js-apis-webSocket.md b/en/application-dev/reference/apis/js-apis-webSocket.md index a1a24975f9e67c6acfccfc42fe9669b07fa90e22..edf6be53ac623c5fa4a8f1542bf7222dc42e713c 100644 --- a/en/application-dev/reference/apis/js-apis-webSocket.md +++ b/en/application-dev/reference/apis/js-apis-webSocket.md @@ -3,7 +3,6 @@ >![](public_sys-resources/icon-note.gif) **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. > ->Newly added APIs are defined but not implemented in OpenHarmony 3.1 Release. They will be available for use in OpenHarmony 3.1 MR. You can use WebSocket to establish a bidirectional connection between a server and a client. Before doing this, you need to use the [createWebSocket](#websocketcreatewebsocket) API to create a [WebSocket](#websocket) object and then use the [connect](#connect) API to connect to the server. If the connection is successful, the client will receive a callback of the [open](#onopen) event. Then, the client can communicate with the server using the [send](#send) API. When the server sends a message to the client, the client will receive a callback of the [message](#onmessage) event. If the client no longer needs this connection, it can call the [close](#close) API to disconnect from the server. Then, the client will receive a callback of the [close](#onclose) event. diff --git a/en/application-dev/telephony/jumping-to-the-dial-screen.md b/en/application-dev/telephony/jumping-to-the-dial-screen.md index 17e25b8def58082d335bd836b35fd446a6e2591c..b314f4c138d93dbb8870f1d2098b5f5e9f10b6bc 100644 --- a/en/application-dev/telephony/jumping-to-the-dial-screen.md +++ b/en/application-dev/telephony/jumping-to-the-dial-screen.md @@ -1,6 +1,6 @@ # 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 diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md index 7c08b1ef336a377fea1da22efb291c9be19f4e64..06033bd48bdd941aa104a3997a323b9359576c62 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md @@ -31,7 +31,7 @@ For details about the HiSysEvent class, see the API reference. | static const std::string AAFWK | Atomic ability subsystem| | static const std::string APPEXECFWK | User program framework subsystem| | static const std::string ACCOUNT | Account subsystem| -| static const std::string ACE | JS application framework| +| static const std::string ARKUI | ARKUI subsystem| | static const std::string AI | AI subsystem| | static const std::string BARRIER_FREE | Accessibility subsystem| | static const std::string BIOMETRICS | Biometric recognition subsystem| diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md index 79e3539bbb9d4248344c93664e21715b40895c16..7e6b3a45e72d58f6f0b1847b38dc817ef82a8ae3 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-tool.md @@ -47,13 +47,13 @@ The HiSysEvent tool is a command line tool preconfigured in the **/system/bin** ``` # hisysevent -r -t "TAG" -c PREFIX - {"domain_":"ACE","name_":"UI_BLOCK_6S","type_":1,"time_":1501940269812,"tz_":"+0000","tag_":"TAG1","pid_":1428,"tid_":1452,"uid_":10001,"level_":"CRITICAL","info_":""} + {"domain_":"ARKUI","name_":"UI_BLOCK_6S","type_":1,"time_":1501940269812,"tz_":"+0000","tag_":"TAG1","pid_":1428,"tid_":1452,"uid_":10001,"level_":"CRITICAL","info_":""} # hisysevent -r -t "TA\w{0,1}" -c REGULAR {"domain_":"WINDOWMANAGER","name_":"NO_FOCUS_WINDOW","type_":1,"time_":1501940269802,"tz_":"+0000","tag_":"TAG","pid_":1428,"tid_":1433,"uid_":10001,"level_":"CRITICAL","info_":""} - {"domain_":"ACE","name_":"UI_BLOCK_6S","type_":1,"time_":1501940269812,"tz_":"+0000","tag_":"TAG1","pid_":1428,"tid_":1452,"uid_":10001,"level_":"CRITICAL","info_":""} + {"domain_":"ARKUI","name_":"UI_BLOCK_6S","type_":1,"time_":1501940269812,"tz_":"+0000","tag_":"TAG1","pid_":1428,"tid_":1452,"uid_":10001,"level_":"CRITICAL","info_":""} # hisysevent -r -t "TA\w+" -c REGULAR {"domain_":"WINDOWMANAGER","name_":"NO_FOCUS_WINDOW","type_":1,"time_":1501940269802,"tz_":"+0000","tag_":"TAG","pid_":1428,"tid_":1433,"uid_":10001,"level_":"CRITICAL","info_":""} - {"domain_":"ACE","name_":"UI_BLOCK_6S","type_":1,"time_":1501940269812,"tz_":"+0000","tag_":"TAG1","pid_":1428,"tid_":1452,"uid_":10001,"level_":"CRITICAL","info_":""} + {"domain_":"ARKUI","name_":"UI_BLOCK_6S","type_":1,"time_":1501940269812,"tz_":"+0000","tag_":"TAG1","pid_":1428,"tid_":1452,"uid_":10001,"level_":"CRITICAL","info_":""} ``` - Command for subscribing to real-time system events by event domain and event name: