diff --git a/en/application-dev/device/device-location-info.md b/en/application-dev/device/device-location-info.md index f3572352e718bb77493d7dd2d097d2d7a82058c9..a153f69fbfe2b71362a4b7e5808fe57c1b7a4216 100644 --- a/en/application-dev/device/device-location-info.md +++ b/en/application-dev/device/device-location-info.md @@ -66,7 +66,7 @@ To learn more about the APIs for obtaining device location information, see [Geo If your application needs to access the device location information when running on the background, it must be configured to be able to run on the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background. - You can declare the required permission in your application's configuration file. For details, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). + You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../security/accesstoken-guidelines.md). 2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities. diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md index 34fe47f45abe436abf986da809e343fd638540d7..a04f49f6d46bd886af5b23c01e65ce7d0b689e85 100644 --- a/en/application-dev/reference/apis/js-apis-call.md +++ b/en/application-dev/reference/apis/js-apis-call.md @@ -796,7 +796,7 @@ call.reject(rejectMessageOptions, (err, data) => { ## call.reject7+ -reject(callId: number, callback: AsyncCallback): +reject(callId: number, callback: AsyncCallback\): void Rejects a call based on the specified call ID. This API uses an asynchronous callback to return the result. @@ -811,16 +811,11 @@ 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. | -**Return value** - -| Type | Description | -| ------------------- | --------------------------- | -| Promise<void> | Promise used to return the result.| **Example** ```js -call.reject(1, (error, data) => { +call.reject(1, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` @@ -1621,8 +1616,8 @@ This is a system API. **Example** ```js -call.on('callDetailsChange', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.on('callDetailsChange', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1646,8 +1641,8 @@ This is a system API. **Example** ```js -call.on('callEventChange', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.on('callEventChange', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1671,8 +1666,8 @@ This is a system API. **Example** ```js -call.on('callDisconnectedCause', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.on('callDisconnectedCause', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1696,8 +1691,8 @@ This is a system API. **Example** ```js -call.on('mmiCodeResult', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.on('mmiCodeResult', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1721,8 +1716,8 @@ This is a system API. **Example** ```js -call.off('callDetailsChange', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.off('callDetailsChange', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1746,8 +1741,8 @@ This is a system API. **Example** ```js -call.off('callEventChange', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.off('callEventChange', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1771,8 +1766,8 @@ This is a system API. **Example** ```js -call.off('callDisconnectedCause', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.off('callDisconnectedCause', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -1796,8 +1791,8 @@ This is a system API. **Example** ```js -call.off('mmiCodeResult', (err, data) => { - console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +call.off('mmiCodeResult', data => { + console.log(`callback: data->${JSON.stringify(data)}`); }); ``` @@ -2386,7 +2381,7 @@ This is a system API. let audioDeviceOptions={ bluetoothAddress: "IEEE 802-2014" } -call.setAudioDevice(1, audioDeviceOptions, (err, value) => { +call.setAudioDevice(1, audioDeviceOptions, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); ``` diff --git a/en/application-dev/reference/apis/js-apis-inputdevice.md b/en/application-dev/reference/apis/js-apis-inputdevice.md index a0065743ecde1fe42580aaf851276c936cf4d01e..f5cf9b1af9502462bd906302bee23fcff28780b4 100644 --- a/en/application-dev/reference/apis/js-apis-inputdevice.md +++ b/en/application-dev/reference/apis/js-apis-inputdevice.md @@ -207,6 +207,9 @@ try { console.info("oninputdevcie " + error.code + " " + error.message) } +// Enable listening for hot swap events of an input device. +inputDevice.on("change", listener); + // Disable this listener. try { inputDevice.off("change", this.callback); diff --git a/en/application-dev/reference/apis/js-apis-net-connection.md b/en/application-dev/reference/apis/js-apis-net-connection.md index 4502b4cd9601bf0ae050f972a674028fb271a86a..31414ab325572d7ed25a31b1b3a78a725dce39e6 100644 --- a/en/application-dev/reference/apis/js-apis-net-connection.md +++ b/en/application-dev/reference/apis/js-apis-net-connection.md @@ -309,6 +309,8 @@ reportNetConnected(netHandle: NetHandle, callback: AsyncCallback<void>): v Reports connection of the data network. This API uses an asynchronous callback to return the result. +If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module. + **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -337,6 +339,8 @@ reportNetConnected(netHandle: NetHandle): Promise<void> Reports connection of the data network. This API uses a promise to return the result. +If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module. + **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -351,7 +355,7 @@ Reports connection of the data network. This API uses a promise to return the re | Type| Description| | -------- | -------- | -| Promise<void> | Promise used to return the result.| +| Promise<void> | Promise that returns no value.| **Example** @@ -370,6 +374,8 @@ reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback<void>) Reports disconnection of the data network. This API uses an asynchronous callback to return the result. +If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module. + **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -398,6 +404,8 @@ reportNetDisconnected(netHandle: NetHandle): Promise<void> Reports disconnection of the data network. This API uses a promise to return the result. +If this API is called, the application considers that the network connection state (**ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED**) is inconsistent with that in the network management module. + **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -412,7 +420,7 @@ Reports disconnection of the data network. This API uses a promise to return the | Type| Description| | -------- | -------- | -| Promise<void> | Promise used to return the result.| +| Promise<void> | Promise that returns no value.| **Example** @@ -521,7 +529,7 @@ This is a system API. | Type | Description | | ------------------------------------------- | ----------------------------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise that returns no value.| **Example** @@ -570,7 +578,7 @@ This is a system API. | Type | Description | | ------------------------------------------- | ----------------------------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise that returns no value.| **Example** @@ -888,7 +896,7 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses | Type | Description | | -------------- | ---------------------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise that returns no value.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-sim.md b/en/application-dev/reference/apis/js-apis-sim.md index 206ad668b6dbdaf8f12d74423a92c5d6ebaf2853..a5515dadfbd141dc16bfa44b2edffea5013109f4 100644 --- a/en/application-dev/reference/apis/js-apis-sim.md +++ b/en/application-dev/reference/apis/js-apis-sim.md @@ -710,7 +710,7 @@ Sets a display name for the SIM card in the specified slot. This API uses an asy **Example** ```js -let name = "China Mobile"; +let name = "ShowName"; sim.setShowName(0, name, (err, data) => { console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); }); @@ -744,7 +744,7 @@ Sets a display name for the SIM card in the specified slot. This API uses a prom **Example** ```js -let name = "China Mobile"; +let name = "ShowName"; let promise = sim.setShowName(0, name); promise.then(data => { console.log(`setShowName success, promise: data->${JSON.stringify(data)}`); diff --git a/en/application-dev/reference/errorcodes/errorcode-AccessToken.md b/en/application-dev/reference/errorcodes/errorcode-AccessToken.md new file mode 100644 index 0000000000000000000000000000000000000000..306ad41da505db3a42a8d6668ce00b47c7e3f60e --- /dev/null +++ b/en/application-dev/reference/errorcodes/errorcode-AccessToken.md @@ -0,0 +1,140 @@ +# Access Token Error Codes + +## 401 Parameter Error + +### Error Message +Parameter error.${messageInfo}. + +### Possible Causes +This error code is reported if an error occurs during JS parameter parsing. The possible causes are as follows: +1. The number of input parameters is insufficient. +2. The parameter type is incorrect. + +### Solution +1. Add input parameters. +2. Correct parameter types. + + +## 201 Permission denied. + +### Error Message +Permission denied.${messageInfo}. + +### Possible Causes +This error code is reported if the application process that calls an API is not granted the required permission. The possible causes are as follows: +1. The application process is not granted the required permission. +2. The permission requires user authorization to take effect, but the application process does not obtain the user authorization. + +### Solution +1. Check whether the application process is granted the required permission. +2. Check whether the application process has obtained the user authorization if the permission requires user authorization to take effect. + + +## 12100001 Invalid Parameters + +### Error Message +Parameter invalid, message is ${messageInfo}. + +### Possible Causes +This error code is reported if an error occurs during parameter verification. The possible causes are as follows: +1. The value of **tokenId** is **0**. +2. The specified permission name is empty or contains more than 256 characters. +3. The **flag** value in the permission authorization or revocation request is invalid. +4. The input parameters specified for registering a listener are incorrect. + +### Solution +1. Correct the invalid parameter values. + + +## 12100002 TokenId does not exist. + +### Error Message +TokenId does not exist. + +### Possible Causes +1. The specified **tokenId** does not exist. +2. The process corresponding to the specified **tokenId** is not an application process. + +### Solution +Set a correct **tokenId**, and make sure that the process corresponding to the specified **tokenId** is an application process. + + +## 12100003 Permission Not Exist + +### Error Message +Permission does not exist. + +### Possible Causes +1. The specified **permissionName** does not exist. +2. The specified **permissionName** does not match the specified **tokenId** in the permission authorization or revocation scenario. +3. The specified **permissionName** is not a sensitive permission that requires user authorization. + +### Solution +Set the **permissionName** parameter correctly. For details, see [permission-list](../../security/permission-list.md). + + +## 12100004 Listener APIs Not Used in Pairs + +### Error Message +The listener interface is not used together. + +### Possible Causes +This error code is reported if listener APIs are not used in pairs. The possible causes are as follows: +1. The listener APIs that need to be used in pairs are repeatedly called. +2. The listener APIs that need to be used in pairs are independently called. + +### Solution +1. Check whether the API needs to be used in pairs. That is, if an API is called to enable listening, an API with the same input parameters cannot be called unless an API is called to stop listening first. +2. Check whether the API needs to be used in pairs. That is, an API for disabling listening or unregistering a listener can only be called after the API for enabling listening or registering a listener is called. + + +## 12100005 Listener Overflow + +### Error Message +The number of listeners exceeds the limit. + +### Possible Causes +The number of listeners exceeds 200 (the upper limit). + +### Solution +Abandon unused listeners in a timely manner. + + +## 12100006 Permission Granting or Revocation Not Supported for the Specified Application + +### Error Message +The specified application does not support the permissions granted or ungranted as specified. + +### Possible Causes +1. The specified **tokenId** is the identity of the remote device. Distributed granting and revocation are not yet supported. +2. The specified **tokenId** belongs to a sandbox application, which is not allowed to apply for the specified permission. + +### Solution +1. Check whether the method of obtaining **tokenId** is correct. +2. Check whether the sandbox application works in restrictive mode. Most permissions cannot be granted to a sandbox application in restrictive mode. + + +## 12100007 System Services Not Working Properly + +### Error Message +Service is abnormal. + +### Possible Causes +This error code is reported if system services are not working properly. The possible causes are as follows: +1. The permission management service cannot be started properly. +2. An error occurs while reading or writing IPC data. + +### Solution +System services do not work properly. Try again later or restart the device. + + +## 12100008 Out of Memory + +### Error Message +Out of memory. + +### Possible Causes +The system memory is insufficient. + +### Solution +Try again later or restart the device. diff --git a/en/application-dev/reference/errorcodes/errorcode-sensors.md b/en/application-dev/reference/errorcodes/errorcode-sensors.md new file mode 100644 index 0000000000000000000000000000000000000000..155ff9263f550685e1b8dfc47016acc242ab5c9c --- /dev/null +++ b/en/application-dev/reference/errorcodes/errorcode-sensors.md @@ -0,0 +1,40 @@ +# Pan-Sensor Error Codes + +## 14500101 Service exception. + +### Error information + +Service exception. + +### Description + +This error code is reported if the HDI service is abnormal when the **on**, **once**, or **off** interface of the sensor module is called. + +### Possible Causes + +The HDI service is abnormal. + +### Procedure + +1. Retry the operation at a specified interval (for example, 1s) or at an exponential increase interval. +2. If the operation fails for three consecutive times, stop the attempt. You can also attempt to obtain the sensor list to check for device availability. + +## 14600101 Device operation failed. + +### Error Message + +Device operation failed. + +### Description + +This error code is reported if the HDI service is abnormal or the device is occupied when the **startVibration** interface of the vibrator module is called. + +### Possible Causes + +1. The HDI service is abnormal. +2. The device is occupied. + +### Procedure + +1. Retry the operation at a specified interval or at an exponential increase interval. If the operation fails for three consecutive times, stop the retry. You can also obtain the vibrator list to check for device availability. +2. Set a higher priority for the vibrator. diff --git a/en/device-dev/get-code/sourcecode-acquire.md b/en/device-dev/get-code/sourcecode-acquire.md index b244824c3be958bf35bbf78f6d2f689d2e931a6a..08809554460c986eae58f3d0a0ece2b6bb58904d 100644 --- a/en/device-dev/get-code/sourcecode-acquire.md +++ b/en/device-dev/get-code/sourcecode-acquire.md @@ -180,14 +180,14 @@ The table below provides only the sites for downloading the latest OpenHarmony L | Hi3518 solution (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_aries.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_aries.tar.gz.sha256)| | Hi3516 solution-LiteOS (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus.tar.gz)| | Hi3516 solution-Linux (binary)| 3.0 | [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.0/hispark_taurus_linux.tar.gz.sha256) | -| RELEASE-NOTES | 3.0 | [Download](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/en/release-notes/OpenHarmony-v3.0-LTS.md)| - | +| Release Notes | 3.0 | [Download](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/en/release-notes/OpenHarmony-v3.0-LTS.md)| - | | **Source code of the Latest Release**| **Version Information**| **Site**| **SHA-256 Verification Code**| -| Full code base (for mini, small, and standard systems)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/code-v3.2-Beta2.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/code-v3.2-Beta2.tar.gz.sha256)| -| RK3568 standard system solution (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/standard_rk3568.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.1.1/standard_rk3568.tar.gz.sha256)| -| Hi3861 solution (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_pegasus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_pegasus.tar.gz.sha256) | -| Hi3516 solution-LiteOS (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_taurus.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta2/hispark_taurus_LiteOS.tar.gz.sha256)| -| Hi3516 solution-Linux (binary)| 3.2 Beta2 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta2/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta2/hispark_taurus_Linux.tar.gz.sha256)| -| RELEASE-NOTES | 3.2 Beta2 | [Download](../../release-notes/OpenHarmony-v3.2-beta2.md)| - | +| Full code base (for mini, small, and standard systems)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/code-v3.2-Beta3.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/code-v3.2-Beta3.tar.gz.sha256)| +| RK3568 standard system solution (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/standard_rk3568.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.1.1/standard_rk3568.tar.gz.sha256)| +| Hi3861 solution (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_pegasus.tar.gz)| [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_pegasus.tar.gz.sha256) | +| Hi3516 solution-LiteOS (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_taurus.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/hispark_taurus_LiteOS.tar.gz.sha256)| +| Hi3516 solution-Linux (binary)| 3.2 Beta3 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta3/hispark_taurus_linux.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/hispark_taurus_Linux.tar.gz.sha256)| +| Release Notes | 3.2 Beta3 | [Download](../../release-notes/OpenHarmony-v3.2-beta3.md)| - | | **Compiler Toolchain**| **Version Information**| **Site**| **SHA-256 Verification Code**| | Compiler toolchain| - | [Download](https://repo.huaweicloud.com/openharmony/os/2.0/tool_chain/)| - | diff --git a/en/readme/location.md b/en/readme/location.md index 369f272c6ec8d1af651f9b69ae4db2d893df464e..035cec4b31d6ddb0b432b7de28bd5a8367c0c002 100644 --- a/en/readme/location.md +++ b/en/readme/location.md @@ -28,9 +28,8 @@ Location awareness helps determine where a mobile device locates. The system ide WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points (APs) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network. -**Figure 1** ** Location subsystem architecture** +**Figure 1** Location subsystem architecture** -![](figures/location_En-1.png) ![](figures/location_En-1.png) ## Directory Structure @@ -116,7 +115,7 @@ The following table describes APIs available for obtaining device location infor If your application needs to access the device location information when running on the background, it must be allowed to run on the background in the configuration file and also granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information even when your application moves to the background. - You can declare the required permission in your application's configuration file. For details, see [Application Package Structure Configuration File](../application-dev/quick-start/stage-structure.md). + You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../application-dev/security/accesstoken-guidelines.md). 2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities.