diff --git a/en/application-dev/application-models/inputmethodextentionability.md b/en/application-dev/application-models/inputmethodextentionability.md
index b36cf2a050cd15c1d4047410406ed46343f604e5..49686c5d5c087d8a484123f0f6d58a12f6283976 100644
--- a/en/application-dev/application-models/inputmethodextentionability.md
+++ b/en/application-dev/application-models/inputmethodextentionability.md
@@ -1,4 +1,4 @@
-# InputMethodExtensionAbility Development
+# InputMethodExtensionAbility
## When to Use
[InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md), inherited from [ExtensionAbility](extensionability-overview.md), is used for developing input method applications.
diff --git a/en/application-dev/dfx/hitracemeter-guidelines.md b/en/application-dev/dfx/hitracemeter-guidelines.md
index 3adf91286aaf410d7862c60320878e57acb359e8..3244aa9356bbcd3748594061a3752fad8aa3d3f3 100644
--- a/en/application-dev/dfx/hitracemeter-guidelines.md
+++ b/en/application-dev/dfx/hitracemeter-guidelines.md
@@ -21,7 +21,7 @@ Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only
## Available APIs
-The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference]( ../reference/apis/js-apis-hitracemeter.md).
+The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference](../reference/apis/js-apis-hitracemeter.md).
**APIs for performance tracing**
diff --git a/en/application-dev/notification/Readme-EN.md b/en/application-dev/notification/Readme-EN.md
index f7b76df0e99484508bcb073462fd65f0ab3d03cb..47c6303ebec771590779b7cb9e5c3acaf6eaf31c 100644
--- a/en/application-dev/notification/Readme-EN.md
+++ b/en/application-dev/notification/Readme-EN.md
@@ -1,9 +1,9 @@
# Notification
- [Notification Overview](notification-overview.md)
-- [Notification Subscription (for System Applications Only)](notification-subscription.md)
+- [Subscribing to Notifications (for System Applications Only)](notification-subscription.md)
- [Enabling Notification](notification-enable.md)
-- [Notification Badge](notification-badge.md)
+- [Managing the Notification Badge](notification-badge.md)
- Publishing a Notification
- [Publishing a Basic Notification](text-notification.md)
- [Publishing a Progress Notification](progress-bar-notification.md)
diff --git a/en/application-dev/notification/notification-badge.md b/en/application-dev/notification/notification-badge.md
index 66d29e659d03ac147a9aa7acc0e1af24b60980c3..5cf38e460c8db944f8608869760e3dfc63c648a7 100644
--- a/en/application-dev/notification/notification-badge.md
+++ b/en/application-dev/notification/notification-badge.md
@@ -1,4 +1,4 @@
-# Notification Badge
+# Managing the Notification Badge
OpenHarmony provides APIs for setting the notification badge, which is displayed in the upper right corner of the application icon on the home screen to notify the user of the count of unread notifications.
@@ -11,11 +11,11 @@ After a notification is read, the count on the badge is decremented by 1. If the
1. The notification service provides two methods to increase the count on the notification badge:
- - When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest). After the notification is received, the count on the badge is incremented.
+ - When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest). After the notification is received, the count on the badge is incremented.
- - Call the [setBadgeNumber](../reference/apis/js-apis-notificationManager.md#setbadgenumber) API to set the count on the badge.
+ - Call the [setBadgeNumber()](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10) API to set the count on the badge.
-2. To decrease the count on the badge, call the **setBadgeNumber** API.
+2. To decrease the count on the badge, call the [setBadgeNumber()](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10) API.
| API| Description|
| -------- | -------- |
@@ -32,37 +32,37 @@ After a notification is read, the count on the badge is decremented by 1. If the
2. Increase the count on the badge.
- When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest). For details, see [Publishing a Basic Notification](text-notification.md).
+ When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest). For details, see [Publishing a Basic Notification](text-notification.md).
In this example, the **setBadgeNumber** API is called to add a badge. This API is called after a new notification is published.
```ts
function setBadgeNumberCallback(err) {
- if (err) {
- console.info(`Set badge failed code is ${err.code}, message is ${err.message}`);
- } else {
- console.info(`Set badge success`);
- }
+ if (err) {
+ console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info(`Succeeded in seting badge number.`);
}
- let badgeNumber = 10
+ let badgeNumber = 10;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
```
-3. Reduce the count on the badge.
+3. Decrease the count on the badge.
After a notification is read, the application needs to call the API to set the number of remaining unread notifications. The badge is then updated.
```ts
function setBadgeNumberCallback(err) {
- if (err) {
- console.info(`Set badge failed code is ${err.code}, message is ${err.message}`);
- } else {
- console.info(`Set badge success`);
- }
+ if (err) {
+ console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info(`Succeeded in seting badge number.`);
}
- let badgeNumber = 9
+ let badgeNumber = 9;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
```
diff --git a/en/application-dev/notification/notification-subscription.md b/en/application-dev/notification/notification-subscription.md
index 45e75f1f64606cfa89cae2cfae91b89a13faaa5c..68bc11450b9302d66c05b3388ca8096e5c33088f 100644
--- a/en/application-dev/notification/notification-subscription.md
+++ b/en/application-dev/notification/notification-subscription.md
@@ -1,4 +1,4 @@
-# Notification Subscription (for System Applications Only)
+# Subscribing to Notifications (for System Applications Only)
To receive notifications, an application must subscribe to notifications first. The notification subsystem provides two types of subscription APIs, allowing applications to subscribe to notifications from all applications or notifications from a specific application.
@@ -13,14 +13,14 @@ The major APIs for notification subscription are described as follows. For detai
**Table 1** Major APIs for notification subscription
-| Name | Description|
+| API| Description|
| -------- | -------- |
| subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback<void>): void | Subscribes to notifications from a specific application.|
| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void | Subscribes to notifications from all applications. |
**Table 2** Callbacks for notification subscription
-| Name | Description|
+| API| Description|
| -------- | -------- |
| onConsume?:(data: SubscribeCallbackData) => void | Callback for receiving notifications. |
| onCancel?:(data: SubscribeCallbackData) => void | Callback for canceling notifications. |
diff --git a/en/application-dev/notification/notification-with-wantagent.md b/en/application-dev/notification/notification-with-wantagent.md
index 638f53ef2f6f6fce1637468ba4c900496727f23d..3864db71c96b59827bdf4603f48199f27345a2a3 100644
--- a/en/application-dev/notification/notification-with-wantagent.md
+++ b/en/application-dev/notification/notification-with-wantagent.md
@@ -13,7 +13,7 @@ Below you can see the process of adding a **WantAgent** object to a notification
For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/js-apis-app-ability-wantAgent.md).
-| Name| Description|
+| API | Description|
| -------- | -------- |
| getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void | Creates a **WantAgent** object.|
| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void | Triggers a **WantAgent** object.|
diff --git a/en/application-dev/quick-start/figures/application_details.jpg b/en/application-dev/quick-start/figures/application_details.jpg
index 02524b549eaf636e2a8a0f2ec869513d99f1a161..311f1f6b17263622d514caa6deac9905df8aa6c3 100644
Binary files a/en/application-dev/quick-start/figures/application_details.jpg and b/en/application-dev/quick-start/figures/application_details.jpg differ
diff --git a/en/application-dev/quick-start/module-configuration-file.md b/en/application-dev/quick-start/module-configuration-file.md
index ac141ad75d108f68d25007491a15062ae958563e..a5ee99313ae9799b6355162f2804d8ef34caf619 100644
--- a/en/application-dev/quick-start/module-configuration-file.md
+++ b/en/application-dev/quick-start/module-configuration-file.md
@@ -74,7 +74,7 @@ As shown above, the **module.json5** file contains several tags.
| Name| Description| Data Type| Initial Value Allowed|
| -------- | -------- | -------- | -------- |
-| name | Name of the module. The value is a string with a maximum of 31 bytes and must be unique in the entire application. Chinese characters are not allowed.| String| No|
+| name | Name of the module. The value is a string with a maximum of 31 bytes and must be unique in the entire application. | String| No|
| type | Type of the module. The options are as follows:
- **entry**: main module of the application.
- **feature**: dynamic feature module of the application.
- **har**: static shared module.
- **shared**: dynamic shared module.| String| No|
| srcEntry | Code path corresponding to the module. The value is a string with a maximum of 127 bytes.| String| Yes (initial value: left empty)|
| description | Description of the module. The value is a string with a maximum of 255 bytes or a string resource index.| String| Yes (initial value: left empty)|
@@ -228,73 +228,6 @@ The **metadata** tag represents the custom metadata of the HAP file. The tag val
UIAbility configuration of the module, which is valid only for the current UIAbility component.
-**By default, application icons cannot be hidden from the home screen in OpenHarmony.**
-
-The OpenHarmony system imposes a strict rule on the presence of application icons. If no icon is configured in the HAP file of an application, the system uses the icon specified in the **app.json** file as the application icon and displays it on the home screen.
-
-Touching this icon will direct the user to the application details screen in **Settings**, as shown in Figure 1.
-
-To hide an application icon from the home screen, you must configure the **AllowAppDesktopIconHide** privilege. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
-
-**Objectives**:
-
-This requirement on application icons is intended to prevent malicious applications from deliberately configuring no icon to block uninstallation attempts.
-
-**Setting the application icon to be displayed on the home screen**:
-
-Set **icon**, **label**, and **skills** under **abilities** in the **module.json5** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
-
-```
-{
- "module":{
-
- ...
-
- "abilities": [{
- "icon": "$media:icon",
- "label": "Login",
- "skills": [{
- "actions": ["ohos.want.action.home"],
- "entities": ["entity.system.home"],
- "uris": []
- }]
- }],
- ...
-
- }
-}
-```
-
-**Display rules of application icons and labels on the home screen:**
-* The HAP file contains UIAbility configuration.
- * The application icon on the home screen is set under **abilities** in the **module.json5** file.
- * The application does not have the privilege to hide its icon from the home screen.
- * The application icon displayed on the home screen is the icon configured for the UIAbility.
- * The application label displayed on the home screen is the label configured for the UIAbility. If no label is configured, the bundle name is returned.
- * The name of the UIAbility is displayed.
- * When the user touches the home screen icon, the home screen of the UIAbility is displayed.
- * The application has the privilege to hide its icon from the home screen.
- * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen.
- * The application icon on the home screen is not set under **abilities** in the **module.json5** file.
- * The application does not have the privilege to hide its icon from the home screen.
- * The application icon displayed on the home screen is the icon specified under **app**. (The **icon** field in the **app.json** file is mandatory.)
- * The application label displayed on the home screen is the label specified under **app**. (The **label** field in the **app.json** file is mandatory.)
- * Touching the application icon on the home screen will direct the user to the application details screen shown in Figure 1.
- * The application has the privilege to hide its icon from the home screen.
- * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen.
-* The HAP file does not contain UIAbility configuration.
- * The application does not have the privilege to hide its icon from the home screen.
- * The application icon displayed on the home screen is the icon specified under **app**. (The **icon** field in the **app.json** file is mandatory.)
- * The application label displayed on the home screen is the label specified under **app**. (The **label** field in the **app.json** file is mandatory.)
- * Touching the application icon on the home screen will direct the user to the application details screen shown in Figure 1.
- * The application has the privilege to hide its icon from the home screen.
- * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen.
-
-**Figure 1** Application details screen
-
-
-
-
**Table 6** abilities
| Name| Description| Data Type| Initial Value Allowed|
@@ -325,6 +258,7 @@ Set **icon**, **label**, and **skills** under **abilities** in the **module.json
| minWindowHeight | Minimum window height supported by the UIAbility component, in vp. The minimum value is 0, and the value cannot be less than the minimum window height allowed by the platform or greater than the value of **maxWindowHeight**. For details about the window size, see [Constraints](../windowmanager/window-overview.md#constraints).| Number| Yes (initial value: minimum window height supported by the platform)|
| excludeFromMissions | Whether the UIAbility component is displayed in the recent task list.
- **true**: displayed in the recent task list.
- **false**: not displayed in the recent task list.
**NOTE**
This attribute applies only to system applications and does not take effect for third-party applications.| Boolean| Yes (initial value: **false**)|
| recoverable | Whether the application can be recovered to its previous state in case of a detected fault.
- **true**: The application can be recovered to its previous state in case of a detected fault.
- **false**: The application cannot be recovered to its previous state in case of a detected fault.| Boolean| Yes (initial value: **false**)|
+| unclearableMission | Whether the UIAbility component is unclearable in the recent tasks list.
- **true**: The UIAbility component is unclearable in the recent tasks list.
- **false**: The UIAbility component is clearable in the recent tasks list.
**NOTE**
This attribute works only after the [AllowMissionNotCleared](../../device-dev/subsystems/subsys-app-privilege-config-guide.md) privilege is obtained.| Boolean| Yes (initial value: **false**)|
Example of the **abilities** structure:
@@ -369,7 +303,8 @@ Example of the **abilities** structure:
"minWindowWidth": 1400,
"maxWindowHeight": 300,
"minWindowHeight": 200,
- "excludeFromMissions": false
+ "excludeFromMissions": false,
+ "unclearableMission": false
}]
}
```
@@ -441,12 +376,12 @@ The **extensionAbilities** tag represents the configuration of extensionAbilitie
| description | Description of the ExtensionAbility component. The value is a string with a maximum of 255 bytes or a resource index to the description.| String| Yes (initial value: left empty)|
| icon | Icon of the ExtensionAbility component. The value is an icon resource index. If **ExtensionAbility** is set to **MainElement** of the current module, this attribute is mandatory and its value must be unique in the application.| String| Yes (initial value: left empty)|
| label | Name of the ExtensionAbility component displayed to users. The value is a string resource index.
**NOTE**
If **ExtensionAbility** is set to **MainElement** of the current module, this attribute is mandatory and its value must be unique in the application.| String| No|
-| type | Type of the ExtensionAbility component. The options are as follows:
- **form**: ExtensionAbility of a widget.
- **workScheduler**: ExtensionAbility of a Work Scheduler task.
- **inputMethod**: ExtensionAbility of an input method.
- **service**: service component running in the background.
- **accessibility**: ExtensionAbility of an accessibility feature.
- **dataShare**: ExtensionAbility for data sharing.
- **fileShare**: ExtensionAbility for file sharing.
- **staticSubscriber**: ExtensionAbility for static broadcast.
- **wallpaper**: ExtensionAbility of the wallpaper.
- **backup**: ExtensionAbility for data backup.
- **window**: ExtensionAbility of a window. This type of ExtensionAbility creates a window during startup for which you can develop the GUI. The window is then combined with other application windows through **abilityComponent**.
- **thumbnail**: ExtensionAbility for obtaining file thumbnails. You can provide thumbnails for files of customized file types.
- **preview**: ExtensionAbility for preview. This type of ExtensionAbility can parse the file and display it in a window. You can combine the window with other application windows.
- **print**: ExtensionAbility for the print framework.
- **driver**: ExtensionAbility for the driver framework.
**NOTE**
The **service** and **dataShare** types apply only to system applications and do not take effect for third-party applications.| String| No|
+| type | Type of the ExtensionAbility component. The options are as follows:
- **form**: ExtensionAbility of a widget.
- **workScheduler**: ExtensionAbility of a Work Scheduler task.
- **inputMethod**: ExtensionAbility of an input method.
- **service**: service component running in the background.
- **accessibility**: ExtensionAbility of an accessibility feature.
- **dataShare**: ExtensionAbility for data sharing.
- **fileShare**: ExtensionAbility for file sharing.
- **staticSubscriber**: ExtensionAbility for static broadcast.
- **wallpaper**: ExtensionAbility of the wallpaper.
- **backup**: ExtensionAbility for data backup.
- **window**: ExtensionAbility of a window. This type of ExtensionAbility creates a window during startup for which you can develop the GUI. The window is then combined with other application windows through **abilityComponent**.
- **thumbnail**: ExtensionAbility for obtaining file thumbnails. You can provide thumbnails for files of customized file types.
- **preview**: ExtensionAbility for preview. This type of ExtensionAbility can parse the file and display it in a window. You can combine the window with other application windows.
- **print**: ExtensionAbility for the print framework.
- **push**: ExtensionAbility to be pushed.
- **driver**: ExtensionAbility for the driver framework.
**NOTE**
The **service** and **dataShare** types apply only to system applications and do not take effect for third-party applications.| String| No|
| permissions | Permissions required for another application to access the ExtensionAbility component.
The value is generally in the reverse domain name notation and contains a maximum of 255 bytes. It is an array of permission names predefined by the system or customized. The name of a customized permission must be the same as the **name** value of a permission defined in the **defPermissions** attribute.| String array| Yes (initial value: left empty)|
| uri | Data URI provided by the ExtensionAbility component. The value is a string with a maximum of 255 bytes, in the reverse domain name notation.
**NOTE**
This attribute is mandatory when the type of the ExtensionAbility component is set to **dataShare**.| String| Yes (initial value: left empty)|
|skills | Feature set of [wants](../application-models/want-overview.md) that can be received by the ExtensionAbility component.
Configuration rule: In an entry package, you can configure multiple **skills** attributes with the entry capability. (A **skills** attribute with the entry capability is the one that has **ohos.want.action.home** and **entity.system.home** configured.) The **label** and **icon** in the first ExtensionAbility that has **skills** configured are used as the **label** and **icon** of the entire OpenHarmony service/application.
**NOTE**
The **skills** attribute with the entry capability can be configured for the feature package of an OpenHarmony application, but not for an OpenHarmony service.| Array| Yes (initial value: left empty)|
| [metadata](#metadata)| Metadata of the ExtensionAbility component.| Object| Yes (initial value: left empty)|
-| exported | Whether the ExtensionAbility component can be called by other applications.
- **true**: The ExtensionAbility component can be called by other applications.
- **false**: The UIAbility component cannot be called by other applications.| Boolean| Yes (initial value: **false**)|
+| exported | Whether the ExtensionAbility component can be called by other applications.
- **true**: The ExtensionAbility component can be called by other applications.
- **false**: The ExtensionAbility component cannot be called by other applications.| Boolean| Yes (initial value: **false**)|
Example of the **extensionAbilities** structure:
diff --git a/en/application-dev/quick-start/module-structure.md b/en/application-dev/quick-start/module-structure.md
index 2959e6a942a6236a1717d9f2ead60dc7f814e479..830848bba13635f6e2b2a24aab3b8d634db6aebf 100644
--- a/en/application-dev/quick-start/module-structure.md
+++ b/en/application-dev/quick-start/module-structure.md
@@ -7,24 +7,24 @@ The **module** tag contains the HAP configuration.
| Name| Description| Data Type| Initial Value Allowed|
| -------- | -------- | -------- | -------- |
-| mainAbility | Ability whose icon is displayed in the Service Center. When the resident process is started, the **mainAbility** is started.| String| Yes (initial value: left empty)|
-| package | Package name of the HAP file, which must be unique in the application. The value is a string with a maximum of 127 bytes, in the reverse domain name notation. It is recommended that the value be the same as the project directory of the HAP file. | String| No|
-| name | Class name of the HAP file. The value is a string with a maximum of 255 bytes, in the reverse domain name notation. The prefix must be the same as the **package** value specified for this module. Alternatively, the value can start with a period (.) followed by the class name.| String| Yes (initial value: left empty)|
-| description | Description of the HAP file. The value is a string with a maximum of 255 bytes. If the value exceeds the limit or needs to support multiple languages, you can use a resource index to the description.| String| Yes (initial value: left empty)|
-| supportedModes | Modes supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to head units.| String array| Yes (initial value: left empty)|
-|deviceType | Type of device on which the ability can run. The device types predefined in the system include **tablet**, **tv**, **car**, and **wearable**.| String array| No|
-|distro | Distribution description of the HAP file.| Object| No|
-|metaData | Metadata of the HAP file.| Object| Yes (initial value: left empty)|
-| abilities | All abilities in the current module. The value is an array of objects, each of which represents an ability.| Object array| Yes (initial value: left empty)|
-| js | A set of JS modules developed using ArkUI. The value is an array of objects, each of which represents a JS module.| Object array| Yes (initial value: left empty)|
-| shortcuts | Shortcuts of the application. The value is an array of objects, each of which represents a shortcut object.| Object array| Yes (initial value: left empty)|
-| reqPermissions | Permissions that the application requests from the system when it is running.| Object array| Yes (initial value: left empty)|
-| colorMode | Color mode of the application. The options are as follows:
- **dark**: Resources applicable for the dark mode are used.
- **light**: Resources applicable for the light mode are used.
- **auto**: Resources are used based on the color mode of the system.| String| Yes (initial value: **auto**)|
+| mainAbility | Ability whose icon is displayed in the Service Center. When the resident process is started, the **mainAbility** is started.| String| Yes (initial value: left empty)|
+| package | Package name of the HAP file, which must be unique in the application. The value is a string with a maximum of 127 bytes, in the reverse domain name notation. It is recommended that the value be the same as the project directory of the HAP file. | String| No|
+| name | Class name of the HAP file. The value is a string with a maximum of 255 bytes, in the reverse domain name notation. The prefix must be the same as the **package** value specified for this module. Alternatively, the value can start with a period (.) followed by the class name.| String| Yes (initial value: left empty)|
+| description | Description of the HAP file. The value is a string with a maximum of 255 bytes. If the value exceeds the limit or needs to support multiple languages, you can use a resource index to the description.| String| Yes (initial value: left empty)|
+| supportedModes | Modes supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to head units.| String array| Yes (initial value: left empty)|
+|deviceType | Type of device on which the ability can run. The device types predefined in the system include **tablet**, **tv**, **car**, and **wearable**.| String array| No|
+|distro | Distribution description of the HAP file.| Object| No|
+|metaData | Metadata of the HAP file.| Object| Yes (initial value: left empty)|
+| abilities | All abilities in the current module. The value is an array of objects, each of which represents an ability.| Object array| Yes (initial value: left empty)|
+| js | A set of JS modules developed using ArkUI. The value is an array of objects, each of which represents a JS module.| Object array| Yes (initial value: left empty)|
+| shortcuts | Shortcuts of the application. The value is an array of objects, each of which represents a shortcut object.| Object array| Yes (initial value: left empty)|
+| reqPermissions | Permissions that the application requests from the system when it is running.| Object array| Yes (initial value: left empty)|
+| colorMode | Color mode of the application. The options are as follows:
- **dark**: Resources applicable for the dark mode are used.
- **light**: Resources applicable for the light mode are used.
- **auto**: Resources are used based on the color mode of the system.| String| Yes (initial value: **auto**)|
| distributionFilter | Distribution rules of the application. This attribute defines the rules for distributing HAP files based on different device specifications, so that precise matching can be performed when the application market distributes applications. Distribution rules cover three factors: API version, screen shape, and screen resolution. During distribution, a unique HAP is determined based on the mapping between **deviceType** and these three factors.| Object| Yes (initial value: left empty) Set this attribute when an application has multiple entry modules.|
-|commonEvents | Information about the common event static subscriber, which must contain the subscriber name, required permissions, and list of the common events subscribed to. When a subscribed event is sent, the static subscriber is started. Unlike the dynamic subscriber, the static subscriber does not need to proactively call the common event subscription API in the service code, and may not be running when the common event is published.| Object array| Yes (initial value: left empty)|
-| entryTheme | Keyword of an OpenHarmony internal theme. Set it to the resource index of the name.| String| Yes (initial value: left empty)|
-|testRunner | Test runner configuration.| Object| Yes (initial value: left empty)|
-|generateBuildHash |Whether the hash value of the HAP or HSP file is generated by the packaging tool. The hash value (if any) is used to determine whether the application needs to be updated when the system is updated in OTA mode but the value of [code](#internal-structure-of-the-apiversion-attribute) in **version** of the application remains unchanged.
**NOTE**
This tag applies only to system applications.|Boolean|Yes (initial value: **false**)|
+|commonEvents | Information about the common event static subscriber, which must contain the subscriber name, required permissions, and list of the common events subscribed to. When a subscribed event is sent, the static subscriber is started. Unlike the dynamic subscriber, the static subscriber does not need to proactively call the common event subscription API in the service code, and may not be running when the common event is published.| Object array| Yes (initial value: left empty)|
+| entryTheme | Keyword of an OpenHarmony internal theme. Set it to the resource index of the name.| String| Yes (initial value: left empty)|
+|testRunner | Test runner configuration.| Object| Yes (initial value: left empty)|
+|generateBuildHash | Whether the hash value of the HAP or HSP file is generated by the packaging tool. The hash value (if any) is used to determine whether the application needs to be updated when the system is updated in OTA mode but the value of [code](#internal-structure-of-the-apiversion-attribute) in **version** of the application remains unchanged.
**NOTE**
This tag applies only to system applications.|Boolean|Yes (initial value: **false**)|
Example of the **module** tag structure:
@@ -129,7 +129,7 @@ Example of the **distro** attribute structure:
| Name| Description| Data Type| Initial Value Allowed|
| -------- | -------- | -------- | -------- |
-| description | Description of the parameter. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)|
+| description | Description of the parameter. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
| name | Name of the parameter passed for calling the ability. The value can contain a maximum of 255 bytes.| String| No|
| type | Type of the parameter passed for calling the ability, for example, **Integer**.| String| No|
@@ -139,8 +139,8 @@ Example of the **distro** attribute structure:
| Name| Description| Data Type| Initial Value Allowed|
| -------- | -------- | -------- | -------- |
-| description | Description of the return value. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)|
-| name | Name of the return value. The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)|
+| description | Description of the return value. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
+| name | Name of the return value. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
| type | Type of the return value, for example, **Integer**.| String| No|
## Internal Structure of the customizeData Attribute
@@ -191,21 +191,48 @@ Example of the metadata attribute:
## Internal Structure of the abilities Attribute
-**By default, application icons cannot be hidden from the home screen in OpenHarmony.**
-
-The OpenHarmony system imposes a strict rule on the presence of application icons. If no icon is configured in the HAP file of an application, the system creates a default icon for the application and displays it on the home screen.
+**Table 8** Internal structure of the abilities attribute
-Touching this icon will direct the user to the application details screen in **Settings**, as shown in Figure 1.
+| Name| Description| Data Type| Initial Value Allowed|
+| -------- | -------- | -------- | -------- |
+| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. If this attribute is set to the name of the process running other applications, all these applications can run in the same process, provided they have the same unified user ID and the same signature. The value can contain a maximum of 31 bytes.| String| Yes (initial value: left empty)|
+| name | Ability name. The value can be a reverse domain name, in the format of "*bundleName*.*className*", for example, **"com.example.myapplication.EntryAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".EntryAbility"**.
The ability name must be unique in an application.
**NOTE**
If you use DevEco Studio to create the project, an ability named **EntryAbility** will be created by default, and its configuration will be saved to the **config.json** file. If you use other IDEs, the value of this attribute can be customized. The value can contain a maximum of 127 bytes. | String| No|
+| description | Description of the ability. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
+| icon | Index to the ability icon file. Example value: **$media:ability_icon**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the icon of the ability is also used as the icon of the application. If multiple abilities address this condition, the icon of the first candidate ability is used as the application icon.
**NOTE**
The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels. | String| Yes (initial value: left empty)|
+| label | Ability name displayed to users. The value can be a name string or a resource index to names in multiple languages, for example, **$string:ability_label**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the label of the ability is also used as the label of the application. If multiple abilities address this condition, the label of the first candidate ability is used as the application label.
**NOTE**
The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels. The value can be a reference to a string defined in a resource file or a string enclosed in brackets ({}). The value can contain a maximum of 255 bytes. | String| Yes (initial value: left empty)|
+| uri | Uniform Resource Identifier (URI) of the ability. The value can contain a maximum of 255 bytes.| String| Yes (No for abilities using the Data template)|
+| launchType | Launch type of the ability. The value can be **standard** or **singleton**.
**standard**: Multiple **Ability** instances can be created during startup. Most abilities can use this type.
**singleton**: Only a single **Ability** instance can be created across all task stacks during startup. For example, a globally unique incoming call screen uses the singleton launch type. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String| Yes (initial value: **"singleton"**)|
+| visible | Whether the ability can be called by other applications.
**true**: The ability can be called by other applications.
**false**: The ability cannot be called by other applications.| Boolean| Yes (initial value: **false**)|
+| permissions | Permissions required for abilities of another application to call the current ability. The value is an array of permission names predefined by the system, generally in the reverse domain name notation. It contains a maximum of 255 bytes.| String array| Yes (initial value: left empty)|
+|skills | Types of the **want** that can be accepted by the ability.| Object array| Yes (initial value: left empty)|
+| deviceCapability | Device capabilities required to run the ability. The value is an array of up to 512 elements, each of which contains a maximum of 64 bytes.| String array| Yes (initial value: left empty)|
+| metaData | Metadata.| Object| Yes (initial value: left empty)|
+| type | Ability type. The options are as follows:
**page**: FA developed using the Page template to provide the capability of interacting with users.
**service**: PA developed using the Service template to provide the capability of running tasks in the background.
**data**: PA developed using the Data template to provide unified data access for external systems.
**CA**: ability that can be started by other applications as a window.| String| No|
+| orientation | Display orientations of the ability. This attribute applies only to the ability using the Page template. The options are as follows:
**unspecified**: indicates that the system automatically determines the display orientation of the ability.
**landscape**: indicates the landscape orientation.
**portrait**: indicates the portrait orientation.
**followRecent**: indicates that the orientation follows the most recent application in the stack.| String| Yes (initial value: **"unspecified"**)|
+| backgroundModes | Background service type of the ability. You can assign multiple background service types to a specific ability. This field applies only to the ability using the Service template. The options are as follows:
**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices.
**audioPlayback**: audio playback service.
**audioRecording**: audio recording service.
**pictureInPicture**: picture in picture (PiP) and small-window video playback services.
**voip**: voice/video call and VoIP services.
**location**: location and navigation services.
**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services.
**wifiInteraction**: WLAN scanning, connection, and transmission services.
**screenFetch**: screen recording and screenshot services.
**multiDeviceConnection**: multi-device interconnection service.| String array| Yes (initial value: left empty)|
+| grantPermission | Whether permissions can be granted for any data in the ability.| Boolean| Yes (initial value: left empty)|
+| readPermission | Permission required for reading data in the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String| Yes (initial value: left empty)|
+| writePermission | Permission required for writing data to the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
+| configChanges | System configurations that the ability concerns. Upon any changes on the concerned configurations, the **onConfigurationUpdated** callback will be invoked to notify the ability. The options are as follows:
**mcc**: indicates that the mobile country code (MCC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MCC is updated.
**mnc**: indicates that the mobile network code (MNC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MNC is updated.
**locale**: indicates that the locale is changed. Typical scenario: The user selects a new language for the text display of the device.
**layout**: indicates that the screen layout is changed. Typical scenario: Currently, different display forms are all in the active state.
**fontSize**: indicates that font size is changed. Typical scenario: A new global font size is set.
**orientation**: indicates that the screen orientation is changed. Typical scenario: The user rotates the device.
**density**: indicates that the display density is changed. Typical scenario: The user may specify different display ratios, or different display forms are active at the same time.
**size**: indicates that the size of the display window is changed.
**smallestSize**: indicates that the length of the shorter side of the display window is changed.
**colorMode**: indicates that the color mode is changed.| String array| Yes (initial value: left empty)|
+| mission | Task stack of the ability. This attribute applies only to the ability using the Page template. By default, all abilities in an application belong to the same task stack.| String| Yes (initial value: bundle name of the application)|
+| targetAbility | Target ability that this ability alias points to. This attribute applies only to the ability using the Page template. If the **targetAbility** attribute is set, only **name**, **icon**, **label**, **visible**, **permissions**, and **skills** take effect in the current ability (ability alias). Other attributes use the values of the **targetAbility** attribute. The target ability must belong to the same application as the alias and must be declared in **config.json** ahead of the alias.| String| Yes (initial value: left empty, indicating that the current ability is not an alias)|
+| formsEnabled | Whether the ability can provide widgets. This attribute applies only to the ability using the Page template.
**true**: This ability can provide widgets.
**false**: This ability cannot provide widgets.| Boolean| Yes (initial value: **false**)|
+| forms | Information about the widgets used by the ability. This attribute is valid only when **formsEnabled** is set to **true**.| Object array| Yes (initial value: left empty)|
+| srcLanguage | Programming language of the ability, which you can specify when creating the project.| String| Yes (initial value: **"js"**)|
+| srcPath | JS code path corresponding to the ability. The value can contain a maximum of 127 bytes.| String| No|
+| uriPermission | Application data that the ability can access. This attribute consists of the **mode** and **path** sub-attributes. This attribute is valid only for the capability of the type provider.| Object| Yes (initial value: left empty)|
+| startWindowIcon | Index to the icon file of the ability startup page. This attribute applies only to the ability using the Page template. Example: **$media:icon**.| String| Yes (initial value: left empty)|
+| startWindowBackground | Index to the background color resource file of the ability startup page. This attribute applies only to the ability using the Page template. Example: **$color:red**.| String| Yes (initial value: left empty)|
+| removeMissionAfterTerminate | Whether to remove the relevant task from the task list after the ability is destroyed. This attribute applies only to the ability using the Page template. The value **true** means to remove the relevant task from the task list after the ability is destroyed, and **false** means the opposite.| Boolean| Yes (initial value: **false**)|
-To hide an application icon from the home screen, you must configure the **AllowAppDesktopIconHide** privilege. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
-**Objectives**:
+**By default, application icons cannot be hidden from the home screen in OpenHarmony.**
-This requirement on application icons is intended to prevent malicious applications from deliberately configuring no icon to block uninstallation attempts.
+OpenHarmony strictly controls applications without icons to prevent malicious applications from deliberately configuring no icon to block uninstall attempts.
**Setting the application icon to be displayed on the home screen**:
-Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
+Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. Make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
```
{
@@ -229,71 +256,34 @@ Set **icon**, **label**, and **skills** under **abilities** in the **config.json
}
```
-**Display rules of application icons and labels on the home screen:**
+To hide an application icon from the home screen, you must configure the **AllowAppDesktopIconHide** privilege. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md). The rules for displaying the entry icon and entry label are as follows:
* The HAP file contains Page ability configuration.
* The application icon on the home screen is set under **abilities** in the **config.json** file.
* The application does not have the privilege to hide its icon from the home screen.
- * The application icon displayed on the home screen is the icon configured for the Page ability.
- * The application label displayed on the home screen is the label configured for the Page ability. If no label is configured, the bundle name is returned.
- * The name of the Page ability is displayed.
- * When the user touches the home screen icon, the home screen of the Page ability is displayed.
+ * The system uses the icon configured for the Page ability as the entry icon and displays it on the home screen. Touching this icon will direct the user to the home page of the Page ability.
+ * The system uses the label configured for the PageAbility as the entry label and displays it on the home screen. If no label is configured, the bundle name is returned.
* The application has the privilege to hide its icon from the home screen.
- * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen.
+ * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen.
* The application icon on the home screen is not set under **abilities** in the **config.json** file.
* The application does not have the privilege to hide its icon from the home screen.
- * The application icon displayed on the home screen is the default icon.
- * The application label displayed on the home screen is the bundle name of the application.
- * Touching the application icon on the home screen will direct the user to the application details screen shown in Figure 1.
+ * The system uses the default icon as the entry icon and displays it on the home screen. Touching this icon will direct the user to the application details screen under application management, as shown in Figure 1.
+ * The system uses the bundle name of the application as the entry label and displays it on the home screen.
* The application has the privilege to hide its icon from the home screen.
- * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen.
+ * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen.
* The HAP file does not contain Page ability configuration.
* The application does not have the privilege to hide its icon from the home screen.
- * The application icon displayed on the home screen is the default icon.
- * The application label displayed on the home screen is the bundle name of the application.
- * Touching the application icon on the home screen will direct the user to the application details screen shown in Figure 1.
+ * The system uses the default icon as the entry icon and displays it on the home screen. Touching this icon will direct the user to the application details screen under application management, as shown in Figure 1.
+ * The system uses the bundle name of the application as the entry label and displays it on the home screen.
* The application has the privilege to hide its icon from the home screen.
- * The information about the application is not returned during home screen information query, and the icon of the application is not displayed on the home screen.
-
-Note: The label displayed on the application details screen may be different from that displayed on the home screen. For non-Page abilities, it is the entry label set (if any).
+ * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen.
**Figure 1** Application details screen

-
-**Table 8** Internal structure of the abilities attribute
-
-| Name| Description| Data Type| Initial Value Allowed|
-| -------- | -------- | -------- | -------- |
-| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. If this attribute is set to the name of the process running other applications, all these applications can run in the same process, provided they have the same unified user ID and the same signature. The value can contain a maximum of 31 bytes.| String| Yes (initial value: left empty)|
-| name | Ability name. The value can be a reverse domain name, in the format of "*bundleName*.*className*", for example, **"com.example.myapplication.EntryAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".EntryAbility"**.
The ability name must be unique in an application. Note: If you use DevEco Studio to create the project, an ability named **EntryAbility** will be created by default, and its configuration will be saved to the **config.json** file. If you use other IDEs, the value of this attribute can be customized. The value can contain a maximum of 127 bytes.| String| No|
-| description | Description of the ability. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 bytes.| String| Yes (initial value: left empty)|
-| icon | Index to the ability icon file. Example value: **$media:ability_icon**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the icon of the ability is also used as the icon of the application. If multiple abilities address this condition, the icon of the first candidate ability is used as the application icon.
Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels.| String| Yes (initial value: left empty)|
-| label | Ability name displayed to users. The value can be a name string or a resource index to names in multiple languages, for example, **$string:ability_label**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the label of the ability is also used as the label of the application. If multiple abilities address this condition, the label of the first candidate ability is used as the application label.
Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels. The value can be a reference to a string defined in a resource file or a string enclosed in brackets ({}). The value can contain a maximum of 255 characters.| String| Yes (initial value: left empty)|
-| uri | Uniform Resource Identifier (URI) of the ability. The value can contain a maximum of 255 bytes.| String| Yes (No for abilities using the Data template)|
-| launchType | Launch type of the ability. The value can be **standard** or **singleton**.
**standard**: Multiple **Ability** instances can be created during startup. Most abilities can use this type.
**singleton**: Only a single **Ability** instance can be created across all task stacks during startup. For example, a globally unique incoming call screen uses the singleton launch type. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String| Yes (initial value: **"singleton"**)|
-| visible | Whether the ability can be called by other applications.
**true**: The ability can be called by other applications.
**false**: The ability cannot be called by other applications.| Boolean| Yes (initial value: **false**)|
-| permissions | Permissions required for abilities of another application to call the current ability. The value is an array of permission names predefined by the system, generally in the reverse domain name notation. It contains a maximum of 255 bytes.| String array| Yes (initial value: left empty)|
-|skills | Types of the **want** that can be accepted by the ability.| Object array| Yes (initial value: left empty)|
-| deviceCapability | Device capabilities required to run the ability. The value is an array of up to 512 elements, each of which contains a maximum of 64 bytes.| String array| Yes (initial value: left empty)|
-| metaData | Metadata.| Object| Yes (initial value: left empty)|
-| type | Ability type. The options are as follows:
**page**: FA developed using the Page template to provide the capability of interacting with users.
**service**: PA developed using the Service template to provide the capability of running tasks in the background.
**data**: PA developed using the Data template to provide unified data access for external systems.
**CA**: ability that can be started by other applications as a window.| String| No|
-| orientation | Display orientations of the ability. This attribute applies only to the ability using the Page template. The options are as follows:
**unspecified**: indicates that the system automatically determines the display orientation of the ability.
**landscape**: indicates the landscape orientation.
**portrait**: indicates the portrait orientation.
**followRecent**: indicates that the orientation follows the most recent application in the stack.| String| Yes (initial value: **"unspecified"**)|
-| backgroundModes | Background service type of the ability. You can assign multiple background service types to a specific ability. This field applies only to the ability using the Service template. The options are as follows:
**dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices.
**audioPlayback**: audio playback service.
**audioRecording**: audio recording service.
**pictureInPicture**: picture in picture (PiP) and small-window video playback services.
**voip**: voice/video call and VoIP services.
**location**: location and navigation services.
**bluetoothInteraction**: Bluetooth scanning, connection, and transmission services.
**wifiInteraction**: WLAN scanning, connection, and transmission services.
**screenFetch**: screen recording and screenshot services.
**multiDeviceConnection**: multi-device interconnection service.| String array| Yes (initial value: left empty)|
-| grantPermission | Whether permissions can be granted for any data in the ability.| Boolean| Yes (initial value: left empty)|
-| readPermission | Permission required for reading data in the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| String| Yes (initial value: left empty)|
-| writePermission | Permission required for writing data to the ability. This attribute applies only to the ability using the Data template. The value is a string with a maximum of 255 bytes.| String| Yes (initial value: left empty)|
-| configChanges | System configurations that the ability concerns. Upon any changes on the concerned configurations, the **onConfigurationUpdated** callback will be invoked to notify the ability. The options are as follows:
**mcc**: indicates that the mobile country code (MCC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MCC is updated.
**mnc**: indicates that the mobile network code (MNC) of the IMSI is changed. Typical scenario: A SIM card is detected, and the MNC is updated.
**locale**: indicates that the locale is changed. Typical scenario: The user selects a new language for the text display of the device.
**layout**: indicates that the screen layout is changed. Typical scenario: Currently, different display forms are all in the active state.
**fontSize**: indicates that font size is changed. Typical scenario: A new global font size is set.
**orientation**: indicates that the screen orientation is changed. Typical scenario: The user rotates the device.
**density**: indicates that the display density is changed. Typical scenario: The user may specify different display ratios, or different display forms are active at the same time.
**size**: indicates that the size of the display window is changed.
**smallestSize**: indicates that the length of the shorter side of the display window is changed.
**colorMode**: indicates that the color mode is changed.| String array| Yes (initial value: left empty)|
-| mission | Task stack of the ability. This attribute applies only to the ability using the Page template. By default, all abilities in an application belong to the same task stack.| String| Yes (initial value: bundle name of the application)|
-| targetAbility | Target ability that this ability alias points to. This attribute applies only to the ability using the Page template. If the **targetAbility** attribute is set, only **name**, **icon**, **label**, **visible**, **permissions**, and **skills** take effect in the current ability (ability alias). Other attributes use the values of the **targetAbility** attribute. The target ability must belong to the same application as the alias and must be declared in **config.json** ahead of the alias.| String| Yes (initial value: left empty, indicating that the current ability is not an alias)|
-| formsEnabled | Whether the ability can provide widgets. This attribute applies only to the ability using the Page template.
**true**: This ability can provide widgets.
**false**: This ability cannot provide widgets.| Boolean| Yes (initial value: **false**)|
-| forms | Information about the widgets used by the ability. This attribute is valid only when **formsEnabled** is set to **true**.| Object array| Yes (initial value: left empty)|
-| srcLanguage | Programming language of the ability, which you can specify when creating the project.| String| Yes (initial value: **"js"**)|
-| srcPath | JS code path corresponding to the ability. The value can contain a maximum of 127 bytes.| String| No|
-| uriPermission | Application data that the ability can access. This attribute consists of the **mode** and **path** sub-attributes. This attribute is valid only for the capability of the type provider.| Object| Yes (initial value: left empty)|
-| startWindowIcon | Index to the icon file of the ability startup page. This attribute applies only to the ability using the Page template. Example: **$media:icon**.| String| Yes (initial value: left empty)|
-| startWindowBackground | Index to the background color resource file of the ability startup page. This attribute applies only to the ability using the Page template. Example: **$color:red**.| String| Yes (initial value: left empty)|
-| removeMissionAfterTerminate | Whether to remove the relevant task from the task list after the ability is destroyed. This attribute applies only to the ability using the Page template. The value **true** means to remove the relevant task from the task list after the ability is destroyed, and **false** means the opposite.| Boolean| Yes (initial value: **false**)|
+> **NOTE**
+>
+> The label displayed on the application details screen may be different from the one displayed on the home screen. These two are the same if the entry icon and label are configured for the non-Page ability.
## Internal Structure of the uriPermission Attribute
@@ -318,7 +308,7 @@ Example of the **abilities** attribute structure:
"label": "$string:example",
"launchType": "standard",
"orientation": "unspecified",
- "permissions": [],
+ "permissions": [],
"visible": true,
"skills": [
{
@@ -331,11 +321,11 @@ Example of the **abilities** attribute structure:
}
],
"configChanges": [
- "locale",
- "layout",
- "fontSize",
+ "locale",
+ "layout",
+ "fontSize",
"orientation"
- ],
+ ],
"type": "page",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:red",
@@ -381,7 +371,7 @@ Example of the **abilities** attribute structure:
| -------- | -------- | -------- | -------- |
| actions | Actions of the **want** that can be accepted by the ability. Generally, the value is an **action** value predefined in the system.| String array| Yes (initial value: left empty)|
| entities | Entities of the **want** that can be accepted by the ability, such as video and home applications.| String array| Yes (initial value: left empty)|
-| uris | Data specifications to be added to the want filter. The specification is a data type (using the **mimeType** attribute), a URI, or both a data type and a URI.
The URI is specified by separate attributes of each part: <scheme>://<host>:<port>[<path>\|<pathStartWith>\|<pathRegex>].
**scheme** is mandatory when the specification is of the URI type and is optional when the specification is a data type. | Object array| Yes (initial value: left empty)|
+| uris | Data specifications to be added to the want filter. The specification is a data type (using the **mimeType** attribute), a URI, or both a data type and a URI.
The URI is specified by separate attributes of each part: <scheme>://<host>:<port>[<path>\|<pathStartWith>\|<pathRegex>].
**scheme** is mandatory when the specification is of the URI type and is optional when the specification is a data type.| Object array| Yes (initial value: left empty)|
## Internal Structure of the uris Attribute
@@ -405,7 +395,7 @@ Example of the **skills** attribute structure:
{
"actions": [
"action.system.home"
- ],
+ ],
"entities": [
"entity.system.home"
],
@@ -477,11 +467,11 @@ Example of the **js** attribute structure:
```json
"js": [
{
- "name": "default",
- "pages": [
+ "name": "default",
+ "pages": [
"pages/index/index",
"pages/detail/detail"
- ],
+ ],
"window": {
"designWidth": 720,
"autoDesignWidth": false
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index 7b8496a76bdbc1842b1eaca55f8d1e7199b31d66..6cdab4d3f249db9b1c7a2e300538223f8e3d49a0 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -145,9 +145,12 @@
- [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md)
- Common Events
+ - [Common Events of the Ability Subsystem](common_event/commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](common_event/commonEvent-bundleManager.md)
- [Common Events of the Notification Service](common_event/commonEvent-ans.md)
+ - [Common Events of the Resource Scheduling Subsystem](common_event/commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](common_event/commonEvent-telephony.md)
+ - [Common Events of the USB Subsystem](common_event/commonEvent-usb.md)
- Bundle Management
- [@ohos.bundle.appControl (appControl)](js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](js-apis-bundleManager.md)
@@ -211,9 +214,9 @@
- [@ohos.multimedia.image (Image Processing)](js-apis-image.md)
- [@ohos.multimedia.media (Media)](js-apis-media.md)
- [@ohos.multimedia.systemSoundManager (System Sound Management)](js-apis-systemSoundManager.md)
- - multimedia
+ - Multimedia
- [ringtonePlayer (Ringtone Player)](js-apis-inner-multimedia-ringtonePlayer.md)
-
+
- Resource Manager
- [@ohos.i18n (Internationalization)](js-apis-i18n.md)
- [@ohos.intl (Internationalization)](js-apis-intl.md)
@@ -241,6 +244,7 @@
- [PermissionRequestResult](js-apis-permissionrequestresult.md)
- Data Management
+ - [@ohos.data.cloudData (Device-Cloud Synergy)](js-apis-data-cloudData.md)
- [@ohos.data.dataAbility (DataAbility Predicates)](js-apis-data-ability.md)
- [@ohos.data.dataShare (DataShare)](js-apis-data-dataShare.md)
- [@ohos.data.dataSharePredicates (DataShare Predicates)](js-apis-data-dataSharePredicates.md)
diff --git a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
index 86b80960d6de170eb7def9e9bfcc88aa8913c7ad..ffedb677c4743434e3c860a6d56b7af5d19be500 100644
--- a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
+++ b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
@@ -74,7 +74,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
try {
- atManager.checkAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS").then((data) => {
+ atManager.checkAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS').then((data) => {
console.log(`checkAccessToken success, data->${JSON.stringify(data)}`);
}).catch((err) => {
console.log(`checkAccessToken fail, err->${JSON.stringify(err)}`);
@@ -111,14 +111,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
```js
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let data = atManager.verifyAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let data = atManager.verifyAccessTokenSync(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
console.log(`data->${JSON.stringify(data)}`);
```
@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
+| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName exceeds 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
@@ -169,7 +169,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags).then(() => {
+ atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags).then(() => {
console.log('grantUserGrantedPermission success');
}).catch((err) => {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
@@ -221,7 +221,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags, (err, data) => {
+ atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags, (err, data) => {
if (err) {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else {
@@ -280,7 +280,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags).then(() => {
+ atManager.revokeUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags).then(() => {
console.log('revokeUserGrantedPermission success');
}).catch((err) => {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
@@ -332,7 +332,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags, (err, data) => {
+ atManager.revokeUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags, (err, data) => {
if (err) {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else {
@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. |
@@ -389,7 +389,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
try {
- atManager.getPermissionFlags(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS").then((data) => {
+ atManager.getPermissionFlags(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS').then((data) => {
console.log(`getPermissionFlags success, data->${JSON.stringify(data)}`);
}).catch((err) => {
console.log(`getPermissionFlags fail, err->${JSON.stringify(err)}`);
@@ -443,7 +443,7 @@ Subscribes to permission state changes of the specified applications and permiss
| ------------------ | --------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type to subscribe to. The value is **'permissionStateChange'**, which indicates the permission grant state change. |
| tokenIDList | Array<number> | Yes | Token IDs of the applications to observe. If this parameter is left empty, the permission grant state changes of all applications are observed. |
-| permissionList | Array<Permissions> | Yes | Permissions to observe. If this parameter is left empty, the grant state changes of all permissions are observed. |
+| permissionList | Array<Permissions> | Yes | List of permission names. If this parameter is left empty, the grant state changes of all permissions are subscribed to. |
| callback | Callback<[PermissionStateChangeInfo](#permissionstatechangeinfo9)> | Yes| Callback invoked to return the permission grant state change.|
**Error codes**
@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100004 | The interface is called repeatedly with the same input. |
| 12100005 | The registration time has exceeded the limitation. |
| 12100007 | Service is abnormal. |
@@ -461,16 +461,16 @@ For details about the error codes, see [Application Access Control Error Codes](
**Example**
```js
-import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl';
+import {Permissions} from '@ohos.abilityAccessCtrl';
import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array = [appInfo.accessTokenId];
-let permissionList: Array = ["ohos.permission.DISTRIBUTED_DATASYNC"];
+let permissionList: Array = ['ohos.permission.DISTRIBUTED_DATASYNC'];
try {
atManager.on('permissionStateChange', tokenIDList, permissionList, (data) => {
- console.debug("receive permission state change, data:" + JSON.stringify(data));
+ console.debug('receive permission state change, data:' + JSON.stringify(data));
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -505,20 +505,20 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenIDs or permissionNames in the list are all invalid. |
-| 12100004 | The interface is not used together with "on". |
+| 12100004 | The interface is not used together with 'on'. |
| 12100007 | Service is abnormal. |
| 12100008 | Out of memory. |
**Example**
```js
-import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl';
+import {Permissions} from '@ohos.abilityAccessCtrl';
import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array = [appInfo.accessTokenId];
-let permissionList: Array = ["ohos.permission.DISTRIBUTED_DATASYNC"];
+let permissionList: Array = ['ohos.permission.DISTRIBUTED_DATASYNC'];
try {
atManager.off('permissionStateChange', tokenIDList, permissionList);
} catch(err) {
@@ -558,7 +558,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let promise = atManager.verifyAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let promise = atManager.verifyAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
promise.then(data => {
console.log(`promise: data->${JSON.stringify(data)}`);
});
@@ -599,10 +599,10 @@ For details about the error codes, see [Application Access Control Error Codes](
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
- atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"], (err, data)=>{
- console.info("data:" + JSON.stringify(data));
- console.info("data permissions:" + data.permissions);
- console.info("data authResults:" + data.authResults);
+ atManager.requestPermissionsFromUser(this.context, ['ohos.permission.CAMERA'], (err, data)=>{
+ console.info('data:' + JSON.stringify(data));
+ console.info('data permissions:' + data.permissions);
+ console.info('data authResults:' + data.authResults);
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -650,12 +650,12 @@ For details about the error codes, see [Application Access Control Error Codes](
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
- atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"]).then((data) => {
- console.info("data:" + JSON.stringify(data));
- console.info("data permissions:" + data.permissions);
- console.info("data authResults:" + data.authResults);
+ atManager.requestPermissionsFromUser(this.context, ['ohos.permission.CAMERA']).then((data) => {
+ console.info('data:' + JSON.stringify(data));
+ console.info('data permissions:' + data.permissions);
+ console.info('data authResults:' + data.authResults);
}).catch((err) => {
- console.info("data:" + JSON.stringify(err));
+ console.info('data:' + JSON.stringify(err));
})
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -694,7 +694,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let promise = atManager.verifyAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let promise = atManager.verifyAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
promise.then(data => {
console.log(`promise: data->${JSON.stringify(data)}`);
});
@@ -727,14 +727,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
```js
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let data = atManager.checkAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let data = atManager.checkAccessTokenSync(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
console.log(`data->${JSON.stringify(data)}`);
```
diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md
index 307b991bc1f5725cd7dffd73bc93ced1541ab004..6bb26ca37ab1d320d904cdaa17c5a100291f322c 100644
--- a/en/application-dev/reference/apis/js-apis-appAccount.md
+++ b/en/application-dev/reference/apis/js-apis-appAccount.md
@@ -65,11 +65,11 @@ Creates an app account. This API uses an asynchronous callback to return the res
```js
try {
- appAccountManager.createAccount("WangWu", (err) => {
- console.log("createAccount err: " + JSON.stringify(err));
+ appAccountManager.createAccount('WangWu', (err) => {
+ console.log('createAccount err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("createAccount err: " + JSON.stringify(err));
+ console.log('createAccount err: ' + JSON.stringify(err));
}
```
@@ -103,19 +103,19 @@ Creates an app account with custom data. This API uses an asynchronous callback
```js
let options = {
customData: {
- "age": "10"
+ 'age': '10'
}
}
try {
- appAccountManager.createAccount("LiSi", options, (err) => {
+ appAccountManager.createAccount('LiSi', options, (err) => {
if (err) {
- console.log("createAccount failed, error: " + JSON.stringify(err));
+ console.log('createAccount failed, error: ' + JSON.stringify(err));
} else {
- console.log("createAccount successfully");
+ console.log('createAccount successfully');
}
});
} catch(err) {
- console.log("createAccount exception: " + JSON.stringify(err));
+ console.log('createAccount exception: ' + JSON.stringify(err));
}
```
@@ -132,7 +132,7 @@ Creates an app account with custom data. This API uses a promise to return the r
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------------------------------- |
| name | string | Yes | Name of the app account to create. |
-| options | [CreateAccountOptions](#createaccountoptions9) | No | Options for creating the app account. You can customize data based on service requirements, but do not add sensitive data (such as passwords and tokens). This parameter can be left empty.|
+| options | [CreateAccountOptions](#createaccountoptions9) | No | Options for creating the app account. You can customize data based on service requirements, but do not add sensitive data (such as passwords and tokens).
By default, no value is passed, which means no additional information needs to be added for the account.|
**Return value**
@@ -154,17 +154,17 @@ Creates an app account with custom data. This API uses a promise to return the r
```js
let options = {
customData: {
- "age": "10"
+ 'age': '10'
}
}
try {
- appAccountManager.createAccount("LiSi", options).then(() => {
- console.log("createAccount successfully");
+ appAccountManager.createAccount('LiSi', options).then(() => {
+ console.log('createAccount successfully');
}).catch((err) => {
- console.log("createAccount failed, error: " + JSON.stringify(err));
+ console.log('createAccount failed, error: ' + JSON.stringify(err));
});
} catch(err) {
- console.log("createAccount exception: " + JSON.stringify(err));
+ console.log('createAccount exception: ' + JSON.stringify(err));
}
```
@@ -198,8 +198,8 @@ Creates an app account implicitly based on the specified account owner. This API
```js
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -210,19 +210,19 @@ Creates an app account implicitly based on the specified account owner. This API
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
try {
- appAccountManager.createAccountImplicitly("com.example.accountjsdemo", {
+ appAccountManager.createAccountImplicitly('com.example.accountjsdemo', {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("createAccountImplicitly exception: " + JSON.stringify(err));
+ console.log('createAccountImplicitly exception: ' + JSON.stringify(err));
}
```
@@ -257,8 +257,8 @@ Creates an app account implicitly based on the specified account owner and optio
```js
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -269,23 +269,23 @@ Creates an app account implicitly based on the specified account owner and optio
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
let options = {
- authType: "getSocialData",
- requiredLabels: [ "student" ]
+ authType: 'getSocialData',
+ requiredLabels: [ 'student' ]
};
try {
- appAccountManager.createAccountImplicitly("com.example.accountjsdemo", options, {
+ appAccountManager.createAccountImplicitly('com.example.accountjsdemo', options, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("createAccountImplicitly exception: " + JSON.stringify(err));
+ console.log('createAccountImplicitly exception: ' + JSON.stringify(err));
}
```
@@ -316,15 +316,15 @@ Removes an app account. This API uses an asynchronous callback to return the res
```js
try {
- appAccountManager.removeAccount("ZhaoLiu", (err) => {
+ appAccountManager.removeAccount('ZhaoLiu', (err) => {
if (err) {
- console.log("removeAccount failed, error: " + JSON.stringify(err));
+ console.log('removeAccount failed, error: ' + JSON.stringify(err));
} else {
- console.log("removeAccount successfully");
+ console.log('removeAccount successfully');
}
});
} catch(err) {
- console.log("removeAccount exception: " + JSON.stringify(err));
+ console.log('removeAccount exception: ' + JSON.stringify(err));
}
```
@@ -360,13 +360,13 @@ Removes an app account. This API uses a promise to return the result.
```js
try {
- appAccountManager.removeAccount("Lisi").then(() => {
- console.log("removeAccount successfully");
+ appAccountManager.removeAccount('Lisi').then(() => {
+ console.log('removeAccount successfully');
}).catch((err) => {
- console.log("removeAccount failed, error: " + JSON.stringify(err));
+ console.log('removeAccount failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("removeAccount exception: " + JSON.stringify(err));
+ console.log('removeAccount exception: ' + JSON.stringify(err));
}
```
@@ -400,15 +400,15 @@ Sets the access to the data of an account for an app. This API uses an asynchron
```js
try {
- appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true, (err) => {
+ appAccountManager.setAppAccess('ZhangSan', 'com.example.accountjsdemo', true, (err) => {
if (err) {
- console.log("setAppAccess failed: " + JSON.stringify(err));
+ console.log('setAppAccess failed: ' + JSON.stringify(err));
} else {
- console.log("setAppAccess successfully");
+ console.log('setAppAccess successfully');
}
});
} catch (err) {
- console.log("setAppAccess exception: " + JSON.stringify(err));
+ console.log('setAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -447,13 +447,13 @@ Sets the access to the data of an account for an app. This API uses a promise to
```js
try {
- appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true).then(() => {
- console.log("setAppAccess successfully");
+ appAccountManager.setAppAccess('ZhangSan', 'com.example.accountjsdemo', true).then(() => {
+ console.log('setAppAccess successfully');
}).catch((err) => {
- console.log("setAppAccess failed: " + JSON.stringify(err));
+ console.log('setAppAccess failed: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setAppAccess exception: " + JSON.stringify(err));
+ console.log('setAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -485,15 +485,15 @@ Checks whether an app can access the data of an account. This API uses an asynch
```js
try {
- appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo", (err, isAccessible) => {
+ appAccountManager.checkAppAccess('ZhangSan', 'com.example.accountjsdemo', (err, isAccessible) => {
if (err) {
- console.log("checkAppAccess failed, error: " + JSON.stringify(err));
+ console.log('checkAppAccess failed, error: ' + JSON.stringify(err));
} else {
- console.log("checkAppAccess successfully");
+ console.log('checkAppAccess successfully');
}
});
} catch (err) {
- console.log("checkAppAccess exception: " + JSON.stringify(err));
+ console.log('checkAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -530,13 +530,13 @@ Checks whether an app can access the data of an account. This API uses a promise
```js
try {
- appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo").then((isAccessible) => {
- console.log("checkAppAccess successfully, isAccessible: " + isAccessible);
+ appAccountManager.checkAppAccess('ZhangSan', 'com.example.accountjsdemo').then((isAccessible) => {
+ console.log('checkAppAccess successfully, isAccessible: ' + isAccessible);
}).catch((err) => {
- console.log("checkAppAccess failed, error: " + JSON.stringify(err));
+ console.log('checkAppAccess failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkAppAccess exception: " + JSON.stringify(err));
+ console.log('checkAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -570,11 +570,11 @@ Sets data synchronization for an app account. This API uses an asynchronous call
```js
try {
- appAccountManager.setDataSyncEnabled("ZhangSan", true, (err) => {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ appAccountManager.setDataSyncEnabled('ZhangSan', true, (err) => {
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -613,13 +613,13 @@ Sets data synchronization for an app account. This API uses a promise to return
```js
try {
- appAccountManager .setDataSyncEnabled("ZhangSan", true).then(() => {
+ appAccountManager .setDataSyncEnabled('ZhangSan', true).then(() => {
console.log('setDataSyncEnabled Success');
}).catch((err) => {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -652,15 +652,15 @@ Checks whether data synchronization is enabled for an app account. This API uses
```js
try {
- appAccountManager.checkDataSyncEnabled("ZhangSan", (err, isEnabled) => {
+ appAccountManager.checkDataSyncEnabled('ZhangSan', (err, isEnabled) => {
if (err) {
- console.log("checkDataSyncEnabled failed, err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled failed, err: ' + JSON.stringify(err));
} else {
console.log('checkDataSyncEnabled successfully, isEnabled: ' + isEnabled);
}
});
} catch (err) {
- console.log("checkDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -698,13 +698,13 @@ Checks whether data synchronization is enabled for an app account. This API uses
```js
try {
- appAccountManager.checkDataSyncEnabled("ZhangSan").then((isEnabled) => {
- console.log("checkDataSyncEnabled successfully, isEnabled: " + isEnabled);
+ appAccountManager.checkDataSyncEnabled('ZhangSan').then((isEnabled) => {
+ console.log('checkDataSyncEnabled successfully, isEnabled: ' + isEnabled);
}).catch((err) => {
- console.log("checkDataSyncEnabled failed, err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled failed, err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -737,15 +737,15 @@ Sets a credential for an app account. This API uses an asynchronous callback to
```js
try {
- appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx", (err) => {
+ appAccountManager.setCredential('ZhangSan', 'PIN_SIX', 'xxxxxx', (err) => {
if (err) {
- console.log("setCredential failed, error: " + JSON.stringify(err));
+ console.log('setCredential failed, error: ' + JSON.stringify(err));
} else {
- console.log("setCredential successfully");
+ console.log('setCredential successfully');
}
});
} catch (err) {
- console.log("setCredential exception: " + JSON.stringify(err));
+ console.log('setCredential exception: ' + JSON.stringify(err));
}
```
@@ -783,13 +783,13 @@ Sets a credential for an app account. This API uses a promise to return the resu
```js
try {
- appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx").then(() => {
- console.log("setCredential successfully");
+ appAccountManager.setCredential('ZhangSan', 'PIN_SIX', 'xxxxxx').then(() => {
+ console.log('setCredential successfully');
}).catch((err) => {
- console.log("setCredential failed, error: " + JSON.stringify(err));
+ console.log('setCredential failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setCredential exception: " + JSON.stringify(err));
+ console.log('setCredential exception: ' + JSON.stringify(err));
}
```
@@ -822,15 +822,15 @@ Obtains the credential of an app account. This API uses an asynchronous callback
```js
try {
- appAccountManager.getCredential("ZhangSan", "PIN_SIX", (err, result) => {
+ appAccountManager.getCredential('ZhangSan', 'PIN_SIX', (err, result) => {
if (err) {
- console.log("getCredential failed, error: " + JSON.stringify(err));
+ console.log('getCredential failed, error: ' + JSON.stringify(err));
} else {
console.log('getCredential successfully, result: ' + result);
}
});
} catch (err) {
- console.log("getCredential err: " + JSON.stringify(err));
+ console.log('getCredential err: ' + JSON.stringify(err));
}
```
@@ -868,13 +868,13 @@ Obtains the credential of an app account. This API uses a promise to return the
```js
try {
- appAccountManager.getCredential("ZhangSan", "PIN_SIX").then((credential) => {
- console.log("getCredential successfully, credential: " + credential);
+ appAccountManager.getCredential('ZhangSan', 'PIN_SIX').then((credential) => {
+ console.log('getCredential successfully, credential: ' + credential);
}).catch((err) => {
- console.log("getCredential failed, error: " + JSON.stringify(err));
+ console.log('getCredential failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getCredential exception: " + JSON.stringify(err));
+ console.log('getCredential exception: ' + JSON.stringify(err));
}
```
@@ -908,15 +908,15 @@ Sets custom data for an app account. This API uses an asynchronous callback to r
```js
try {
- appAccountManager.setCustomData("ZhangSan", "age", "12", (err) => {
+ appAccountManager.setCustomData('ZhangSan', 'age', '12', (err) => {
if (err) {
- console.log("setCustomData failed, error: " + JSON.stringify(err));
+ console.log('setCustomData failed, error: ' + JSON.stringify(err));
} else {
- console.log("setCustomData successfully");
+ console.log('setCustomData successfully');
}
});
} catch (err) {
- console.log("setCustomData exception: " + JSON.stringify(err));
+ console.log('setCustomData exception: ' + JSON.stringify(err));
}
```
@@ -955,13 +955,13 @@ Sets custom data for an app account. This API uses a promise to return the resul
```js
try {
- appAccountManager.setCustomData("ZhangSan", "age", "12").then(() => {
- console.log("setCustomData successfully");
+ appAccountManager.setCustomData('ZhangSan', 'age', '12').then(() => {
+ console.log('setCustomData successfully');
}).catch((err) => {
- console.log("setCustomData failed, error: " + JSON.stringify(err));
+ console.log('setCustomData failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setCustomData exception: " + JSON.stringify(err));
+ console.log('setCustomData exception: ' + JSON.stringify(err));
}
```
@@ -994,15 +994,15 @@ Obtains the custom data of an app account based on the specified key. This API u
```js
try {
- appAccountManager.getCustomData("ZhangSan", "age", (err, data) => {
+ appAccountManager.getCustomData('ZhangSan', 'age', (err, data) => {
if (err) {
console.log('getCustomData failed, error: ' + err);
} else {
- console.log("getCustomData successfully, data: " + data);
+ console.log('getCustomData successfully, data: ' + data);
}
});
} catch (err) {
- console.log("getCustomData exception: " + JSON.stringify(err));
+ console.log('getCustomData exception: ' + JSON.stringify(err));
}
```
@@ -1040,13 +1040,13 @@ Obtains the custom data of an app account based on the specified key. This API u
```js
try {
- appAccountManager.getCustomData("ZhangSan", "age").then((data) => {
- console.log("getCustomData successfully, data: " + data);
+ appAccountManager.getCustomData('ZhangSan', 'age').then((data) => {
+ console.log('getCustomData successfully, data: ' + data);
}).catch((err) => {
- console.log("getCustomData failed, error: " + JSON.stringify(err));
+ console.log('getCustomData failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getCustomData exception: " + JSON.stringify(err));
+ console.log('getCustomData exception: ' + JSON.stringify(err));
}
```
@@ -1084,10 +1084,10 @@ Obtains the custom data of an app account based on the specified key. The API re
```js
try {
- let value = appAccountManager.getCustomDataSync("ZhangSan", "age");
- console.info("getCustomDataSync successfully, vaue:" + value);
+ let value = appAccountManager.getCustomDataSync('ZhangSan', 'age');
+ console.info('getCustomDataSync successfully, vaue: ' + value);
} catch (err) {
- console.error("getCustomDataSync failed, error: " + JSON.stringify(err));
+ console.error('getCustomDataSync failed, error: ' + JSON.stringify(err));
}
```
@@ -1117,13 +1117,13 @@ Obtains information about all accessible app accounts. This API uses an asynchro
try {
appAccountManager.getAllAccounts((err, data) => {
if (err) {
- console.debug("getAllAccounts failed, error:" + JSON.stringify(err));
+ console.debug('getAllAccounts failed, error: ' + JSON.stringify(err));
} else {
- console.debug("getAllAccounts successfully");
+ console.debug('getAllAccounts successfully');
}
});
} catch (err) {
- console.debug("getAllAccounts exception: " + JSON.stringify(err));
+ console.debug('getAllAccounts exception: ' + JSON.stringify(err));
}
```
@@ -1152,12 +1152,12 @@ Obtains information about all accessible app accounts. This API uses a promise t
```js
try {
appAccountManager.getAllAccounts().then((data) => {
- console.debug("getAllAccounts successfully");
+ console.debug('getAllAccounts successfully');
}).catch((err) => {
- console.debug("getAllAccounts failed, error:" + JSON.stringify(err));
+ console.debug('getAllAccounts failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.debug("getAllAccounts exception: " + JSON.stringify(err));
+ console.debug('getAllAccounts exception: ' + JSON.stringify(err));
}
```
@@ -1188,15 +1188,15 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
```js
try {
- appAccountManager.getAccountsByOwner("com.example.accountjsdemo2", (err, data) => {
+ appAccountManager.getAccountsByOwner('com.example.accountjsdemo2', (err, data) => {
if (err) {
- console.debug("getAccountsByOwner failed, error:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner failed, error:' + JSON.stringify(err));
} else {
- console.debug("getAccountsByOwner successfully, data:" + JSON.stringify(data));
+ console.debug('getAccountsByOwner successfully, data:' + JSON.stringify(data));
}
});
} catch (err) {
- console.debug("getAccountsByOwner exception:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner exception:' + JSON.stringify(err));
}
```
@@ -1232,13 +1232,13 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
```js
try {
- appAccountManager.getAccountsByOwner("com.example.accountjsdemo2").then((data) => {
- console.debug("getAccountsByOwner successfully, data:" + JSON.stringify(data));
+ appAccountManager.getAccountsByOwner('com.example.accountjsdemo2').then((data) => {
+ console.debug('getAccountsByOwner successfully, data: ' + JSON.stringify(data));
}).catch((err) => {
- console.debug("getAccountsByOwner failed, error:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.debug("getAccountsByOwner exception:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner exception: ' + JSON.stringify(err));
}
```
@@ -1256,7 +1256,7 @@ Subscribes to account information changes of apps.
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | 'accountChange' | Yes | Event type to subscribe to. The value is **'accountChange'**. An event will be reported when the account information of the target app changes.|
| owners | Array<string> | Yes | App bundle names of the account. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return a list of app accounts whose information is changed. |
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback registered to return the list of changed app accounts. |
**Error codes**
@@ -1270,12 +1270,12 @@ Subscribes to account information changes of apps.
```js
function changeOnCallback(data){
- console.log("receive change data:" + JSON.stringify(data));
+ console.log('receive change data:' + JSON.stringify(data));
}
try{
- appAccountManager.on("accountChange", ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('accountChange', ['com.example.actsaccounttest'], changeOnCallback);
} catch(err) {
- console.error("on accountChange failed, error:" + JSON.stringify(err));
+ console.error('on accountChange failed, error:' + JSON.stringify(err));
}
```
@@ -1292,7 +1292,7 @@ Unsubscribes from account information changes.
| Name | Type | Mandatory | Description |
| -------- | -------------------------------- | ---- | ------------ |
| type | 'accountChange' | Yes | Event type to unsubscribe from. The value is **'accountChange'**. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister.|
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister. By default, no value is passed, which means to unregister all callbacks for the specified event.|
**Error codes**
@@ -1305,18 +1305,18 @@ Unsubscribes from account information changes.
```js
function changeOnCallback(data) {
- console.log("receive change data:" + JSON.stringify(data));
+ console.log('receive change data:' + JSON.stringify(data));
}
try{
- appAccountManager.on("accountChange", ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('accountChange', ['com.example.actsaccounttest'], changeOnCallback);
} catch(err) {
- console.error("on accountChange failed, error:" + JSON.stringify(err));
+ console.error('on accountChange failed, error:' + JSON.stringify(err));
}
try{
appAccountManager.off('accountChange', changeOnCallback);
}
catch(err){
- console.error("off accountChange failed, error:" + JSON.stringify(err));
+ console.error('off accountChange failed, error:' + JSON.stringify(err));
}
```
@@ -1354,8 +1354,8 @@ Authenticates an app account. This API uses an asynchronous callback to return t
function onResultCallback(code, authResult) {
- console.log("resultCode: " + code);
- console.log("authResult: " + JSON.stringify(authResult));
+ console.log('resultCode: ' + code);
+ console.log('authResult: ' + JSON.stringify(authResult));
}
function onRequestRedirectedCallback(request) {
@@ -1366,19 +1366,19 @@ Authenticates an app account. This API uses an asynchronous callback to return t
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
try {
- appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", {
+ appAccountManager.auth('LiSi', 'com.example.accountjsdemo', 'getSocialData', {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("auth exception: " + JSON.stringify(err));
+ console.log('auth exception: ' + JSON.stringify(err));
}
```
@@ -1417,8 +1417,8 @@ Authenticates an app account with customized options. This API uses an asynchron
function onResultCallback(code, authResult) {
- console.log("resultCode: " + code);
- console.log("authResult: " + JSON.stringify(authResult));
+ console.log('resultCode: ' + code);
+ console.log('authResult: ' + JSON.stringify(authResult));
}
function onRequestRedirectedCallback(request) {
@@ -1429,22 +1429,22 @@ Authenticates an app account with customized options. This API uses an asynchron
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
let options = {
- "password": "xxxx",
+ 'password': 'xxxx',
};
try {
- appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", options, {
+ appAccountManager.auth('LiSi', 'com.example.accountjsdemo', 'getSocialData', options, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("auth exception: " + JSON.stringify(err));
+ console.log('auth exception: ' + JSON.stringify(err));
}
```
@@ -1478,15 +1478,15 @@ Obtains the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, token) => {
+ appAccountManager.getAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', (err, token) => {
if (err) {
- console.log("getAuthToken failed, error: " + JSON.stringify(err));
+ console.log('getAuthToken failed, error: ' + JSON.stringify(err));
} else {
- console.log("getAuthToken successfully, token: " + token);
+ console.log('getAuthToken successfully, token: ' + token);
}
});
} catch (err) {
- console.log("getAuthToken exception: " + JSON.stringify(err));
+ console.log('getAuthToken exception: ' + JSON.stringify(err));
}
```
@@ -1525,13 +1525,13 @@ Obtains the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((token) => {
- console.log("getAuthToken successfully, token: " + token);
+ appAccountManager.getAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData').then((token) => {
+ console.log('getAuthToken successfully, token: ' + token);
}).catch((err) => {
- console.log("getAuthToken failed, error: " + JSON.stringify(err));
+ console.log('getAuthToken failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAuthToken exception: " + JSON.stringify(err));
+ console.log('getAuthToken exception: ' + JSON.stringify(err));
}
```
@@ -1565,11 +1565,11 @@ Sets an authorization token of the specific authentication type for an app accou
```js
try {
- appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx", (err) => {
+ appAccountManager.setAuthToken('LiSi', 'getSocialData', 'xxxx', (err) => {
if (err) {
- console.log("setAuthToken failed, error: " + JSON.stringify(err));
+ console.log('setAuthToken failed, error: ' + JSON.stringify(err));
} else {
- console.log("setAuthToken successfully");
+ console.log('setAuthToken successfully');
}
});
} catch (err) {
@@ -1612,13 +1612,13 @@ Sets an authorization token of the specific authentication type for an app accou
```js
try {
- appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx").then(() => {
- console.log("setAuthToken successfully");
+ appAccountManager.setAuthToken('LiSi', 'getSocialData', 'xxxx').then(() => {
+ console.log('setAuthToken successfully');
}).catch((err) => {
- console.log("setAuthToken failed, error: " + JSON.stringify(err));
+ console.log('setAuthToken failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setAuthToken exception: " + JSON.stringify(err));
+ console.log('setAuthToken exception: ' + JSON.stringify(err));
}
```
@@ -1653,11 +1653,11 @@ Deletes the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => {
+ appAccountManager.deleteAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx', (err) => {
if (err) {
console.log('deleteAuthToken failed, error: ' + JSON.stringify(err));
} else {
- console.log("deleteAuthToken successfully");
+ console.log('deleteAuthToken successfully');
}
});
} catch (err) {
@@ -1701,8 +1701,8 @@ Deletes the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => {
- console.log("deleteAuthToken successfully");
+ appAccountManager.deleteAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx').then(() => {
+ console.log('deleteAuthToken successfully');
}).catch((err) => {
console.log('deleteAuthToken failed, error: ' + JSON.stringify(err));
});
@@ -1744,15 +1744,15 @@ Sets the visibility of an authorization token to an app. This API uses an asynch
```js
try {
- appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => {
+ appAccountManager.setAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true, (err) => {
if (err) {
- console.log("setAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility failed, error: ' + JSON.stringify(err));
} else {
- console.log("setAuthTokenVisibility successfully");
+ console.log('setAuthTokenVisibility successfully');
}
});
} catch (err) {
- console.log("setAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1794,13 +1794,13 @@ Sets the visibility of an authorization token to an app. This API uses a promise
```js
try {
- appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => {
- console.log("setAuthTokenVisibility successfully");
+ appAccountManager.setAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true).then(() => {
+ console.log('setAuthTokenVisibility successfully');
}).catch((err) => {
- console.log("setAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1834,15 +1834,15 @@ Checks the visibility of an authorization token of the specified authentication
```js
try {
- appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, isVisible) => {
+ appAccountManager.checkAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', (err, isVisible) => {
if (err) {
- console.log("checkAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility failed, error: ' + JSON.stringify(err));
} else {
- console.log("checkAuthTokenVisibility successfully, isVisible: " + isVisible);
+ console.log('checkAuthTokenVisibility successfully, isVisible: ' + isVisible);
}
});
} catch (err) {
- console.log("checkAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1881,13 +1881,13 @@ Checks the visibility of an authorization token of the specified authentication
```js
try {
- appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((isVisible) => {
- console.log("checkAuthTokenVisibility successfully, isVisible: " + isVisible);
+ appAccountManager.checkAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo').then((isVisible) => {
+ console.log('checkAuthTokenVisibility successfully, isVisible: ' + isVisible);
}).catch((err) => {
- console.log("checkAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1919,15 +1919,15 @@ Obtains all tokens visible to the invoker for an app account. This API uses an a
```js
try {
- appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo", (err, tokenArr) => {
+ appAccountManager.getAllAuthTokens('LiSi', 'com.example.accountjsdemo', (err, tokenArr) => {
if (err) {
- console.log("getAllAuthTokens failed, error: " + JSON.stringify(err));
+ console.log('getAllAuthTokens failed, error: ' + JSON.stringify(err));
} else {
console.log('getAllAuthTokens successfully, tokenArr: ' + tokenArr);
}
});
} catch (err) {
- console.log("getAllAuthTokens exception: " + JSON.stringify(err));
+ console.log('getAllAuthTokens exception: ' + JSON.stringify(err));
}
```
@@ -1964,13 +1964,13 @@ Obtains all tokens visible to the invoker for an app account. This API uses a pr
```js
try {
- appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo").then((tokenArr) => {
+ appAccountManager.getAllAuthTokens('LiSi', 'com.example.accountjsdemo').then((tokenArr) => {
console.log('getAllAuthTokens successfully, tokenArr: ' + JSON.stringify(tokenArr));
}).catch((err) => {
- console.log("getAllAuthTokens failed, error: " + JSON.stringify(err));
+ console.log('getAllAuthTokens failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAllAuthTokens exception: " + JSON.stringify(err));
+ console.log('getAllAuthTokens exception: ' + JSON.stringify(err));
}
```
@@ -2003,11 +2003,11 @@ Obtains the authorization list of the specified authentication type for an app a
```js
try {
- appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData", (err, authList) => {
+ appAccountManager.getAuthList('LiSi', 'getSocialData', (err, authList) => {
if (err) {
- console.log("getAuthList failed, error: " + JSON.stringify(err));
+ console.log('getAuthList failed, error: ' + JSON.stringify(err));
} else {
- console.log("getAuthList successfully, authList: " + authList);
+ console.log('getAuthList successfully, authList: ' + authList);
}
});
} catch (err) {
@@ -2049,13 +2049,13 @@ Obtains the authorization list of the specified authentication type for an app a
```js
try {
- appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData").then((authList) => {
- console.log("getAuthList successfully, authList: " + authList);
+ appAccountManager.getAuthList('LiSi', 'getSocialData').then((authList) => {
+ console.log('getAuthList successfully, authList: ' + authList);
}).catch((err) => {
- console.log("getAuthList failed, error: " + JSON.stringify(err));
+ console.log('getAuthList failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAuthList exception: " + JSON.stringify(err));
+ console.log('getAuthList exception: ' + JSON.stringify(err));
}
```
@@ -2063,7 +2063,7 @@ Obtains the authorization list of the specified authentication type for an app a
getAuthCallback(sessionId: string, callback: AsyncCallback<AuthCallback>): void
-Obtains the authenticator callback for the authentication session. This API uses an asynchronous callback to return the result.
+Obtains the authenticator callback for an authentication session. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Account.AppAccount
@@ -2093,23 +2093,23 @@ Obtains the authenticator callback for the authentication session. This API uses
try {
appAccountManager.getAuthCallback(sessionId, (err, callback) => {
if (err != null) {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
return;
}
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(0, result);
});
} catch (err) {
- console.log("getAuthCallback exception: " + JSON.stringify(err));
+ console.log('getAuthCallback exception: ' + JSON.stringify(err));
}
}
}
@@ -2119,7 +2119,7 @@ Obtains the authenticator callback for the authentication session. This API uses
getAuthCallback(sessionId: string): Promise<AuthCallback>
-Obtains the authenticator callback for the authentication session. This API uses a promise to return the result.
+Obtains the authenticator callback for an authentication session. This API uses a promise to return the result.
**System capability**: SystemCapability.Account.AppAccount
@@ -2155,20 +2155,20 @@ Obtains the authenticator callback for the authentication session. This API uses
appAccountManager.getAuthCallback(sessionId).then((callback) => {
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(0, result);
}).catch((err) => {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAuthCallback exception: " + JSON.stringify(err));
+ console.log('getAuthCallback exception: ' + JSON.stringify(err));
}
}
}
@@ -2201,15 +2201,15 @@ Obtains the authenticator information of an app. This API uses an asynchronous c
```js
try {
- appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo", (err, info) => {
+ appAccountManager.queryAuthenticatorInfo('com.example.accountjsdemo', (err, info) => {
if (err) {
- console.log("queryAuthenticatorInfo failed, error: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo failed, error: ' + JSON.stringify(err));
} else {
console.log('queryAuthenticatorInfo successfully, info: ' + JSON.stringify(info));
}
});
} catch (err) {
- console.log("queryAuthenticatorInfo exception: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo exception: ' + JSON.stringify(err));
}
```
@@ -2245,13 +2245,13 @@ Obtains the authenticator information of an app. This API uses a promise to retu
```js
try {
- appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo").then((info) => {
- console.log("queryAuthenticatorInfo successfully, info: " + JSON.stringify(info));
+ appAccountManager.queryAuthenticatorInfo('com.example.accountjsdemo').then((info) => {
+ console.log('queryAuthenticatorInfo successfully, info: ' + JSON.stringify(info));
}).catch((err) => {
- console.log("queryAuthenticatorInfo failed, error: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("queryAuthenticatorInfo exception: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo exception: ' + JSON.stringify(err));
}
```
@@ -2286,17 +2286,17 @@ Checks whether an app account has specific labels. This API uses an asynchronous
**Example**
```js
- let labels = ["student"];
+ let labels = ['student'];
try {
- appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels, (err, hasAllLabels) => {
+ appAccountManager.checkAccountLabels('zhangsan', 'com.example.accountjsdemo', labels, (err, hasAllLabels) => {
if (err) {
- console.log("checkAccountLabels failed, error: " + JSON.stringify(err));
+ console.log('checkAccountLabels failed, error: ' + JSON.stringify(err));
} else {
- console.log("checkAccountLabels successfully, hasAllLabels: " + hasAllLabels);
+ console.log('checkAccountLabels successfully, hasAllLabels: ' + hasAllLabels);
}
});
} catch (err) {
- console.log("checkAccountLabels exception: " + JSON.stringify(err));
+ console.log('checkAccountLabels exception: ' + JSON.stringify(err));
}
```
@@ -2336,15 +2336,15 @@ Checks whether an app account has specific labels. This API uses a promise to re
**Example**
```js
- let labels = ["student"];
+ let labels = ['student'];
try {
- appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels).then((hasAllLabels) => {
+ appAccountManager.checkAccountLabels('zhangsan', 'com.example.accountjsdemo', labels).then((hasAllLabels) => {
console.log('checkAccountLabels successfully: ' + hasAllLabels);
}).catch((err) => {
- console.log("checkAccountLabels failed, error: " + JSON.stringify(err));
+ console.log('checkAccountLabels failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkAccountLabels exception: " + JSON.stringify(err));
+ console.log('checkAccountLabels exception: ' + JSON.stringify(err));
}
```
@@ -2377,15 +2377,15 @@ Deletes the credential of the specified type from an app account. This API uses
```js
try {
- appAccountManager.deleteCredential("zhangsan", "PIN_SIX", (err) => {
+ appAccountManager.deleteCredential('zhangsan', 'PIN_SIX', (err) => {
if (err) {
- console.log("deleteCredential failed, error: " + JSON.stringify(err));
+ console.log('deleteCredential failed, error: ' + JSON.stringify(err));
} else {
- console.log("deleteCredential successfully");
+ console.log('deleteCredential successfully');
}
});
} catch (err) {
- console.log("deleteCredential exception: " + JSON.stringify(err));
+ console.log('deleteCredential exception: ' + JSON.stringify(err));
}
```
@@ -2423,13 +2423,13 @@ Deletes the credential of the specified type from an app account. This API uses
```js
try {
- appAccountManager.deleteCredential("zhangsan", "PIN_SIX").then(() => {
- console.log("deleteCredential successfully");
+ appAccountManager.deleteCredential('zhangsan', 'PIN_SIX').then(() => {
+ console.log('deleteCredential successfully');
}).catch((err) => {
- console.log("deleteCredential failed, error: " + JSON.stringify(err));
+ console.log('deleteCredential failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("deleteCredential exception: " + JSON.stringify(err));
+ console.log('deleteCredential exception: ' + JSON.stringify(err));
}
```
@@ -2461,19 +2461,19 @@ Selects the accounts that can be accessed by the invoker based on the options. T
```js
let options = {
- allowedOwners: [ "com.example.accountjsdemo" ],
- requiredLabels: [ "student" ]
+ allowedOwners: [ 'com.example.accountjsdemo' ],
+ requiredLabels: [ 'student' ]
};
try {
appAccountManager.selectAccountsByOptions(options, (err, accountArr) => {
if (err) {
- console.log("selectAccountsByOptions failed, error: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions failed, error: ' + JSON.stringify(err));
} else {
- console.log("selectAccountsByOptions successfully, accountArr: " + JSON.stringify(accountArr));
+ console.log('selectAccountsByOptions successfully, accountArr: ' + JSON.stringify(accountArr));
}
});
} catch (err) {
- console.log("selectAccountsByOptions exception: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions exception: ' + JSON.stringify(err));
}
```
@@ -2510,16 +2510,16 @@ Selects the accounts that can be accessed by the invoker based on the options. T
```js
let options = {
- allowedOwners: ["com.example.accountjsdemo"]
+ allowedOwners: ['com.example.accountjsdemo']
};
try {
appAccountManager.selectAccountsByOptions(options).then((accountArr) => {
- console.log("selectAccountsByOptions successfully, accountArr: " + JSON.stringify(accountArr));
+ console.log('selectAccountsByOptions successfully, accountArr: ' + JSON.stringify(accountArr));
}).catch((err) => {
- console.log("selectAccountsByOptions failed, error: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("selectAccountsByOptions exception: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions exception: ' + JSON.stringify(err));
}
```
@@ -2554,17 +2554,17 @@ Verifies the credential of an app account. This API uses an asynchronous callbac
```js
try {
- appAccountManager.verifyCredential("zhangsan", "com.example.accountjsdemo", {
+ appAccountManager.verifyCredential('zhangsan', 'com.example.accountjsdemo', {
onResult: (resultCode, result) => {
- console.log("verifyCredential onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("verifyCredential onResult, result:" + JSON.stringify(result));
+ console.log('verifyCredential onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('verifyCredential onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("verifyCredential onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('verifyCredential onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("verifyCredential err: " + JSON.stringify(err));
+ console.log('verifyCredential err: ' + JSON.stringify(err));
}
```
@@ -2600,21 +2600,21 @@ Verifies the user credential. This API uses an asynchronous callback to return t
```js
let options = {
- credentialType: "pin",
- credential: "123456"
+ credentialType: 'pin',
+ credential: '123456'
};
try {
- appAccountManager.verifyCredential("zhangsan", "com.example.accountjsdemo", options, {
+ appAccountManager.verifyCredential('zhangsan', 'com.example.accountjsdemo', options, {
onResult: (resultCode, result) => {
- console.log("verifyCredential onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("verifyCredential onResult, result:" + JSON.stringify(result));
+ console.log('verifyCredential onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('verifyCredential onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("verifyCredential onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('verifyCredential onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("verifyCredential err: " + JSON.stringify(err));
+ console.log('verifyCredential err: ' + JSON.stringify(err));
}
```
@@ -2647,17 +2647,17 @@ Sets the authenticator attributes of an app. This API uses an asynchronous callb
```js
try {
- appAccountManager.setAuthenticatorProperties("com.example.accountjsdemo", {
+ appAccountManager.setAuthenticatorProperties('com.example.accountjsdemo', {
onResult: (resultCode, result) => {
- console.log("setAuthenticatorProperties onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("setAuthenticatorProperties onResult, result:" + JSON.stringify(result));
+ console.log('setAuthenticatorProperties onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('setAuthenticatorProperties onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("setAuthenticatorProperties onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('setAuthenticatorProperties onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("setAuthenticatorProperties err: " + JSON.stringify(err));
+ console.log('setAuthenticatorProperties err: ' + JSON.stringify(err));
}
```
@@ -2691,20 +2691,20 @@ Set authenticator properties. This API uses an asynchronous callback to return t
```js
let options = {
- properties: {"prop1": "value1"}
+ properties: {'prop1': 'value1'}
};
try {
- appAccountManager.setAuthenticatorProperties("com.example.accountjsdemo", options, {
+ appAccountManager.setAuthenticatorProperties('com.example.accountjsdemo', options, {
onResult: (resultCode, result) => {
- console.log("setAuthenticatorProperties onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("setAuthenticatorProperties onResult, result:" + JSON.stringify(result));
+ console.log('setAuthenticatorProperties onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('setAuthenticatorProperties onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("setAuthenticatorProperties onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('setAuthenticatorProperties onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("setAuthenticatorProperties err: " + JSON.stringify(err));
+ console.log('setAuthenticatorProperties err: ' + JSON.stringify(err));
}
```
@@ -2732,8 +2732,8 @@ Adds an app account. This API uses an asynchronous callback to return the result
**Example**
```js
- appAccountManager.addAccount("WangWu", (err) => {
- console.log("addAccount err: " + JSON.stringify(err));
+ appAccountManager.addAccount('WangWu', (err) => {
+ console.log('addAccount err: ' + JSON.stringify(err));
});
```
@@ -2744,7 +2744,6 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>)
Adds an app account name and additional information. This API uses an asynchronous callback to return the result.
> **NOTE**
->
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createAccount](#createaccount9-1).
**System capability**: SystemCapability.Account.AppAccount
@@ -2760,8 +2759,8 @@ Adds an app account name and additional information. This API uses an asynchrono
**Example**
```js
- appAccountManager.addAccount("LiSi", "token101", (err) => {
- console.log("addAccount err: " + JSON.stringify(err));
+ appAccountManager.addAccount('LiSi', 'token101', (err) => {
+ console.log('addAccount err: ' + JSON.stringify(err));
});
```
@@ -2771,8 +2770,7 @@ addAccount(name: string, extraInfo?: string): Promise<void>
Adds an app account name and additional information. This API uses an asynchronous callback to return the result. This API uses a promise to return the result.
-> **NOTE**
->
+> **NOTE**
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createAccount](#createaccount9-2).
**System capability**: SystemCapability.Account.AppAccount
@@ -2782,7 +2780,7 @@ Adds an app account name and additional information. This API uses an asynchrono
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------------------------------- |
| name | string | Yes | Name of the target app account. |
-| extraInfo | string | No | Additional information (information that can be converted to the string type). It cannot contain sensitive information, such as the app account password and token.|
+| extraInfo | string | No | Additional information (information that can be converted to the string type).
The additional information cannot be sensitive information (such as the password and token) of the app account.
By default, no value is passed, which means no additional information needs to be added for the account.|
**Return value**
@@ -2793,10 +2791,10 @@ Adds an app account name and additional information. This API uses an asynchrono
**Example**
```js
- appAccountManager.addAccount("LiSi", "token101").then(()=> {
+ appAccountManager.addAccount('LiSi', 'token101').then(()=> {
console.log('addAccount Success');
}).catch((err) => {
- console.log("addAccount err: " + JSON.stringify(err));
+ console.log('addAccount err: ' + JSON.stringify(err));
});
```
@@ -2827,8 +2825,8 @@ Adds an app account implicitly based on the specified owner. This API uses an as
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -2839,13 +2837,13 @@ Adds an app account implicitly based on the specified owner. This API uses an as
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
- appAccountManager.addAccountImplicitly("com.example.accountjsdemo", "getSocialData", {}, {
+ appAccountManager.addAccountImplicitly('com.example.accountjsdemo', 'getSocialData', {}, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
@@ -2873,8 +2871,8 @@ Deletes an app account. This API uses an asynchronous callback to return the res
**Example**
```js
- appAccountManager.deleteAccount("ZhaoLiu", (err) => {
- console.log("deleteAccount err: " + JSON.stringify(err));
+ appAccountManager.deleteAccount('ZhaoLiu', (err) => {
+ console.log('deleteAccount err: ' + JSON.stringify(err));
});
```
@@ -2905,10 +2903,10 @@ Deletes an app account. This API uses a promise to return the result.
**Example**
```js
- appAccountManager.deleteAccount("ZhaoLiu").then(() => {
+ appAccountManager.deleteAccount('ZhaoLiu').then(() => {
console.log('deleteAccount Success');
}).catch((err) => {
- console.log("deleteAccount err: " + JSON.stringify(err));
+ console.log('deleteAccount err: ' + JSON.stringify(err));
});
```
### disableAppAccess(deprecated)
@@ -2934,8 +2932,8 @@ Disables an app account from accessing an app. This API uses an asynchronous cal
**Example**
```js
- appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => {
- console.log("disableAppAccess err: " + JSON.stringify(err));
+ appAccountManager.disableAppAccess('ZhangSan', 'com.example.accountjsdemo', (err) => {
+ console.log('disableAppAccess err: ' + JSON.stringify(err));
});
```
@@ -2967,10 +2965,10 @@ Disables an app account from accessing an app. This API uses a promise to return
**Example**
```js
- appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => {
+ appAccountManager.disableAppAccess('ZhangSan', 'com.example.accountjsdemo').then(() => {
console.log('disableAppAccess Success');
}).catch((err) => {
- console.log("disableAppAccess err: " + JSON.stringify(err));
+ console.log('disableAppAccess err: ' + JSON.stringify(err));
});
```
@@ -2997,8 +2995,8 @@ Enables an app account to access an app. This API uses an asynchronous callback
**Example**
```js
- appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => {
- console.log("enableAppAccess: " + JSON.stringify(err));
+ appAccountManager.enableAppAccess('ZhangSan', 'com.example.accountjsdemo', (err) => {
+ console.log('enableAppAccess: ' + JSON.stringify(err));
});
```
@@ -3030,10 +3028,10 @@ Enables an app account to access an app. This API uses a promise to return the r
**Example**
```js
- appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => {
+ appAccountManager.enableAppAccess('ZhangSan', 'com.example.accountjsdemo').then(() => {
console.log('enableAppAccess Success');
}).catch((err) => {
- console.log("enableAppAccess err: " + JSON.stringify(err));
+ console.log('enableAppAccess err: ' + JSON.stringify(err));
});
```
@@ -3061,8 +3059,8 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- appAccountManager.checkAppAccountSyncEnable("ZhangSan", (err, result) => {
- console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err));
+ appAccountManager.checkAppAccountSyncEnable('ZhangSan', (err, result) => {
+ console.log('checkAppAccountSyncEnable err: ' + JSON.stringify(err));
console.log('checkAppAccountSyncEnable result: ' + result);
});
```
@@ -3096,10 +3094,10 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- appAccountManager.checkAppAccountSyncEnable("ZhangSan").then((data) => {
+ appAccountManager.checkAppAccountSyncEnable('ZhangSan').then((data) => {
console.log('checkAppAccountSyncEnable, result: ' + data);
}).catch((err) => {
- console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err));
+ console.log('checkAppAccountSyncEnable err: ' + JSON.stringify(err));
});
```
@@ -3127,8 +3125,8 @@ Set credentials for an app account. This API uses an asynchronous callback to re
**Example**
```js
- appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001", (err) => {
- console.log("setAccountCredential err: " + JSON.stringify(err));
+ appAccountManager.setAccountCredential('ZhangSan', 'credentialType001', 'credential001', (err) => {
+ console.log('setAccountCredential err: ' + JSON.stringify(err));
});
```
@@ -3161,10 +3159,10 @@ Set credentials for an app account. This API uses a promise to return the result
**Example**
```js
- appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001").then(() => {
+ appAccountManager.setAccountCredential('ZhangSan', 'credentialType001', 'credential001').then(() => {
console.log('setAccountCredential Success');
}).catch((err) => {
- console.log("setAccountCredential err: " + JSON.stringify(err));
+ console.log('setAccountCredential err: ' + JSON.stringify(err));
});
```
@@ -3192,8 +3190,8 @@ Sets additional information for an app account. This API uses an asynchronous ca
**Example**
```js
- appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002", (err) => {
- console.log("setAccountExtraInfo err: " + JSON.stringify(err));
+ appAccountManager.setAccountExtraInfo('ZhangSan', 'Tk002', (err) => {
+ console.log('setAccountExtraInfo err: ' + JSON.stringify(err));
});
```
@@ -3226,10 +3224,10 @@ Sets additional information for an app account. This API uses a promise to retur
**Example**
```js
- appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002").then(() => {
+ appAccountManager.setAccountExtraInfo('ZhangSan', 'Tk002').then(() => {
console.log('setAccountExtraInfo Success');
}).catch((err) => {
- console.log("setAccountExtraInfo err: " + JSON.stringify(err));
+ console.log('setAccountExtraInfo err: ' + JSON.stringify(err));
});
```
@@ -3258,8 +3256,8 @@ Sets data synchronization for an app account. This API uses an asynchronous call
**Example**
```js
- appAccountManager.setAppAccountSyncEnable("ZhangSan", true, (err) => {
- console.log("setAppAccountSyncEnable err: " + JSON.stringify(err));
+ appAccountManager.setAppAccountSyncEnable('ZhangSan', true, (err) => {
+ console.log('setAppAccountSyncEnable err: ' + JSON.stringify(err));
});
```
@@ -3293,10 +3291,10 @@ Sets data synchronization for an app account. This API uses a promise to return
**Example**
```js
- appAccountManager .setAppAccountSyncEnable("ZhangSan", true).then(() => {
+ appAccountManager .setAppAccountSyncEnable('ZhangSan', true).then(() => {
console.log('setAppAccountSyncEnable Success');
}).catch((err) => {
- console.log("setAppAccountSyncEnable err: " + JSON.stringify(err));
+ console.log('setAppAccountSyncEnable err: ' + JSON.stringify(err));
});
```
@@ -3325,8 +3323,8 @@ Sets data to be associated with an app account. This API uses an asynchronous ca
**Example**
```js
- appAccountManager.setAssociatedData("ZhangSan", "k001", "v001", (err) => {
- console.log("setAssociatedData err: " + JSON.stringify(err));
+ appAccountManager.setAssociatedData('ZhangSan', 'k001', 'v001', (err) => {
+ console.log('setAssociatedData err: ' + JSON.stringify(err));
});
```
@@ -3360,10 +3358,10 @@ Sets data to be associated with an app account. This API uses a promise to retur
**Example**
```js
- appAccountManager.setAssociatedData("ZhangSan", "k001", "v001").then(() => {
+ appAccountManager.setAssociatedData('ZhangSan', 'k001', 'v001').then(() => {
console.log('setAssociatedData Success');
}).catch((err) => {
- console.log("setAssociatedData err: " + JSON.stringify(err));
+ console.log('setAssociatedData err: ' + JSON.stringify(err));
});
```
@@ -3391,8 +3389,8 @@ Obtains information about all accessible app accounts. This API uses an asynchro
```js
appAccountManager.getAllAccessibleAccounts((err, data)=>{
- console.debug("getAllAccessibleAccounts err:" + JSON.stringify(err));
- console.debug("getAllAccessibleAccounts data:" + JSON.stringify(data));
+ console.debug('getAllAccessibleAccounts err: ' + JSON.stringify(err));
+ console.debug('getAllAccessibleAccounts data: ' + JSON.stringify(data));
});
```
@@ -3422,7 +3420,7 @@ Obtains information about all accessible app accounts. This API uses a promise t
appAccountManager.getAllAccessibleAccounts().then((data) => {
console.log('getAllAccessibleAccounts: ' + data);
}).catch((err) => {
- console.log("getAllAccessibleAccounts err: " + JSON.stringify(err));
+ console.log('getAllAccessibleAccounts err: ' + JSON.stringify(err));
});
```
@@ -3450,10 +3448,10 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- const selfBundle = "com.example.actsgetallaaccounts";
+ const selfBundle = 'com.example.actsgetallaaccounts';
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
- console.debug("getAllAccounts err:" + JSON.stringify(err));
- console.debug("getAllAccounts data:" + JSON.stringify(data));
+ console.debug('getAllAccounts err: ' + JSON.stringify(err));
+ console.debug('getAllAccounts data:' + JSON.stringify(data));
});
```
@@ -3486,11 +3484,11 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- const selfBundle = "com.example.actsgetallaaccounts";
+ const selfBundle = 'com.example.actsgetallaaccounts';
appAccountManager.getAllAccounts(selfBundle).then((data) => {
console.log('getAllAccounts: ' + data);
}).catch((err) => {
- console.log("getAllAccounts err: " + JSON.stringify(err));
+ console.log('getAllAccounts err: ' + JSON.stringify(err));
});
```
@@ -3517,8 +3515,8 @@ Obtains the credential of an app account. This API uses an asynchronous callback
**Example**
```js
- appAccountManager.getAccountCredential("ZhangSan", "credentialType001", (err, result) => {
- console.log("getAccountCredential err: " + JSON.stringify(err));
+ appAccountManager.getAccountCredential('ZhangSan', 'credentialType001', (err, result) => {
+ console.log('getAccountCredential err: ' + JSON.stringify(err));
console.log('getAccountCredential result: ' + result);
});
```
@@ -3551,10 +3549,10 @@ Obtains the credential of an app account. This API uses a promise to return the
**Example**
```js
- appAccountManager.getAccountCredential("ZhangSan", "credentialType001").then((data) => {
+ appAccountManager.getAccountCredential('ZhangSan', 'credentialType001').then((data) => {
console.log('getAccountCredential, result: ' + data);
}).catch((err) => {
- console.log("getAccountCredential err: " + JSON.stringify(err));
+ console.log('getAccountCredential err: ' + JSON.stringify(err));
});
```
@@ -3580,8 +3578,8 @@ Obtains additional information of an app account. Additional information refers
**Example**
```js
- appAccountManager.getAccountExtraInfo("ZhangSan", (err, result) => {
- console.log("getAccountExtraInfo err: " + JSON.stringify(err));
+ appAccountManager.getAccountExtraInfo('ZhangSan', (err, result) => {
+ console.log('getAccountExtraInfo err: ' + JSON.stringify(err));
console.log('getAccountExtraInfo result: ' + result);
});
```
@@ -3613,10 +3611,10 @@ Obtains additional information of an app account. Additional information refers
**Example**
```js
- appAccountManager.getAccountExtraInfo("ZhangSan").then((data) => {
+ appAccountManager.getAccountExtraInfo('ZhangSan').then((data) => {
console.log('getAccountExtraInfo, result: ' + data);
}).catch((err) => {
- console.log("getAccountExtraInfo err: " + JSON.stringify(err));
+ console.log('getAccountExtraInfo err: ' + JSON.stringify(err));
});
```
@@ -3643,8 +3641,8 @@ Obtains data associated with an app account. This API uses an asynchronous callb
**Example**
```js
- appAccountManager.getAssociatedData("ZhangSan", "k001", (err, result) => {
- console.log("getAssociatedData err: " + JSON.stringify(err));
+ appAccountManager.getAssociatedData('ZhangSan', 'k001', (err, result) => {
+ console.log('getAssociatedData err: ' + JSON.stringify(err));
console.log('getAssociatedData result: ' + result);
});
```
@@ -3677,10 +3675,10 @@ Obtains data associated with an app account. This API uses a promise to return t
**Example**
```js
- appAccountManager.getAssociatedData("ZhangSan", "k001").then((data) => {
+ appAccountManager.getAssociatedData('ZhangSan', 'k001').then((data) => {
console.log('getAssociatedData: ' + data);
}).catch((err) => {
- console.log("getAssociatedData err: " + JSON.stringify(err));
+ console.log('getAssociatedData err: ' + JSON.stringify(err));
});
```
@@ -3702,19 +3700,19 @@ Subscribes to account information changes of apps.
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | 'change' | Yes | Event type to subscribe to. The value is **'change'**. An event will be reported when the account information changes.|
| owners | Array<string> | Yes | App bundle names of the account. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return the account changes. |
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback registered to return the list of changed app accounts. |
**Example**
```js
function changeOnCallback(data){
- console.debug("receive change data:" + JSON.stringify(data));
+ console.debug('receive change data:' + JSON.stringify(data));
}
try{
- appAccountManager.on('change', ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('change', ['com.example.actsaccounttest'], changeOnCallback);
}
catch(err){
- console.error("on accountOnOffDemo err:" + JSON.stringify(err));
+ console.error('on accountOnOffDemo err:' + JSON.stringify(err));
}
```
@@ -3735,22 +3733,22 @@ Unsubscribes from account information changes.
| Name | Type | Mandatory | Description |
| -------- | -------------------------------- | ---- | ------------ |
| type | 'change' | Yes | Event type to unsubscribe from. The value is **'change'**, which indicates the account change event. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister.|
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister. By default, no value is passed, which means to unregister all callbacks for the specified event.|
**Example**
```js
function changeOnCallback(data){
- console.debug("receive change data:" + JSON.stringify(data));
+ console.debug('receive change data: ' + JSON.stringify(data));
appAccountManager.off('change', function(){
- console.debug("off finish");
+ console.debug('off finish');
})
}
try{
- appAccountManager.on('change', ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('change', ['com.example.actsaccounttest'], changeOnCallback);
}
catch(err){
- console.error("on accountOnOffDemo err:" + JSON.stringify(err));
+ console.error('on accountOnOffDemo err: ' + JSON.stringify(err));
}
```
@@ -3780,8 +3778,8 @@ Authenticates an app account with customized options. This API uses an asynchron
```js
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -3792,13 +3790,13 @@ Authenticates an app account with customized options. This API uses an asynchron
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
- appAccountManager.authenticate("LiSi", "com.example.accountjsdemo", "getSocialData", {}, {
+ appAccountManager.authenticate('LiSi', 'com.example.accountjsdemo', 'getSocialData', {}, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
@@ -3828,7 +3826,7 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, data) => {
+ appAccountManager.getOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', (err, data) => {
console.log('getOAuthToken err: ' + JSON.stringify(err));
console.log('getOAuthToken token: ' + data);
});
@@ -3863,10 +3861,10 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((data) => {
+ appAccountManager.getOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData').then((data) => {
console.log('getOAuthToken token: ' + data);
}).catch((err) => {
- console.log("getOAuthToken err: " + JSON.stringify(err));
+ console.log('getOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -3894,7 +3892,7 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx", (err) => {
+ appAccountManager.setOAuthToken('LiSi', 'getSocialData', 'xxxx', (err) => {
console.log('setOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -3928,7 +3926,7 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx").then(() => {
+ appAccountManager.setOAuthToken('LiSi', 'getSocialData', 'xxxx').then(() => {
console.log('setOAuthToken successfully');
}).catch((err) => {
console.log('setOAuthToken err: ' + JSON.stringify(err));
@@ -3960,7 +3958,7 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => {
+ appAccountManager.deleteOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx', (err) => {
console.log('deleteOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -3995,10 +3993,10 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => {
+ appAccountManager.deleteOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx').then(() => {
console.log('deleteOAuthToken successfully');
}).catch((err) => {
- console.log("deleteOAuthToken err: " + JSON.stringify(err));
+ console.log('deleteOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -4027,7 +4025,7 @@ Sets the visibility of an authorization token to an app. This API uses an asynch
**Example**
```js
- appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => {
+ appAccountManager.setOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true, (err) => {
console.log('setOAuthTokenVisibility err: ' + JSON.stringify(err));
});
```
@@ -4062,7 +4060,7 @@ Sets the visibility of an authorization token to an app. This API uses a promise
**Example**
```js
- appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => {
+ appAccountManager.setOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true).then(() => {
console.log('setOAuthTokenVisibility successfully');
}).catch((err) => {
console.log('setOAuthTokenVisibility err: ' + JSON.stringify(err));
@@ -4093,7 +4091,7 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, data) => {
+ appAccountManager.checkOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', (err, data) => {
console.log('checkOAuthTokenVisibility err: ' + JSON.stringify(err));
console.log('checkOAuthTokenVisibility isVisible: ' + data);
});
@@ -4128,7 +4126,7 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((data) => {
+ appAccountManager.checkOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo').then((data) => {
console.log('checkOAuthTokenVisibility isVisible: ' + data);
}).catch((err) => {
console.log('checkOAuthTokenVisibility err: ' + JSON.stringify(err));
@@ -4158,8 +4156,8 @@ Obtains all tokens visible to the invoker for an app account. This API uses an a
**Example**
```js
- appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo", (err, data) => {
- console.log("getAllOAuthTokens err: " + JSON.stringify(err));
+ appAccountManager.getAllOAuthTokens('LiSi', 'com.example.accountjsdemo', (err, data) => {
+ console.log('getAllOAuthTokens err: ' + JSON.stringify(err));
console.log('getAllOAuthTokens data: ' + JSON.stringify(data));
});
```
@@ -4192,10 +4190,10 @@ Obtains all tokens visible to the invoker for an app account. This API uses a pr
**Example**
```js
- appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo").then((data) => {
+ appAccountManager.getAllOAuthTokens('LiSi', 'com.example.accountjsdemo').then((data) => {
console.log('getAllOAuthTokens data: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getAllOAuthTokens err: " + JSON.stringify(err));
+ console.log('getAllOAuthTokens err: ' + JSON.stringify(err));
});
```
@@ -4222,7 +4220,7 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData", (err, data) => {
+ appAccountManager.getOAuthList('LiSi', 'getSocialData', (err, data) => {
console.log('getOAuthList err: ' + JSON.stringify(err));
console.log('getOAuthList data: ' + JSON.stringify(data));
});
@@ -4256,10 +4254,10 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData").then((data) => {
+ appAccountManager.getOAuthList('LiSi', 'getSocialData').then((data) => {
console.log('getOAuthList data: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getOAuthList err: " + JSON.stringify(err));
+ console.log('getOAuthList err: ' + JSON.stringify(err));
});
```
@@ -4292,13 +4290,13 @@ Obtains the authenticator callback for an authentication session. This API uses
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
appAccountManager.getAuthenticatorCallback(sessionId, (err, callback) => {
if (err.code != account_appAccount.ResultCode.SUCCESS) {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
return;
}
- var result = {[account_appAccount.Constants.KEY_NAME]: "LiSi",
- [account_appAccount.Constants.KEY_OWNER]: "com.example.accountjsdemo",
- [account_appAccount.Constants.KEY_AUTH_TYPE]: "getSocialData",
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ var result = {[account_appAccount.Constants.KEY_NAME]: 'LiSi',
+ [account_appAccount.Constants.KEY_OWNER]: 'com.example.accountjsdemo',
+ [account_appAccount.Constants.KEY_AUTH_TYPE]: 'getSocialData',
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
});
}
@@ -4338,13 +4336,13 @@ Obtains the authenticator callback for an authentication session. This API uses
onCreate(want, param) {
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
- var result = {[account_appAccount.Constants.KEY_NAME]: "LiSi",
- [account_appAccount.Constants.KEY_OWNER]: "com.example.accountjsdemo",
- [account_appAccount.Constants.KEY_AUTH_TYPE]: "getSocialData",
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ var result = {[account_appAccount.Constants.KEY_NAME]: 'LiSi',
+ [account_appAccount.Constants.KEY_OWNER]: 'com.example.accountjsdemo',
+ [account_appAccount.Constants.KEY_AUTH_TYPE]: 'getSocialData',
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}).catch((err) => {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
});
}
}
@@ -4372,8 +4370,8 @@ Obtains the authenticator information of an app. This API uses an asynchronous c
**Example**
```js
- appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo", (err, data) => {
- console.log("getAuthenticatorInfo err: " + JSON.stringify(err));
+ appAccountManager.getAuthenticatorInfo('com.example.accountjsdemo', (err, data) => {
+ console.log('getAuthenticatorInfo err: ' + JSON.stringify(err));
console.log('getAuthenticatorInfo data: ' + JSON.stringify(data));
});
```
@@ -4405,10 +4403,10 @@ Obtains the authenticator information of an app. This API uses a promise to retu
**Example**
```js
- appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo").then((data) => {
+ appAccountManager.getAuthenticatorInfo('com.example.accountjsdemo').then((data) => {
console.log('getAuthenticatorInfo: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getAuthenticatorInfo err: " + JSON.stringify(err));
+ console.log('getAuthenticatorInfo err: ' + JSON.stringify(err));
});
```
@@ -4433,7 +4431,7 @@ Defines authorization token information.
| -------------------- | -------------- | ----- | ---------------- |
| authType9+ | string | Yes | Authentication type. |
| token9+ | string | Yes | Value of the authorization token. |
-| account9+ | [AppAccountInfo](#appaccountinfo) | No | Account information of the authorization token.|
+| account9+ | [AppAccountInfo](#appaccountinfo) | No | Information about the account to which the token belongs. By default, no value is passed.|
## OAuthTokenInfo(deprecated)
@@ -4449,7 +4447,7 @@ Defines authorization token information.
| -------------------- | -------------- | ----- | ---------------- |
| authType | string | Yes | Authentication type. |
| token | string | Yes | Value of the authorization token. |
-| account9+ | [AppAccountInfo](#appaccountinfo) | No | Account information of the authorization token.|
+| account9+ | [AppAccountInfo](#appaccountinfo) | No | Information about the account to which the token belongs. By default, no value is passed.|
## AuthenticatorInfo8+
@@ -4471,8 +4469,8 @@ Defines the authentication result.
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------- |
-| account | [AppAccountInfo](#appaccountinfo) | No | Account information of the authorization token.|
-| tokenInfo | [AuthTokenInfo](#authtokeninfo9) | No | Token information. |
+| account | [AppAccountInfo](#appaccountinfo) | No | Information about the account to which the token belongs. By default, no value is passed.|
+| tokenInfo | [AuthTokenInfo](#authtokeninfo9) | No | Token information. By default, no value is passed. |
## CreateAccountOptions9+
@@ -4482,7 +4480,7 @@ Defines the options for creating an app account.
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------- |
-| customData | {[key: string]: string} | No | Custom data.|
+| customData | {[key: string]: string} | No | Custom data. By default, no value is passed.|
## CreateAccountImplicitlyOptions9+
@@ -4492,9 +4490,9 @@ Defines the options for implicitly creating an app account.
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------- |
-| requiredLabels | Array<string> | No | Labels required.|
-| authType | string | No | Authentication type.|
-| parameters | {[key: string]: Object} | No | Customized parameters.|
+| requiredLabels | Array<string> | No | Required labels. By default, no value is passed.|
+| authType | string | No | Authentication type. By default, no value is passed.|
+| parameters | {[key: string]: Object} | No | Custom parameter object. By default, no value is passed.|
## SelectAccountsOptions9+
Defines the options for selecting accounts.
@@ -4503,9 +4501,9 @@ Defines the options for selecting accounts.
| Name | Type | Mandatory | Description |
| --------------- | --------------------------- | ----- | ------------------- |
-| allowedAccounts | Array<[AppAccountInfo](#appaccountinfo)> | No | Allowed accounts. |
-| allowedOwners | Array<string> | No | Allowed account owners.|
-| requiredLabels | Array<string> | No | Labels required for the authenticator. |
+| allowedAccounts | Array<[AppAccountInfo](#appaccountinfo)> | No | Array of allowed accounts. By default, no value is passed. |
+| allowedOwners | Array<string> | No | Array of the owners of the allowed accounts. By default, no value is passed.|
+| requiredLabels | Array<string> | No | Labels of the authenticator. By default, no value is passed. |
## VerifyCredentialOptions9+
@@ -4515,9 +4513,9 @@ Represents the options for verifying the user credential.
| Name | Type | Mandatory | Description |
| -------------- | ---------------------- | ----- | -------------- |
-| credentialType | string | No | Type of the credential to verify. |
-| credential | string | No | Credential value. |
-| parameters | {[key: string]: Object} | No | Customized parameters.|
+| credentialType | string | No | Credential type. By default, no value is passed. |
+| credential | string | No | Credential value. By default, no value is passed. |
+| parameters | {[key: string]: Object} | No | Custom parameter object. By default, no value is passed.|
## SetPropertiesOptions9+
@@ -4528,8 +4526,8 @@ Represents the options for setting authenticator properties.
| Name | Type | Mandatory | Description |
| ---------- | ---------------------- | ----- | -------------- |
-| properties | {[key: string]: Object} | No | Authenticator properties. |
-| parameters | {[key: string]: Object} | No | Customized parameters.|
+| properties | {[key: string]: Object} | No | Property object. By default, no value is passed. |
+| parameters | {[key: string]: Object} | No | Custom parameter object. By default, no value is passed.|
## Constants8+
@@ -4539,23 +4537,23 @@ Enumerates the constants.
| Name | Value | Description |
| -------------------------------- | ---------------------- | ----------------------- |
-| ACTION_ADD_ACCOUNT_IMPLICITLY(deprecated) | "addAccountImplicitly" | Operation of adding an account implicitly. |
-| ACTION_AUTHENTICATE(deprecated) | "authenticate" | Authentication operation. |
-| ACTION_CREATE_ACCOUNT_IMPLICITLY9+ | "createAccountImplicitly" | Operation of creating an account implicitly. |
-| ACTION_AUTH9+ | "auth" | Authentication operation. |
-| ACTION_VERIFY_CREDENTIAL9+ | "verifyCredential" | Operation of verifying credentials. |
-| ACTION_SET_AUTHENTICATOR_PROPERTIES9+ | "setAuthenticatorProperties" | Operation of setting authenticator properties. |
-| KEY_NAME | "name" | Name of the app account. |
-| KEY_OWNER | "owner" | Owner of the app account.|
-| KEY_TOKEN | "token" | Token. |
-| KEY_ACTION | "action" | Operation. |
-| KEY_AUTH_TYPE | "authType" | Authentication type. |
-| KEY_SESSION_ID | "sessionId" | Session ID. |
-| KEY_CALLER_PID | "callerPid" | PID of the caller. |
-| KEY_CALLER_UID | "callerUid" | UID of the caller. |
-| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Bundle name of the caller. |
-| KEY_REQUIRED_LABELS9+ | "requiredLabels" | Required labels. |
-| KEY_BOOLEAN_RESULT9+ | "booleanResult" | Return value of the Boolean type. |
+| ACTION_ADD_ACCOUNT_IMPLICITLY(deprecated) | 'addAccountImplicitly' | Operation of adding an account implicitly. |
+| ACTION_AUTHENTICATE(deprecated) | 'authenticate' | Authentication operation. |
+| ACTION_CREATE_ACCOUNT_IMPLICITLY9+ | 'createAccountImplicitly' | Operation of creating an account implicitly. |
+| ACTION_AUTH9+ | 'auth' | Authentication operation. |
+| ACTION_VERIFY_CREDENTIAL9+ | 'verifyCredential' | Operation of verifying credentials. |
+| ACTION_SET_AUTHENTICATOR_PROPERTIES9+ | 'setAuthenticatorProperties' | Operation of setting authenticator properties. |
+| KEY_NAME | 'name' | Name of the app account. |
+| KEY_OWNER | 'owner' | Owner of the app account.|
+| KEY_TOKEN | 'token' | Token. |
+| KEY_ACTION | 'action' | Operation. |
+| KEY_AUTH_TYPE | 'authType' | Authentication type. |
+| KEY_SESSION_ID | 'sessionId' | Session ID. |
+| KEY_CALLER_PID | 'callerPid' | PID of the caller. |
+| KEY_CALLER_UID | 'callerUid' | UID of the caller. |
+| KEY_CALLER_BUNDLE_NAME | 'callerBundleName' | Bundle name of the caller. |
+| KEY_REQUIRED_LABELS9+ | 'requiredLabels' | Required labels. |
+| KEY_BOOLEAN_RESULT9+ | 'booleanResult' | Return value of the Boolean type. |
## ResultCode(deprecated)
@@ -4606,27 +4604,27 @@ Called to return the result of an authentication request.
| Name | Type | Mandatory | Description |
| ------ | -------------------- | ---- | ------ |
| code | number | Yes | Authentication result code.|
-| result | [AuthResult](#authresult9) | No | Authentication result. |
+| result | [AuthResult](#authresult9) | No | Authentication result. By default, no value is passed, which means the authentication result is not received. |
**Example**
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthCallback(sessionId).then((callback) => {
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}).catch((err) => {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
});
```
@@ -4650,20 +4648,20 @@ Called to redirect a request.
class MyAuthenticator extends account_appAccount.Authenticator {
createAccountImplicitly(options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.LoginAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.LoginAbility',
});
}
auth(name, authType, options, callback) {
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
@@ -4683,11 +4681,11 @@ Called to continue to process the request.
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthCallback(sessionId).then((callback) => {
callback.onRequestContinued();
}).catch((err) => {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
});
```
@@ -4718,15 +4716,15 @@ Called to return the result of an authentication request.
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
- var result = {[account_appAccount.Constants.KEY_NAME]: "LiSi",
- [account_appAccount.Constants.KEY_OWNER]: "com.example.accountjsdemo",
- [account_appAccount.Constants.KEY_AUTH_TYPE]: "getSocialData",
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ var result = {[account_appAccount.Constants.KEY_NAME]: 'LiSi',
+ [account_appAccount.Constants.KEY_OWNER]: 'com.example.accountjsdemo',
+ [account_appAccount.Constants.KEY_AUTH_TYPE]: 'getSocialData',
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}).catch((err) => {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
});
```
@@ -4750,15 +4748,15 @@ Called to redirect a request.
class MyAuthenticator extends account_appAccount.Authenticator {
addAccountImplicitly(authType, callerBundleName, options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.LoginAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.LoginAbility',
});
}
authenticate(name, authType, callerBundleName, options, callback) {
var result = {[account_appAccount.Constants.KEY_NAME]: name,
[account_appAccount.Constants.KEY_AUTH_TYPE]: authType,
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}
}
@@ -4776,11 +4774,11 @@ Called to continue to process the request.
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
callback.onRequestContinued();
}).catch((err) => {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
});
```
@@ -4940,22 +4938,22 @@ Obtains the remote object of an authenticator. This API cannot be overloaded.
class MyAuthenticator extends account_appAccount.Authenticator {
addAccountImplicitly(authType, callerBundleName, options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.LoginAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.LoginAbility',
});
}
authenticate(name, authType, callerBundleName, options, callback) {
var result = {[account_appAccount.Constants.KEY_NAME]: name,
[account_appAccount.Constants.KEY_AUTH_TYPE]: authType,
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}
verifyCredential(name, options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.VerifyAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.VerifyAbility',
parameters: {
name: name
}
diff --git a/en/application-dev/reference/apis/js-apis-cardEmulation.md b/en/application-dev/reference/apis/js-apis-cardEmulation.md
index cc57a0a73d463949911f3a8ff7c501a775ca300f..946ebd2f881fe66a7ec6b0afc8e308d254a6f68c 100644
--- a/en/application-dev/reference/apis/js-apis-cardEmulation.md
+++ b/en/application-dev/reference/apis/js-apis-cardEmulation.md
@@ -17,16 +17,15 @@ import cardEmulation from '@ohos.nfc.cardEmulation';
Enumerates the NFC card emulation types.
> **NOTE**
->
> This parameter is supported since API version 6 and deprecated since API version 9. You are advised to use [hasHceCapability](#hashcecapability9).
**System capability**: SystemCapability.Communication.NFC.CardEmulation
-| Name| Value| Description|
-| -------- | -------- | -------- |
-| HCE | 0 | HCE.|
-| UICC | 1 | Subscriber identity module (SIM) card emulation.|
-| ESE | 2 | embedded Secure Element (eSE) emulation.|
+| Name | Value | Description |
+| ---- | ---- | -------- |
+| HCE | 0 | HCE.|
+| UICC | 1 | Subscriber identity module (SIM) card emulation.|
+| ESE | 2 | embedded Secure Element (eSE) emulation. |
## CardType9+
@@ -34,10 +33,10 @@ Enumerates the types of services used by the card emulation application.
**System capability**: SystemCapability.Communication.NFC.CardEmulation
-| Name| Value| Description|
-| -------- | -------- | -------- |
+| Name | Value | Description |
+| ------- | --------- | ----------------- |
| PAYMENT | "payment" | Payment type.|
-| OTHER | "other" | Other types.|
+| OTHER | "other" | Other types.|
## isSupported
@@ -46,21 +45,20 @@ isSupported(feature: number): boolean
Checks whether a certain type of card emulation is supported.
> **NOTE**
->
> This parameter is supported since API version 6 and deprecated since API version 9. You are advised to use [hasHceCapability](#hashcecapability9).
**System capability**: SystemCapability.Communication.NFC.CardEmulation
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------- | -------- | ---- | ----------------------- |
-| feature | number | Yes | Card emulation type. For details, see [FeatureType](#featuretype).|
+| Name | Type | Mandatory | Description |
+| ------- | ------ | ---- | ---------------------------------------- |
+| feature | number | Yes | Card emulation type. For details, see [FeatureType](#featuretype).|
**Return value**
-| **Type**| **Description**|
-| -------- | -------- |
+| **Type** | **Description** |
+| ------- | -------------------------------------- |
| boolean | Returns **true** if the card emulation type is supported; returns **false** otherwise.|
## hasHceCapability9+
@@ -75,8 +73,8 @@ Checks whether HCE is supported.
**Return value**
-| **Type**| **Description**|
-| -------- | -------- |
+| **Type** | **Description** |
+| ------- | -------------------------------- |
| boolean | Returns **true** if HCE is supported; returns **false** otherwise.|
## isDefaultService9+
@@ -91,15 +89,15 @@ Checks whether an application is the default application of the specified servic
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------- | -------- | ---- | ----------------------- |
-| elementName | [ElementName](js-apis-bundleManager-elementName.md#elementname) | Yes| Application description, which consists of the bundle name and component name.|
-| type | [CardType](#cardtype9) | Yes| Card emulation service type.|
+| Name | Type | Mandatory | Description |
+| ----------- | ---------------------------------------- | ---- | ----------------------- |
+| elementName | [ElementName](js-apis-bundleManager-elementName.md#elementname) | Yes | Application description, which consists of the bundle name and component name.|
+| type | [CardType](#cardtype9) | Yes | Card emulation service type. |
**Return value**
-| **Type**| **Description**|
-| -------- | -------- |
+| **Type** | **Description** |
+| ------- | ------------------------------------ |
| boolean | Returns **true** if the application is the default payment application; returns **false** otherwise.|
**Example**
@@ -110,13 +108,11 @@ import cardEmulation from '@ohos.nfc.cardEmulation';
var isHceSupported = cardEmulation.isSupported(cardEmulation.FeatureType.HCE);
if (!isHceSupported) {
console.log('this device is not supported for HCE, ignore it.');
- return;
}
var hasHceCap = cardEmulation.hasHceCapability();
if (!hasHceCap) {
console.log('this device hasHceCapability false, ignore it.');
- return;
}
var elementName = {
diff --git a/en/application-dev/reference/apis/js-apis-connectedTag.md b/en/application-dev/reference/apis/js-apis-connectedTag.md
index 2764d1ee989e84e66ca6301e97c32a9ec2198c0c..9f8ea1bd9dcf8b2586865648732db2dd367bf20a 100644
--- a/en/application-dev/reference/apis/js-apis-connectedTag.md
+++ b/en/application-dev/reference/apis/js-apis-connectedTag.md
@@ -28,6 +28,23 @@ Initializes the active tag chip.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+## connectedTag.initialize9+
+
+initialize(): void
+
+Initializes the active tag chip.
+
+**Required permissions**: ohos.permission.NFC_TAG
+
+**System capability**: SystemCapability.Communication.ConnectedTag
+
+**Error codes**
+For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
+
+| ID| Error Message|
+| -------- | -------- |
+| 3200101 | Connected NFC tag running state is abnormal in service. |
+
## connectedTag.uninit
uninit(): boolean
@@ -44,6 +61,23 @@ Uninitializes the active tag resources.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+## connectedTag.uninitialize9+
+
+uninitialize(): void
+
+Uninitializes the active tag resources.
+
+**Required permissions**: ohos.permission.NFC_TAG
+
+**System capability**: SystemCapability.Communication.ConnectedTag
+
+**Error codes**
+For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
+
+| ID| Error Message|
+| -------- | -------- |
+| 3200101 | Connected NFC tag running state is abnormal in service. |
+
## connectedTag.readNdefTag
readNdefTag(): Promise<string>
@@ -72,6 +106,41 @@ connectedTag.readNdefTag().then((data) => {
});
```
+## connectedTag.read9+
+
+read(): Promise<number[]>
+
+Reads the content of this active tag. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.NFC_TAG
+
+**System capability**: SystemCapability.Communication.ConnectedTag
+
+**Return value**
+
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<number[]> | Promise used to return the content of the active tag.|
+
+**Error codes**
+For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
+
+| ID| Error Message|
+| -------- | -------- |
+| 3200101 | Connected NFC tag running state is abnormal in service. |
+
+**Example**
+
+```js
+import connectedTag from '@ohos.connectedTag';
+
+connectedTag.read().then((data) => {
+ console.log("connectedTag read Promise data = " + data);
+}).catch((err)=> {
+ console.log("connectedTag read Promise err: " + err);
+});
+```
+
## connectedTag.readNdefTag
readNdefTag(callback: AsyncCallback<string>): void
@@ -102,6 +171,43 @@ connectedTag.readNdefTag((err, data)=> {
});
```
+## connectedTag.read9+
+
+read(callback: AsyncCallback<number[]>): void
+
+Reads the content of this active tag. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.NFC_TAG
+
+**System capability**: SystemCapability.Communication.ConnectedTag
+
+**Parameters**
+
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<number[]> | Yes| Callback invoked to return the active tag content obtained.|
+
+**Error codes**
+For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
+
+| ID| Error Message|
+| -------- | -------- |
+| 3200101 | Connected NFC tag running state is abnormal in service. |
+
+**Example**
+
+```js
+import connectedTag from '@ohos.connectedTag';
+
+connectedTag.read((err, data)=> {
+ if (err) {
+ console.log("connectedTag read AsyncCallback err: " + err);
+ } else {
+ console.log("connectedTag read AsyncCallback data: " + data);
+ }
+});
+```
+
## connectedTag.writeNdefTag
writeNdefTag(data: string): Promise<void>
@@ -137,6 +243,48 @@ connectedTag.writeNdefTag(rawData).then(() => {
});
```
+## connectedTag.write9+
+
+write(data: number[]): Promise<void>
+
+Writes data to this active tag. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.NFC_TAG
+
+**System capability**: SystemCapability.Communication.ConnectedTag
+
+**Parameters**
+
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| data | number[] | Yes| Data to be written to the active tag. The value is a hexadecimal number ranging from 0x00 to 0xFF.|
+
+**Return value**
+
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<void> | Promise that returns no value.|
+
+**Error codes**
+For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
+
+| ID| Error Message|
+| -------- | -------- |
+| 3200101 | Connected NFC tag running state is abnormal in service. |
+
+**Example**
+
+```js
+import connectedTag from '@ohos.connectedTag';
+
+var rawData = [0x01, 0x02, 0x03]; // change it tobe correct.
+connectedTag.write(rawData).then(() => {
+ console.log("connectedTag write NdefTag Promise success.");
+}).catch((err)=> {
+ console.log("connectedTag write NdefTag Promise err: " + err);
+});
+```
+
## connectedTag.writeNdefTag
writeNdefTag(data: string, callback: AsyncCallback<void>): void
@@ -169,6 +317,45 @@ connectedTag.writeNdefTag(rawData, (err)=> {
});
```
+## connectedTag.write9+
+
+write(data: number[], callback: AsyncCallback<void>): void
+
+Writes data to this active tag. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.NFC_TAG
+
+**System capability**: SystemCapability.Communication.ConnectedTag
+
+**Parameters**
+
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| data | number[] | Yes| Data to be written to the active tag. The value is a hexadecimal number ranging from 0x00 to 0xFF.|
+| callback | AsyncCallback<void> | Yes| Callback invoked to return the active tag content obtained.|
+
+**Error codes**
+For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
+
+| ID| Error Message|
+| -------- | -------- |
+| 3200101 | Connected NFC tag running state is abnormal in service. |
+
+**Example**
+
+```js
+import connectedTag from '@ohos.connectedTag';
+
+var rawData = [0x01, 0x02, 0x03]; // change it tobe correct.
+connectedTag.write(rawData, (err)=> {
+ if (err) {
+ console.log("connectedTag write NdefTag AsyncCallback err: " + err);
+ } else {
+ console.log("connectedTag write NdefTag AsyncCallback success.");
+ }
+});
+```
+
## connectedTag.on('notify')
on(type: "notify", callback: Callback<number>): void
diff --git a/en/application-dev/reference/apis/js-apis-data-cloudData.md b/en/application-dev/reference/apis/js-apis-data-cloudData.md
new file mode 100644
index 0000000000000000000000000000000000000000..38c6d65e42ea6c2665f33812d94b7093432af401
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-data-cloudData.md
@@ -0,0 +1,348 @@
+# @ohos.data.cloudData (Device-Cloud Synergy)
+
+The **cloudData** module provides the capability of synchronizing the structured data (in RDB stores) between the device and cloud. The cloud serves as the central node of data. The devices synchronize data with the data in the cloud to implement cloud data backup and data consistency between the devices with the same account.
+
+This module provides the following common functions:
+
+- [Config](#config): provides methods for configuring device-cloud synergy, including enabling and disabling cloud synchronization, clearing data, and notifying data changes.
+
+> **NOTE**
+>
+> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import cloudData from '@ohos.data.cloudData';
+```
+
+## Action
+
+Enumerates the actions for clearing the cloud information about the local data.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+| Name | Description |
+| --------- | ---------------------------- |
+| CLEAR_CLOUD_INFO | Clear the cloud ID information.|
+| CLEAR_CLOUD_DATA_AND_INFO |Clear all cloud data, including cloud ID information and data downloaded from the cloud (excluding the data modified or generated locally). |
+
+## Config
+
+Provides methods for configuring device-cloud synergy, including enabling and disabling cloud synchronization, clearing data, and notifying data changes.
+
+### enableCloud
+
+static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}, callback: AsyncCallback<void>):void
+
+Enables device-cloud synergy. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
+| accountId | string | Yes | ID of the target cloud. |
+| switches | {[bundleName: string]: boolean} | Yes | Device-cloud synergy switches for applications. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
+try {
+ cloudData.Config.enableCloud(account, switches, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in enabling cloud');
+ } else {
+ console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### enableCloud
+
+static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}): Promise<void>
+
+Enables device-cloud synergy. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
+| accountId | string | Yes | ID of the target cloud. |
+| switches | {[bundleName: string]: boolean} | Yes | Device-cloud synergy switches for applications. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
+try {
+ cloudData.Config.enableCloud(account, switches).then(() => {
+ console.info('Succeeded in enabling cloud');
+ }).catch((err) => {
+ console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### disableCloud
+
+static disableCloud(accountId: string, callback: AsyncCallback<void>):void
+
+Disables device-cloud synergy. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------- | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+try {
+ cloudData.Config.disableCloud(account, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in disabling cloud');
+ } else {
+ console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### disableCloud
+
+static disableCloud(accountId: string): Promise<void>
+
+Disables device-cloud synergy. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+try {
+ cloudData.Config.disableCloud(account).then(() => {
+ console.info('Succeeded in disabling cloud');
+ }).catch((err) => {
+ console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### changeAppCloudSwitch
+
+static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean, callback: AsyncCallback<void>):void
+
+Changes the device-cloud synergy switch for an application. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ---------------------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName| string | Yes | Name of the target application.|
+| status | boolean | Yes | Setting of the device-cloud synergy switch for the application. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.changeAppCloudSwitch(account, bundleName, true, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in changing App cloud switch');
+ } else {
+ console.error(`Failed to change App cloud switch. Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### changeAppCloudSwitch
+
+static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean): Promise<void>
+
+Changes the device-cloud synergy switch for an application. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ---------------------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName| string | Yes | Name of the target application.|
+| status | boolean | Yes | Setting of the device-cloud synergy switch for the application. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.changeAppCloudSwitch(account, bundleName, true).then(() => {
+ console.info('Succeeded in changing App cloud switch');
+ }).catch((err) => {
+ console.error(`Failed to change App cloud switch. Code is ${err.code}, message is ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### notifyDataChange
+
+static notifyDataChange(accountId: string,bundleName:string, callback: AsyncCallback<void>):void
+
+Notifies the data changes in the cloud. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Server
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------------------------- | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName | string | Yes | Name of the target application. |
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.notifyDataChange(account, bundleName, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in notifying the change of data');
+ } else {
+ console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### notifyDataChange
+
+static notifyDataChange(accountId: string,bundleName:string): Promise<void>
+
+Notifies the data changes in the cloud. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Server
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------ | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName | string | Yes | Name of the target application. |
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.notifyDataChange(account, bundleName).then(() => {
+ console.info('Succeeded in notifying the change of data');
+ }).catch((err) => {
+ console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
diff --git a/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md b/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md
index 78d896c54a2f1c1674825ddaff66088634129596..6f63bb98574f0499ea47acb1f9ff0e04fff65f34 100644
--- a/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md
+++ b/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md
@@ -1,4 +1,4 @@
-# @ohos.data.dataSharePredicates (DataShare Predicates)
+# @ohos.data.dataSharePredicates (Data Share Predicates)
You can use **DataSharePredicates** to specify conditions for [updating](js-apis-data-dataShare.md#update), [deleting](js-apis-data-dataShare.md#delete), and [querying](js-apis-data-dataShare.md#query) data when **DataShare** is used to manage data.
@@ -18,13 +18,13 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
```
## DataSharePredicates
-Provides methods for setting different **DataSharePredicates** objects.
+Provides methods for setting different **DataSharePredicates** objects. This type is not multi-thread safe. If a **DataSharePredicates** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
### equalTo
equalTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is equal to the specified value.
Currently, only the relational database (RDB) and key-value database (KVDB, schema) support this **DataSharePredicates** object.
@@ -54,10 +54,11 @@ predicates.equalTo("NAME", "Rose")
notEqualTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is not equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is not equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -88,6 +89,7 @@ Adds a left parenthesis to this **DataSharePredicates**.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -116,6 +118,7 @@ Adds a right parenthesis to this **DataSharePredicates** object.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -144,6 +147,7 @@ Adds the OR condition to this **DataSharePredicates** object.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -190,10 +194,11 @@ predicates.equalTo("NAME", "lisi")
contains(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that contains the specified value.
+Sets a **DataSharePredicates** object to match the data that contains the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -220,10 +225,11 @@ predicates.contains("NAME", "os")
beginsWith(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that begins with the specified value.
+Sets a **DataSharePredicates** object to match the data that begins with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -250,10 +256,11 @@ predicates.beginsWith("NAME", "os")
endsWith(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that ends with the specified value.
+Sets a **DataSharePredicates** object to match the data that ends with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -280,10 +287,11 @@ predicates.endsWith("NAME", "os")
isNull(field: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data whose value is null.
+Sets a **DataSharePredicates** object to match the data whose value is null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -309,10 +317,11 @@ predicates.isNull("NAME")
isNotNull(field: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data whose value is not null.
+Sets a **DataSharePredicates** object to match the data whose value is not null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -338,10 +347,11 @@ predicates.isNotNull("NAME")
like(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that matches the specified wildcard expression.
+Sets a **DataSharePredicates** object to match the data that matches the specified wildcard expression.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -368,10 +378,11 @@ predicates.like("NAME", "%os%")
unlike(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that does not match the specified wildcard expression.
+Sets a **DataSharePredicates** object to match the data that does not match the specified wildcard expression.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -398,10 +409,11 @@ predicates.unlike("NAME", "%os%")
glob(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that matches the specified wildcard expression.
+Sets a **DataSharePredicates** object to match the data that matches the specified wildcard expression.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -428,10 +440,11 @@ predicates.glob("NAME", "?h*g")
between(field: string, low: ValueType, high: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is within the specified range, including the start and end values.
+Sets a **DataSharePredicates** object to match the data that is within the specified range, including the start and end values.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -459,10 +472,11 @@ predicates.between("AGE", 10, 50)
notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is out of the specified range, excluding the start and end values.
+Sets a **DataSharePredicates** object to match the data that is out of the specified range, excluding the start and end values.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -490,10 +504,11 @@ predicates.notBetween("AGE", 10, 50)
greaterThan(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is greater than the specified value.
+Sets a **DataSharePredicates** object to match the data that is greater than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -520,10 +535,11 @@ predicates.greaterThan("AGE", 10)
lessThan(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is less than the specified value.
+Sets a **DataSharePredicates** object to match the data that is less than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -550,10 +566,11 @@ predicates.lessThan("AGE", 50)
greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is greater than or equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is greater than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -580,10 +597,11 @@ predicates.greaterThanOrEqualTo("AGE", 10)
lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is less than or equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is less than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -672,6 +690,7 @@ Sets a **DataSharePredicates** object to filter out duplicate data records.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -725,6 +744,7 @@ Sets a **DataSharePredicates** object group the records according to the specifi
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -754,6 +774,7 @@ Sets a **DataSharePredicates** object to list data by the specified index.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -779,7 +800,7 @@ predicates.indexedBy("SALARY_INDEX")
in(field: string, value: Array<ValueType>): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is within the specified value.
+Sets a **DataSharePredicates** object to match the data that is within the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
@@ -809,10 +830,11 @@ predicates.in("AGE", [18, 20])
notIn(field: string, value: Array<ValueType>): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is not in the specified value.
+Sets a **DataSharePredicates** object to match the data that is not in the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -839,10 +861,11 @@ predicates.notIn("NAME", ["Lisa", "Rose"])
prefixKey(prefix: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data with the specified key prefix.
+Sets a **DataSharePredicates** object to match the data with the specified key prefix.
Currently, only the KVDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -868,10 +891,11 @@ predicates.prefixKey("NAME")
inKeys(keys: Array<string>): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data whose keys are within the given range.
+Sets a **DataSharePredicates** object to match the data whose keys are within the given range.
Currently, only the KVDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
diff --git a/en/application-dev/reference/apis/js-apis-data-distributedobject.md b/en/application-dev/reference/apis/js-apis-data-distributedobject.md
index 978cbffcf74444d9c902a91d72017d316f5ae5e8..8892f9ff2538ad00cebda30ba7b80fa3abf31641 100644
--- a/en/application-dev/reference/apis/js-apis-data-distributedobject.md
+++ b/en/application-dev/reference/apis/js-apis-data-distributedobject.md
@@ -23,10 +23,10 @@ Creates a distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| context | Context | Yes| Application context.
For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).
For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md).|
-| source | object | Yes| Attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | context | Context | Yes| Application context.
For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).
For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md).|
+ | source | object | Yes| Attributes of the distributed data object.|
**Return value**
@@ -75,9 +75,9 @@ Creates a random session ID.
**Return value**
-| Type| Description|
-| -------- | -------- |
-| string | Session ID created.|
+ | Type| Description|
+ | -------- | -------- |
+ | string | Session ID created.|
**Example**
@@ -124,18 +124,18 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| sessionId | string | Yes| ID of a distributed data object on a trusted network.|
-| callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the session ID is successfully set.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | sessionId | string | Yes| ID of a distributed data object on a trusted network.|
+ | callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the session ID is successfully set.|
**Error codes**
For details about the error codes, see [Distributed Data Object Error Codes](../errorcodes/errorcode-distributed-dataObject.md).
-| ID| Error Message|
-| -------- | -------- |
-| 15400001 | Failed to create the in-memory database.|
+ | ID| Error Message|
+ | -------- | -------- |
+ | 15400001 | Create table failed.|
**Example**
@@ -158,17 +158,17 @@ Exits all joined sessions.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the distributed data object exits all joined sessions.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the distributed data object exits all joined sessions.|
**Error codes**
For details about the error codes, see [Distributed Data Object Error Codes](../errorcodes/errorcode-distributed-dataObject.md).
-| ID| Error Message|
-| -------- | -------- |
-| 15400001 | Failed to create the in-memory database.|
+ | ID| Error Message|
+ | -------- | -------- |
+ | 15400001 | Create table failed.|
**Example**
@@ -195,9 +195,9 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
**Return value**
@@ -209,9 +209,9 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
For details about the error codes, see [Distributed Data Object Error Codes](../errorcodes/errorcode-distributed-dataObject.md).
-| ID| Error Message|
-| -------- | -------- |
-| 15400001 | Failed to create the in-memory database.|
+ | ID| Error Message|
+ | -------- | -------- |
+ | 15400001 | Create table failed.|
**Example**
@@ -240,10 +240,10 @@ Subscribes to data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -269,10 +269,10 @@ Unsubscribes from the data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -294,10 +294,10 @@ Subscribes to status changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
-| callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change.
**sessionId** indicates the session ID of the distributed data object.
**networkId** indicates the object device ID, that is, **deviceId**.
**status** indicates the object status, which can be online or offline.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
+ | callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change.
**sessionId** indicates the session ID of the distributed data object.
**networkId** indicates the object device ID, that is, **deviceId**.
**status** indicates the object status, which can be online or offline.|
**Example**
@@ -318,10 +318,10 @@ Unsubscribes from the status change of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
-| callback | Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }> | No| Callback for status changes. If this parameter is not specified, all status change callbacks of this distributed data object will be unsubscribed from.
**sessionId** indicates the session ID of the distributed data object.
**deviceId** indicates the device ID of the distributed data object.
**status** indicates the object status, which can be online or offline.|
+ | callback | Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }> | No| Callback for status changes. If this parameter is not specified, all status change callbacks of this distributed data object will be unsubscribed from.
**sessionId** indicates the session ID of the distributed data object.
**deviceId** indicates the device ID of the distributed data object.
**status** indicates the object status, which can be online or offline.|
**Example**
@@ -354,10 +354,10 @@ The saved data will be released in the following cases:
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| deviceId | string | Yes| ID of the device where data is stored. The value **local** indicates the local device.|
-| callback | AsyncCallback<[SaveSuccessResponse](#savesuccessresponse9)> | Yes| Callback invoked to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | deviceId | string | Yes| ID of the device where data is stored. The value **local** indicates the local device.|
+ | callback | AsyncCallback<[SaveSuccessResponse](#savesuccessresponse9)> | Yes| Callback invoked to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
**Example**
@@ -394,15 +394,15 @@ The saved data will be released in the following cases:
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| deviceId | string | Yes| ID of the device where the data is saved. The default value is **local**, which indicates the local device. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | deviceId | string | Yes| ID of the device where the data is saved. The default value is **local**, which indicates the local device. |
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<[SaveSuccessResponse](#savesuccessresponse9)> | Promise used to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<[SaveSuccessResponse](#savesuccessresponse9)> | Promise used to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
**Example**
@@ -423,7 +423,7 @@ g_object.save("local").then((result) => {
revokeSave(callback: AsyncCallback<RevokeSaveSuccessResponse>): void
-Revokes the saving operation of this distributed data object. This API uses an asynchronous callback to return the result.
+Revokes the data of this distributed data object saved. This API uses an asynchronous callback to return the result.
If the object is saved on the local device, the data saved on all trusted devices will be deleted.
If the object is stored on another device, the data on the local device will be deleted.
@@ -432,9 +432,9 @@ If the object is stored on another device, the data on the local device will be
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Yes| Callback invoked to return **RevokeSaveSuccessResponse**, which contains the session ID.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Yes| Callback invoked to return **RevokeSaveSuccessResponse**, which contains the session ID.|
**Example**
@@ -468,7 +468,7 @@ g_object.revokeSave((err, result) => {
revokeSave(): Promise<RevokeSaveSuccessResponse>
-Revokes the saving operation of this distributed data object. This API uses a promise to return the result.
+Revokes the data of this distributed data object saved. This API uses a promise to return the result.
If the object is saved on the local device, the data saved on all trusted devices will be deleted.
If the object is stored on another device, the data on the local device will be deleted.
@@ -477,9 +477,9 @@ If the object is stored on another device, the data on the local device will be
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Promise used to return **RevokeSaveSuccessResponse**, which contains the session ID.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Promise used to return **RevokeSaveSuccessResponse**, which contains the session ID.|
**Example**
@@ -520,9 +520,9 @@ Creates a distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| source | object | Yes| Attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | source | object | Yes| Attributes of the distributed data object.|
**Return value**
@@ -558,15 +558,15 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
**Return value**
-| Type| Description|
-| -------- | -------- |
-| boolean | Returns **true** if the session ID is set successfully;
returns **false** otherwise. |
+ | Type| Description|
+ | -------- | -------- |
+ | boolean | Returns **true** if the session ID is set successfully;
returns **false** otherwise. |
**Example**
@@ -593,10 +593,10 @@ Subscribes to data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -628,10 +628,10 @@ Unsubscribes from the data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered.
**sessionId** indicates the session ID of the distributed data object.
**fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -659,10 +659,10 @@ Subscribes to status changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
-| callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change.
**sessionId** indicates the session ID of the distributed data object.
**networkId** indicates the object device ID, that is, **deviceId**.
**status** indicates the object status, which can be online or offline.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
+ | callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change.
**sessionId** indicates the session ID of the distributed data object.
**networkId** indicates the object device ID, that is, **deviceId**.
**status** indicates the object status, which can be online or offline.|
**Example**
@@ -689,8 +689,8 @@ Unsubscribes from the status change of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
| callback | Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }> | No| Callback for status changes. If this parameter is not specified, all status change callbacks of this distributed data object will be unregistered.
**sessionId** indicates the session ID of the distributed data object.
**deviceId** indicates the device ID of the distributed data object.
**status** indicates the object status, which can be online or offline.|
diff --git a/en/application-dev/reference/apis/js-apis-data-preferences.md b/en/application-dev/reference/apis/js-apis-data-preferences.md
index 156078c63ad8f33a7747e493948f59d511a1c791..7ee96b8c97e6d294255a541fce2c392b04fc310f 100644
--- a/en/application-dev/reference/apis/js-apis-data-preferences.md
+++ b/en/application-dev/reference/apis/js-apis-data-preferences.md
@@ -185,7 +185,7 @@ For details about the error codes, see [User Preference Error Codes](../errorcod
| ID| Error Message |
| -------- | ------------------------------|
-| 15500010 | Failed to delete the preferences. |
+| 15500010 | Failed to delete preferences file. |
**Example**
@@ -197,7 +197,7 @@ import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
try {
- data_preferences.deletePreferences(context, 'mystore', function (err, val) {
+ data_preferences.deletePreferences(context, 'mystore', function (err) {
if (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
return;
@@ -217,7 +217,7 @@ import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
- data_preferences.deletePreferences(this.context, 'mystore', function (err, val) {
+ data_preferences.deletePreferences(this.context, 'mystore', function (err) {
if (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
return;
@@ -262,7 +262,7 @@ For details about the error codes, see [User Preference Error Codes](../errorcod
| ID| Error Message |
| -------- | ------------------------------|
-| 15500010 | Failed to delete the preferences. |
+| 15500010 | Failed to delete preferences file. |
**Example**
@@ -334,7 +334,7 @@ import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
try {
- data_preferences.removePreferencesFromCache(context, 'mystore', function (err, val) {
+ data_preferences.removePreferencesFromCache(context, 'mystore', function (err) {
if (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
return;
@@ -354,7 +354,7 @@ import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
- data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err, val) {
+ data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err) {
if (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
return;
diff --git a/en/application-dev/reference/apis/js-apis-data-relationalStore.md b/en/application-dev/reference/apis/js-apis-data-relationalStore.md
index 3e7e078f595f8468bf78cc953f5267c5515360a2..126dff90c4a6d06dfe675668409cf4d4d9573fa6 100644
--- a/en/application-dev/reference/apis/js-apis-data-relationalStore.md
+++ b/en/application-dev/reference/apis/js-apis-data-relationalStore.md
@@ -38,10 +38,11 @@ Obtains an RDB store. This API uses an asynchronous callback to return the resul
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
-| 14800011 | If failed open database by database corrupted. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800011 | Failed to open database by database corrupted. |
+| 14800000 | Inner error. |
**Example**
@@ -64,7 +65,7 @@ const STORE_CONFIG = {
relationalStore.getRdbStore(context, STORE_CONFIG, function (err, rdbStore) {
store = rdbStore;
if (err) {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Get RdbStore successfully.`);
@@ -87,7 +88,7 @@ class EntryAbility extends UIAbility {
relationalStore.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) {
store = rdbStore;
if (err) {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Get RdbStore successfully.`);
@@ -121,10 +122,11 @@ Obtains an RDB store. This API uses a promise to return the result. You can set
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
-| 14800011 | If failed open database by database corrupted. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800011 | Failed to open database by database corrupted. |
+| 14800000 | Inner error. |
**Example**
@@ -148,7 +150,7 @@ promise.then(async (rdbStore) => {
store = rdbStore;
console.info(`Get RdbStore successfully.`);
}).catch((err) => {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -170,7 +172,7 @@ class EntryAbility extends UIAbility {
store = rdbStore;
console.info(`Get RdbStore successfully.`)
}).catch((err) => {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
})
}
}
@@ -196,9 +198,10 @@ Deletes an RDB store. This API uses an asynchronous callback to return the resul
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800000 | Inner error. |
**Example**
@@ -212,7 +215,7 @@ let context = featureAbility.getContext()
relationalStore.deleteRdbStore(context, "RdbTest.db", function (err) {
if (err) {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete RdbStore successfully.`);
@@ -228,7 +231,7 @@ class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
relationalStore.deleteRdbStore(this.context, "RdbTest.db", function (err) {
if (err) {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete RdbStore successfully.`);
@@ -262,9 +265,10 @@ Deletes an RDB store. This API uses a promise to return the result.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800000 | Inner error. |
**Example**
@@ -280,7 +284,7 @@ let promise = relationalStore.deleteRdbStore(context, "RdbTest.db");
promise.then(()=>{
console.info(`Delete RdbStore successfully.`);
}).catch((err) => {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -295,7 +299,7 @@ class EntryAbility extends UIAbility {
promise.then(()=>{
console.info(`Delete RdbStore successfully.`);
}).catch((err) => {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
})
}
}
@@ -311,7 +315,7 @@ Defines the RDB store configuration.
| ------------- | ------------- | ---- | --------------------------------------------------------- |
| name | string | Yes | Database file name. |
| securityLevel | [SecurityLevel](#securitylevel) | Yes | Security level of the RDB store. |
-| encrypt | boolean | No | Whether to encrypt the RDB store.
The value **true** means to encrypt the RDB store;
the value **false** means the opposite.|
+| encrypt | boolean | No | Whether to encrypt the RDB store.
The value **true** means to encrypt the RDB store;
the value **false** (default) means the opposite.|
## SecurityLevel
@@ -319,7 +323,7 @@ Enumerates the RDB store security levels.
> **NOTE**
>
-> To perform data synchronization operations, the RDB store security level must be lower than or equal to that of the peer device. For details, see the [Cross-Device Data Synchronization Mechanism](../../database/sync-app-data-across-devices-overview.md#cross-device-data-synchronization-mechanism).
+> To perform data synchronization operations, the RDB store security level must be lower than or equal to that of the peer device. For details, see the [Cross-Device Data Synchronization Mechanism]( ../../database/sync-app-data-across-devices-overview.md#cross-device-data-synchronization-mechanism).
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
@@ -344,7 +348,7 @@ Defines the data types allowed.
## ValuesBucket
-Defines the types of the key and value in a KV pair.
+Defines the types of the key and value in a KV pair. This type is not multi-thread safe. If a **ValuesBucket** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
@@ -374,6 +378,7 @@ Defines the subscription type.
| Name | Value | Description |
| --------------------- | ---- | ------------------ |
| SUBSCRIBE_TYPE_REMOTE | 0 | Subscribe to remote data changes.|
+| SUBSCRIBE_TYPE_CLOUD10+ | 1 | Subscribe to cloud data changes.|
## ConflictResolution10+
@@ -392,7 +397,7 @@ Defines the resolution to use when **insert()** and **update()** conflict.
## RdbPredicates
-Defines the predicates for an RDB store. This class determines whether the conditional expression for the RDB store is true or false.
+Defines the predicates for an RDB store. This class determines whether the conditional expression for the RDB store is true or false. This type is not multi-thread safe. If an **RdbPredicates** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
### constructor
@@ -1289,9 +1294,10 @@ Inserts a row of data into a table. This API uses an asynchronous callback to re
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1304,7 +1310,7 @@ const valueBucket = {
};
store.insert("EMPLOYEE", valueBucket, function (err, rowId) {
if (err) {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Insert is successful, rowId = ${rowId}`);
@@ -1332,9 +1338,10 @@ Inserts a row of data into a table. This API uses an asynchronous callback to re
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1347,7 +1354,7 @@ const valueBucket = {
};
store.insert("EMPLOYEE", valueBucket, relationalStore.ConflictResolution.ON_CONFLICT_REPLACE, function (err, rowId) {
if (err) {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Insert is successful, rowId = ${rowId}`);
@@ -1379,9 +1386,10 @@ Inserts a row of data into a table. This API uses a promise to return the result
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1396,7 +1404,7 @@ let promise = store.insert("EMPLOYEE", valueBucket);
promise.then((rowId) => {
console.info(`Insert is successful, rowId = ${rowId}`);
}).catch((err) => {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1426,9 +1434,10 @@ Inserts a row of data into a table. This API uses a promise to return the result
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1443,7 +1452,7 @@ let promise = store.insert("EMPLOYEE", valueBucket, relationalStore.ConflictReso
promise.then((rowId) => {
console.info(`Insert is successful, rowId = ${rowId}`);
}).catch((err) => {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1467,9 +1476,10 @@ Batch inserts data into a table. This API uses an asynchronous callback to retur
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1496,7 +1506,7 @@ const valueBucket3 = {
let valueBuckets = new Array(valueBucket1, valueBucket2, valueBucket3);
store.batchInsert("EMPLOYEE", valueBuckets, function(err, insertNum) {
if (err) {
- console.error(`batchInsert is failed, err: ${err}`);
+ console.error(`batchInsert is failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`batchInsert is successful, the number of values that were inserted = ${insertNum}`);
@@ -1528,9 +1538,10 @@ Batch inserts data into a table. This API uses a promise to return the result.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1559,7 +1570,7 @@ let promise = store.batchInsert("EMPLOYEE", valueBuckets);
promise.then((insertNum) => {
console.info(`batchInsert is successful, the number of values that were inserted = ${insertNum}`);
}).catch((err) => {
- console.error(`batchInsert is failed, err: ${err}`);
+ console.error(`batchInsert is failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1583,9 +1594,10 @@ Updates data in the RDB store based on the specified **RdbPredicates** object. T
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1600,7 +1612,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Lisa");
store.update(valueBucket, predicates, function (err, rows) {
if (err) {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Updated row count: ${rows}`);
@@ -1628,9 +1640,10 @@ Updates data in the RDB store based on the specified **RdbPredicates** object. T
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1645,7 +1658,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Lisa");
store.update(valueBucket, predicates, relationalStore.ConflictResolution.ON_CONFLICT_REPLACE, function (err, rows) {
if (err) {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Updated row count: ${rows}`);
@@ -1677,9 +1690,10 @@ Updates data based on the specified **RdbPredicates** object. This API uses a pr
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1696,7 +1710,7 @@ let promise = store.update(valueBucket, predicates);
promise.then(async (rows) => {
console.info(`Updated row count: ${rows}`);
}).catch((err) => {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1726,9 +1740,10 @@ Updates data based on the specified **RdbPredicates** object. This API uses a pr
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1745,7 +1760,7 @@ let promise = store.update(valueBucket, predicates, relationalStore.ConflictReso
promise.then(async (rows) => {
console.info(`Updated row count: ${rows}`);
}).catch((err) => {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1757,6 +1772,8 @@ Updates data based on the specified **DataSharePredicates** object. This API use
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1772,9 +1789,10 @@ Updates data based on the specified **DataSharePredicates** object. This API use
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1790,7 +1808,7 @@ let predicates = new dataSharePredicates.DataSharePredicates();
predicates.equalTo("NAME", "Lisa");
store.update("EMPLOYEE", valueBucket, predicates, function (err, rows) {
if (err) {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Updated row count: ${rows}`);
@@ -1805,6 +1823,8 @@ Updates data based on the specified **DataSharePredicates** object. This API use
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1825,9 +1845,10 @@ Updates data based on the specified **DataSharePredicates** object. This API use
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1845,7 +1866,7 @@ let promise = store.update("EMPLOYEE", valueBucket, predicates);
promise.then(async (rows) => {
console.info(`Updated row count: ${rows}`);
}).catch((err) => {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1868,9 +1889,10 @@ Deletes data from the RDB store based on the specified **RdbPredicates** object.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1879,7 +1901,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Lisa");
store.delete(predicates, function (err, rows) {
if (err) {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete rows: ${rows}`);
@@ -1910,9 +1932,10 @@ Deletes data from the RDB store based on the specified **RdbPredicates** object.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1923,7 +1946,7 @@ let promise = store.delete(predicates);
promise.then((rows) => {
console.info(`Delete rows: ${rows}`);
}).catch((err) => {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1935,6 +1958,8 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1949,9 +1974,10 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1961,7 +1987,7 @@ let predicates = new dataSharePredicates.DataSharePredicates();
predicates.equalTo("NAME", "Lisa");
store.delete("EMPLOYEE", predicates, function (err, rows) {
if (err) {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete rows: ${rows}`);
@@ -1976,6 +2002,8 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1995,9 +2023,10 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2009,7 +2038,7 @@ let promise = store.delete("EMPLOYEE", predicates);
promise.then((rows) => {
console.info(`Delete rows: ${rows}`);
}).catch((err) => {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2029,6 +2058,14 @@ Queries data from the RDB store based on specified conditions. This API uses an
| columns | Array<string> | Yes | Columns to query. If this parameter is not specified, the query applies to all columns. |
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2036,7 +2073,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Rose");
store.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) {
if (err) {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2059,6 +2096,14 @@ Queries data from the RDB store based on specified conditions. This API uses a p
| predicates | [RdbPredicates](#rdbpredicates) | Yes | Query conditions specified by the **RdbPredicates** object. |
| columns | Array<string> | No | Columns to query. If this parameter is not specified, the query applies to all columns.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Return value**
| Type | Description |
@@ -2075,7 +2120,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2087,6 +2132,8 @@ Queries data from the RDB store based on specified conditions. This API uses an
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -2098,6 +2145,14 @@ Queries data from the RDB store based on specified conditions. This API uses an
| columns | Array<string> | Yes | Columns to query. If this parameter is not specified, the query applies to all columns. |
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2106,7 +2161,7 @@ let predicates = new dataSharePredicates.DataSharePredicates();
predicates.equalTo("NAME", "Rose");
store.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) {
if (err) {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2122,6 +2177,8 @@ Queries data from the RDB store based on specified conditions. This API uses a p
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -2138,6 +2195,14 @@ Queries data from the RDB store based on specified conditions. This API uses a p
| ------------------------------------------------------- | -------------------------------------------------- |
| Promise<[ResultSet](#resultset)> | Promise used to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2149,7 +2214,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2175,6 +2240,14 @@ Queries data from the RDB store of a remote device based on specified conditions
| columns | Array<string> | Yes | Columns to query. If this parameter is not specified, the query applies to all columns. |
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2197,7 +2270,7 @@ predicates.greaterThan("id", 0);
store.remoteQuery(deviceId, "EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"],
function(err, resultSet) {
if (err) {
- console.error(`Failed to remoteQuery, err: ${err}`);
+ console.error(`Failed to remoteQuery, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2233,6 +2306,14 @@ Queries data from the RDB store of a remote device based on specified conditions
| ------------------------------------------------------------ | -------------------------------------------------- |
| Promise<[ResultSet](#resultset)> | Promise used to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2257,7 +2338,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Failed to remoteQuery, err: ${err}`);
+ console.error(`Failed to remoteQuery, code is ${err.code},message is ${err.message}`);
})
```
@@ -2277,12 +2358,20 @@ Queries data using the specified SQL statement. This API uses an asynchronous ca
| bindArgs | Array<[ValueType](#valuetype)> | Yes | Arguments in the SQL statement. The value corresponds to the placeholders in the SQL parameter statement. If the SQL parameter statement is complete, the value of this parameter must be an empty array.|
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.querySql("SELECT * FROM EMPLOYEE CROSS JOIN BOOK WHERE BOOK.NAME = ?", ['sanguo'], function (err, resultSet) {
if (err) {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2311,6 +2400,14 @@ Queries data using the specified SQL statement. This API uses a promise to retur
| ------------------------------------------------------- | -------------------------------------------------- |
| Promise<[ResultSet](#resultset)> | Promise used to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2319,7 +2416,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2343,9 +2440,10 @@ Executes an SQL statement that contains specified arguments but returns no value
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2353,7 +2451,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const SQL_DELETE_TABLE = "DELETE FROM test WHERE name = ?"
store.executeSql(SQL_DELETE_TABLE, ['zhangsan'], function(err) {
if (err) {
- console.error(`ExecuteSql failed, err: ${err}`);
+ console.error(`ExecuteSql failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete table done.`);
@@ -2385,9 +2483,10 @@ Executes an SQL statement that contains specified arguments but returns no value
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2397,7 +2496,7 @@ let promise = store.executeSql(SQL_DELETE_TABLE);
promise.then(() => {
console.info(`Delete table done.`);
}).catch((err) => {
- console.error(`ExecuteSql failed, err: ${err}`);
+ console.error(`ExecuteSql failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2413,9 +2512,10 @@ Starts the transaction before executing an SQL statement.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2428,7 +2528,7 @@ const STORE_CONFIG = {
};
relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
if (err) {
- console.error(`GetRdbStore failed, err: ${err}`);
+ console.error(`GetRdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
store.beginTransaction();
@@ -2462,7 +2562,7 @@ const STORE_CONFIG = {
};
relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
if (err) {
- console.error(`GetRdbStore failed, err: ${err}`);
+ console.error(`GetRdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
store.beginTransaction();
@@ -2496,7 +2596,7 @@ const STORE_CONFIG = {
};
relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
if (err) {
- console.error(`GetRdbStore failed, err: ${err}`);
+ console.error(`GetRdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
try {
@@ -2511,7 +2611,7 @@ relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
await store.insert("test", valueBucket);
store.commit();
} catch (err) {
- console.error(`Transaction failed, err: ${err}`);
+ console.error(`Transaction failed, code is ${err.code},message is ${err.message}`);
store.rollBack();
}
})
@@ -2532,12 +2632,20 @@ Backs up an RDB store. This API uses an asynchronous callback to return the resu
| destName | string | Yes | Name of the RDB store backup file.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.backup("dbBackup.db", function(err) {
if (err) {
- console.error(`Backup failed, err: ${err}`);
+ console.error(`Backup failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Backup success.`);
@@ -2564,6 +2672,14 @@ Backs up an RDB store. This API uses a promise to return the result.
| ------------------- | ------------------------- |
| Promise<void> | Promise that returns no value.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2571,7 +2687,7 @@ let promiseBackup = store.backup("dbBackup.db");
promiseBackup.then(()=>{
console.info(`Backup success.`);
}).catch((err)=>{
- console.error(`Backup failed, err: ${err}`);
+ console.error(`Backup failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2590,12 +2706,20 @@ Restores an RDB store from a backup file. This API uses an asynchronous callback
| srcName | string | Yes | Name of the RDB store backup file.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.restore("dbBackup.db", function(err) {
if (err) {
- console.error(`Restore failed, err: ${err}`);
+ console.error(`Restore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Restore success.`);
@@ -2622,6 +2746,14 @@ Restores an RDB store from a backup file. This API uses a promise to return the
| ------------------- | ------------------------- |
| Promise<void> | Promise that returns no value.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2629,7 +2761,7 @@ let promiseRestore = store.restore("dbBackup.db");
promiseRestore.then(()=>{
console.info(`Restore success.`);
}).catch((err)=>{
- console.error(`Restore failed, err: ${err}`);
+ console.error(`Restore failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2650,12 +2782,20 @@ Sets distributed tables. This API uses an asynchronous callback to return the re
| tables | Array<string> | Yes | Names of the distributed tables to set.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.setDistributedTables(["EMPLOYEE"], function (err) {
if (err) {
- console.error(`SetDistributedTables failed, err: ${err}`);
+ console.error(`SetDistributedTables failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`SetDistributedTables successfully.`);
@@ -2684,6 +2824,14 @@ Sets distributed tables. This API uses a promise to return the result.
| ------------------- | ------------------------- |
| Promise<void> | Promise that returns no value.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2691,7 +2839,7 @@ let promise = store.setDistributedTables(["EMPLOYEE"]);
promise.then(() => {
console.info(`SetDistributedTables successfully.`);
}).catch((err) => {
- console.error(`SetDistributedTables failed, err: ${err}`);
+ console.error(`SetDistributedTables failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2717,6 +2865,14 @@ Obtains the distributed table name of a remote device based on the local table n
| table | string | Yes | Local table name of the remote device. |
| callback | AsyncCallback<string> | Yes | Callback invoked to return the result. If the operation succeeds, the distributed table name of the remote device is returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2736,7 +2892,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName) {
if (err) {
- console.error(`ObtainDistributedTableName failed, err: ${err}`);
+ console.error(`ObtainDistributedTableName failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ObtainDistributedTableName successfully, tableName= ${tableName}`);
@@ -2770,6 +2926,14 @@ Obtains the distributed table name of a remote device based on the local table n
| --------------------- | ----------------------------------------------------- |
| Promise<string> | Promise used to return the result. If the operation succeeds, the distributed table name of the remote device is returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2791,7 +2955,7 @@ let promise = store.obtainDistributedTableName(deviceId, "EMPLOYEE");
promise.then((tableName) => {
console.info(`ObtainDistributedTableName successfully, tableName= ${tableName}`);
}).catch((err) => {
- console.error(`ObtainDistributedTableName failed, err: ${err}`);
+ console.error(`ObtainDistributedTableName failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2813,6 +2977,14 @@ Synchronizes data between devices. This API uses an asynchronous callback to ret
| predicates | [RdbPredicates](#rdbpredicates) | Yes | **RdbPredicates** object that specifies the data and devices to synchronize. |
| callback | AsyncCallback<Array<[string, number]>> | Yes | Callback invoked to send the synchronization result to the caller.
**string** indicates the device ID.
**number** indicates the synchronization status of that device. The value **0** indicates a successful synchronization. Other values indicate a synchronization failure. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2836,7 +3008,7 @@ let predicates = new relationalStore.RdbPredicates('EMPLOYEE');
predicates.inDevices(deviceIds);
store.sync(relationalStore.SyncMode.SYNC_MODE_PUSH, predicates, function (err, result) {
if (err) {
- console.error(`Sync failed, err: ${err}`);
+ console.error(`Sync failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Sync done.`);
@@ -2869,6 +3041,14 @@ Synchronizes data between devices. This API uses a promise to return the result.
| -------------------------------------------- | ------------------------------------------------------------ |
| Promise<Array<[string, number]>> | Promise used to send the synchronization result.
**string** indicates the device ID.
**number** indicates the synchronization status of that device. The value **0** indicates a successful synchronization. Other values indicate a synchronization failure. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2897,7 +3077,7 @@ promise.then((result) =>{
console.info(`device= ${result[i][0]}, status= ${result[i][1]}`);
}
}).catch((err) => {
- console.error(`Sync failed, err: ${err}`);
+ console.error(`Sync failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2915,7 +3095,7 @@ Registers an observer for this RDB store. When the data in the RDB store changes
| -------- | ----------------------------------- | ---- | ------------------------------------------- |
| event | string | Yes | Event to observe. The value is **dataChange**, which indicates a data change event. |
| type | [SubscribeType](#subscribetype) | Yes | Subscription type to register.|
-| observer | Callback<Array<string>> | Yes | Callback invoked to return the data change event. |
+| observer | Callback<Array<string>> | Yes | Callback invoked to return the data change event. **Array** indicates the IDs of the peer devices whose data in the database is changed.|
**Example**
@@ -2928,7 +3108,7 @@ function storeObserver(devices) {
try {
store.on('dataChange', relationalStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver);
} catch (err) {
- console.error(`Register observer failed, err: ${err}`);
+ console.error(`Register observer failed, code is ${err.code},message is ${err.message}`);
}
```
@@ -2944,9 +3124,9 @@ Unregisters the observer of the specified type from the RDB store. This API uses
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------- | ---- | ------------------------------------------ |
-| event | string | Yes | Event type. The value is **dataChange**, which indicates a data change event. |
-| type | [SubscribeType](#subscribetype) | Yes | Subscription type to unregister. |
-| observer | Callback<Array<string>> | Yes | Callback for the data change event. |
+| event | string | Yes | Event type. The value is **dataChange**, which indicates a data change event. |
+| type | [SubscribeType](#subscribetype) | Yes | Subscription type to unregister. |
+| observer | Callback<Array<string>> | Yes | Callback for the data change event. **Array** indicates the IDs of the peer devices whose data in the database is changed.|
**Example**
@@ -2959,7 +3139,7 @@ function storeObserver(devices) {
try {
store.off('dataChange', relationalStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver);
} catch (err) {
- console.error(`Unregister observer failed, err: ${err}`);
+ console.error(`Unregister observer failed, code is ${err.code},message is ${err.message}`);
}
```
@@ -3099,7 +3279,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3110,7 +3290,7 @@ promise.then((resultSet) => {
resultSet.goTo(1);
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3140,7 +3320,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3151,7 +3331,7 @@ promise.then((resultSet) => {
resultSet.goToRow(5);
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3176,7 +3356,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3187,7 +3367,7 @@ promise.then((resultSet) => {
resultSet.goToFirstRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3211,7 +3391,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3222,7 +3402,7 @@ promise.then((resultSet) => {
resultSet.goToLastRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3246,7 +3426,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3257,7 +3437,7 @@ promise.then((resultSet) => {
resultSet.goToNextRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3281,7 +3461,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3292,7 +3472,7 @@ promise.then((resultSet) => {
resultSet.goToPreviousRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3316,6 +3496,14 @@ Obtains the value in the form of a byte array based on the specified column and
| ---------- | -------------------------------- |
| Uint8Array | Value obtained.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
+
**Example**
```js
@@ -3342,6 +3530,14 @@ Obtains the value in the form of a string based on the specified column and the
| ------ | ---------------------------- |
| string | String obtained.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
+
**Example**
```js
@@ -3366,7 +3562,15 @@ Obtains the value of the Long type based on the specified column and the current
| Type | Description |
| ------ | ------------------------------------------------------------ |
-| number | Value obtained.
The value range supported by this API is **Number.MIN_SAFE_INTEGER** to **Number.MAX_SAFE_INTEGER**. If the value is out of this range, use [getDouble](#getdouble).|
+| number | Value obtained.
The value range supported by API is **Number.MIN_SAFE_INTEGER** to **Number.MAX_SAFE_INTEGER**. If the value is out of this range, use [getDouble](#getdouble).|
+
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
**Example**
@@ -3394,6 +3598,14 @@ Obtains the value of the double type based on the specified column and the curre
| ------ | ---------------------------- |
| number | Value obtained.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
+
**Example**
```js
@@ -3450,7 +3662,7 @@ let promiseClose = store.query(predicatesClose, ["ID", "NAME", "AGE", "SALARY",
promiseClose.then((resultSet) => {
resultSet.close();
}).catch((err) => {
- console.error(`resultset close failed, err: ${err}`);
+ console.error(`resultset close failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3460,6 +3672,4 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
-
-
+| 14800012 | The result set is empty or the specified location is invalid. |
diff --git a/en/application-dev/reference/apis/js-apis-data-valuesBucket.md b/en/application-dev/reference/apis/js-apis-data-valuesBucket.md
index 009ff71b091c7d91a92d92364450316e3aeecfa2..ee21647ac71dacf7afa8240d2aa93e2ea65967f4 100644
--- a/en/application-dev/reference/apis/js-apis-data-valuesBucket.md
+++ b/en/application-dev/reference/apis/js-apis-data-valuesBucket.md
@@ -1,4 +1,4 @@
-# @ohos.data.ValuesBucket (Value Bucket)
+# @ohos.data.ValuesBucket (Data Set)
The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to insert data into a database.
@@ -6,7 +6,6 @@ The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
-> The APIs provided by this module are system APIs.
## Modules to Import
@@ -30,7 +29,7 @@ Enumerates the value types allowed by the database.
## ValuesBucket
-Defines the types of the key and value in a KV pair.
+Defines the types of the key and value in a KV pair. This type is not multi-thread safe. If a **ValuesBucket** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
diff --git a/en/application-dev/reference/apis/js-apis-distributed-account.md b/en/application-dev/reference/apis/js-apis-distributed-account.md
index 0ec67bc229c124cdf36a289e7321acaa9c2fcd43..5ea4792ec68bf59975274abd5cb7e0a58f8c1188 100644
--- a/en/application-dev/reference/apis/js-apis-distributed-account.md
+++ b/en/application-dev/reference/apis/js-apis-distributed-account.md
@@ -62,12 +62,14 @@ Obtains distributed account information. This API uses an asynchronous callback
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
try {
accountAbility.getOsAccountDistributedInfo((err, data) => {
- console.log("getOsAccountDistributedInfo err: " + JSON.stringify(err));
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ if (err) {
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }
});
- } catch (e) {
- console.log("getOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
@@ -98,15 +100,96 @@ Obtains distributed account information. This API uses a promise to return the r
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
try {
accountAbility.getOsAccountDistributedInfo().then((data) => {
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ console.log('distributed information: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getOsAccountDistributedInfo err: " + JSON.stringify(err));
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
- } catch (e) {
- console.log("getOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
+
+### getOsAccountDistributedInfoByLocalId10+
+
+getOsAccountDistributedInfoByLocalId(localId: number, callback: AsyncCallback<DistributedInfo>): void
+
+Obtains distributed information about an OS account. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | localId | number | Yes| ID of the target OS account.|
+ | callback | AsyncCallback<[DistributedInfo](#distributedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **data** is the distributed account information obtained. Otherwise, **err** is an error object.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300003 | Account not found. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ try {
+ accountAbility.getOsAccountDistributedInfoByLocalId(100, (err, data) => {
+ if (err) {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ } else {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }
+ });
+ } catch (err) {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
+### getOsAccountDistributedInfoByLocalId10+
+
+getOsAccountDistributedInfoByLocalId(localId: number): Promise<DistributedInfo>
+
+Obtains distributed information about an OS account. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**Return value**
+
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<[DistributedInfo](#distributedinfo)> | Promise used to return the distributed account information obtained.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300003 | Account not found. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ try {
+ accountAbility.getOsAccountDistributedInfoByLocalId(100).then((data) => {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }).catch((err) => {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ });
+ } catch (err) {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
### queryOsAccountDistributedInfo(deprecated)
queryOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): void
@@ -130,9 +213,11 @@ Obtains distributed account information. This API uses an asynchronous callback
```js
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
accountAbility.queryOsAccountDistributedInfo((err, data) => {
- console.log("queryOsAccountDistributedInfo err: " + JSON.stringify(err));
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ if (err) {
+ console.log('queryOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }
});
```
@@ -160,10 +245,9 @@ Obtains distributed account information. This API uses a promise to return the r
```js
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
accountAbility.queryOsAccountDistributedInfo().then((data) => {
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ console.log('distributed information: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("queryOsAccountDistributedInfoerr: " + JSON.stringify(err));
+ console.log('queryOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
```
@@ -198,10 +282,14 @@ Sets the distributed account information. This API uses an asynchronous callback
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
try {
accountAbility.setOsAccountDistributedInfo(accountInfo, (err) => {
- console.log("setOsAccountDistributedInfo err: " + JSON.stringify(err));
+ if (err) {
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('setOsAccountDistributedInfo successfully');
+ }
});
- } catch (e) {
- console.log("setOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
@@ -241,14 +329,109 @@ Sets the distributed account information. This API uses a promise to return the
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
try {
accountAbility.setOsAccountDistributedInfo(accountInfo).then(() => {
- console.log('setOsAccountDistributedInfo Success');
+ console.log('setOsAccountDistributedInfo successfully');
}).catch((err) => {
- console.log("setOsAccountDistributedInfo err: " + JSON.stringify(err));
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
- } catch (e) {
- console.log("setOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
+### setOsAccountDistributedInfoByLocalId10+
+
+setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: DistributedInfo, callback: AsyncCallback<void>): void
+
+Sets the distributed information for an OS account. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | localId | number | Yes| ID of the target OS account.|
+ | accountInfo | [DistributedInfo](#distributedinfo) | Yes| Distributed account information to set.|
+ | callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the distributed information is set successfully, **err** is **undefined**. Otherwise, **err** is an error object.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300002 | Invalid distributedInfo. |
+| 12300003 | Account identified by localId or by distributedInfo not found. |
+| 12300008 | Restricted OS account. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
+ try {
+ accountAbility.setOsAccountDistributedInfoByLocalId(100, accountInfo, (err) => {
+ if (err) {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ } else {
+ console.log('setOsAccountDistributedInfoByLocalId successfully');
+ }
+ });
+ } catch (err) {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
+### setOsAccountDistributedInfoByLocalId10+
+
+setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: DistributedInfo): Promise<void>
+
+Sets the distributed information for an OS account. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | localId | number | Yes| ID of the target OS account.|
+ | distributedInfo | [DistributedInfo](#distributedinfo) | Yes| Distributed account information to set.|
+
+**Return value**
+
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<void> | Promise that returns no value.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300002 | Invalid distributedInfo. |
+| 12300003 | Account identified by localId or by distributedInfo not found. |
+| 12300008 | Restricted OS account. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
+ try {
+ accountAbility.setOsAccountDistributedInfoByLocalId(100, accountInfo).then(() => {
+ console.log('setOsAccountDistributedInfoByLocalId successfully');
+ }).catch((err) => {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ });
+ } catch (err) {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
### updateOsAccountDistributedInfo(deprecated)
updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback<void>): void
@@ -275,7 +458,11 @@ Updates the distributed account information. This API uses an asynchronous callb
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
accountAbility.updateOsAccountDistributedInfo(accountInfo, (err) => {
- console.log("queryOsAccountDistributedInfo err: " + JSON.stringify(err));
+ if (err) {
+ console.log('queryOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('queryOsAccountDistributedInfo successfully');
+ }
});
```
@@ -308,22 +495,34 @@ Updates the distributed account information. This API uses a promise to return t
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
accountAbility.updateOsAccountDistributedInfo(accountInfo).then(() => {
- console.log('updateOsAccountDistributedInfo Success');
+ console.log('updateOsAccountDistributedInfo successfully');
}).catch((err) => {
- console.log("updateOsAccountDistributedInfo err: " + JSON.stringify(err));
+ console.log('updateOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
```
## DistributedInfo
-Defines distributed OS account information.
+Defines the distributed information about an OS account.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+| Name| Type| Read-only| Mandatory| Description|
+| -------- | -------- | -------- |-------- | -------- |
+| name | string | No|Yes| Name of the distributed account. It must be a non-null string.|
+| id | string | No|Yes| UID of the distributed account. It must be a non-null string.|
+| event | string | No|Yes| Login state of the distributed account. The state can be login, logout, token invalid, or logoff, which correspond to the following strings respectively:
- Ohos.account.event.LOGIN
- Ohos.account.event.LOGOUT
- Ohos.account.event.TOKEN_INVALID
- Ohos.account.event.LOGOFF |
+| nickname9+ | string | No|No| Nickname of the distributed account. By default, no value is passed.|
+| avatar9+ | string | No|No| Avatar of the distributed account. By default, no value is passed.|
+| status10+ | [DistributedAccountStatus](#distributedaccountstatus10) | Yes|No| Status of the distributed account. The value is of the enumerated type. The default status is unlogged.|
+| scalableData8+ | object | No|No| Extended information about the distributed account, passed in key-value (KV) pairs based on service requirements. By default, no value is passed.|
+
+## DistributedAccountStatus10+
+
+Enumerates the statuses of a distributed account.
**System capability**: SystemCapability.Account.OsAccount
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| name | string | Yes| Name of the distributed account. It must be a non-null string.|
-| id | string | Yes| UID of the distributed account. It must be a non-null string.|
-| event | string | Yes| Login state of the distributed account. The state can be login, logout, token invalid, or logoff, which correspond to the following strings respectively:
- Ohos.account.event.LOGIN
- Ohos.account.event.LOGOUT
- Ohos.account.event.TOKEN_INVALID
- Ohos.account.event.LOGOFF |
-| nickname9+ | string | No| Nickname of the distributed account. It must be a non-null string.|
-| avatar9+ | string | No| Avatar of the distributed account. It must be a non-null string.|
-| scalableData8+ | object | No| Extended information about the distributed account, passed in key-value (KV) pairs.
**NOTE**
This parameter is reserved and not used in the setters and getters.|
+| Name | Value| Description |
+| ---- | ------ | ----------- |
+| NOT_LOGGED_IN | 0 | The account has not logged in.|
+| LOGGED_IN | 1 | The account has logged in.|
diff --git a/en/application-dev/reference/apis/js-apis-distributed-data.md b/en/application-dev/reference/apis/js-apis-distributed-data.md
index cd25c298b90c6f59cba4e2d86f79650991eb7ab8..51c73ee6de1bf48c0417819f6bc9cdd8222981f4 100644
--- a/en/application-dev/reference/apis/js-apis-distributed-data.md
+++ b/en/application-dev/reference/apis/js-apis-distributed-data.md
@@ -3768,7 +3768,7 @@ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void
Synchronizes the KV store manually.
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -3778,9 +3778,9 @@ Synchronizes the KV store manually.
| Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------------------------- |
-| deviceIds | string[] | Yes | List of IDs of the devices in the same networking environment to be synchronized.|
+| deviceIds | string[] | Yes | List of **networkId**s of the devices in the same networking environment to be synchronized.|
| mode | [SyncMode](#syncmode) | Yes | Synchronization mode. |
-| delayMs | number | No | Allowed synchronization delay time, in ms. |
+| delayMs | number | No | Delay time allowed, in milliseconds. The default value is **0**. |
**Example**
@@ -3799,7 +3799,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
@@ -5246,7 +5246,7 @@ Synchronizes the KV store manually.
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -5256,7 +5256,7 @@ Synchronizes the KV store manually.
| Name | Type| Mandatory | Description |
| ----- | ------ | ---- | ----------------------- |
-| deviceIds |string[] | Yes |IDs of the devices to be synchronized.|
+| deviceIds |string[] | Yes |**networkId**s of the devices to be synchronized.|
| mode |[SyncMode](#syncmode) | Yes |Synchronization mode. |
| delayMs |number | No |Allowed synchronization delay time, in ms. The default value is **0**. |
@@ -5277,7 +5277,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
diff --git a/en/application-dev/reference/apis/js-apis-distributedKVStore.md b/en/application-dev/reference/apis/js-apis-distributedKVStore.md
index 117afe8d4f70bb034add259da1a09d3b58b680ba..3d2441aa70b66ffb01e9bc19eb0f38156f912e50 100644
--- a/en/application-dev/reference/apis/js-apis-distributedKVStore.md
+++ b/en/application-dev/reference/apis/js-apis-distributedKVStore.md
@@ -127,7 +127,7 @@ Enumerates the distributed KV store types.
| Name | Description |
| -------------------- | ------------------------------------------------------------ |
-| DEVICE_COLLABORATION | Device KV store.
The device KV store manages data by device, which eliminates conflicts. Data can be queried by device.
**System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore |
+| DEVICE_COLLABORATION | Device KV store.
The device KV store manages data by device, which eliminates conflicts. Data can be queried by device.
**System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore|
| SINGLE_VERSION | Single KV store.
The single KV store does not differentiate data by device. If entries with the same key are modified on different devices, the value will be overwritten.
**System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
## SecurityLevel
@@ -457,7 +457,7 @@ try {
kvStore = store;
kvStore = null;
store = null;
- kvManager.closeKVStore('appId', 'storeId', function (err, data) {
+ kvManager.closeKVStore('appId', 'storeId', function (err) {
if (err != undefined) {
console.error(`Failed to close KVStore.code is ${err.code},message is ${err.message}`);
return;
@@ -568,7 +568,7 @@ try {
kvStore = store;
kvStore = null;
store = null;
- kvManager.deleteKVStore('appId', 'storeId', function (err, data) {
+ kvManager.deleteKVStore('appId', 'storeId', function (err) {
if (err != undefined) {
console.error(`Failed to delete KVStore.code is ${err.code},message is ${err.message}`);
return;
@@ -2128,7 +2128,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -2182,8 +2182,8 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting.data=${data}`);
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
}).catch((err) => {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
});
@@ -2239,7 +2239,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -2311,7 +2311,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (entries) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries');
@@ -2372,7 +2372,7 @@ try {
v8Arr.push(vb1);
v8Arr.push(vb2);
v8Arr.push(vb3);
- kvStore.putBatch(v8Arr, async function (err, data) {
+ kvStore.putBatch(v8Arr, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -2434,7 +2434,7 @@ try {
v8Arr.push(vb1);
v8Arr.push(vb2);
v8Arr.push(vb3);
- kvStore.putBatch(v8Arr).then(async (data) => {
+ kvStore.putBatch(v8Arr).then(async () => {
console.info(`Succeeded in putting patch`);
}).catch((err) => {
console.error(`putBatch fail.code is ${err.code},message is ${err.message}`);
@@ -2480,13 +2480,13 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
}
console.info('Succeeded in putting');
- kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
return;
@@ -2540,9 +2540,9 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting: ${data}`);
- kvStore.delete(KEY_TEST_STRING_ELEMENT).then((data) => {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
+ kvStore.delete(KEY_TEST_STRING_ELEMENT).then(() => {
console.info('Succeeded in deleting');
}).catch((err) => {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
@@ -2595,13 +2595,13 @@ try {
let predicates = new dataSharePredicates.DataSharePredicates();
let arr = ["name"];
predicates.inKeys(arr);
- kvStore.put("name", "bob", function (err, data) {
+ kvStore.put("name", "bob", function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
}
console.info("Succeeded in putting");
- kvStore.delete(predicates, function (err, data) {
+ kvStore.delete(predicates, function (err) {
if (err == undefined) {
console.info('Succeeded in deleting');
} else {
@@ -2660,9 +2660,9 @@ try {
let predicates = new dataSharePredicates.DataSharePredicates();
let arr = ["name"];
predicates.inKeys(arr);
- kvStore.put("name", "bob").then((data) => {
- console.info(`Succeeded in putting: ${data}`);
- kvStore.delete(predicates).then((data) => {
+ kvStore.put("name", "bob").then(() => {
+ console.info(`Succeeded in putting data`);
+ kvStore.delete(predicates).then(() => {
console.info('Succeeded in deleting');
}).catch((err) => {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
@@ -2724,13 +2724,13 @@ try {
keys.push(key + i);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
}
console.info('Succeeded in putting Batch');
- kvStore.deleteBatch(keys, async function (err, data) {
+ kvStore.deleteBatch(keys, async function (err) {
if (err != undefined) {
console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -2797,9 +2797,9 @@ try {
keys.push(key + i);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (data) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
- kvStore.deleteBatch(keys).then((err) => {
+ kvStore.deleteBatch(keys).then(() => {
console.info('Succeeded in deleting Batch');
}).catch((err) => {
console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`);
@@ -2845,10 +2845,10 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) {
console.info('Succeeded in putting data');
const deviceid = 'no_exist_device_id';
- kvStore.removeDeviceData(deviceid, async function (err, data) {
+ kvStore.removeDeviceData(deviceid, async function (err) {
if (err == undefined) {
console.info('succeeded in removing device data');
} else {
@@ -2902,13 +2902,13 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-001';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((err) => {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info('Succeeded in putting data');
}).catch((err) => {
console.error(`Failed to put data.code is ${err.code},message is ${err.message} `);
});
const deviceid = 'no_exist_device_id';
- kvStore.removeDeviceData(deviceid).then((err) => {
+ kvStore.removeDeviceData(deviceid).then(() => {
console.info('succeeded in removing device data');
}).catch((err) => {
console.error(`Failed to remove device data.code is ${err.code},message is ${err.message} `);
@@ -2954,7 +2954,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -3009,8 +3009,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting data.data=${data}`);
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => {
console.info(`Succeeded in getting data.data=${data}`);
}).catch((err) => {
@@ -3065,7 +3065,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -3132,7 +3132,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (entries) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries');
@@ -3190,7 +3190,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -3256,7 +3256,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -3317,7 +3317,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -3330,7 +3330,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -3391,7 +3391,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -3402,7 +3402,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -3454,7 +3454,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -3522,7 +3522,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -3583,7 +3583,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -3643,7 +3643,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -3673,7 +3673,7 @@ Closes the **KVStoreResultSet** object returned by [SingleKvStore.getResultSet](
```js
try {
let resultSet = null;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err == undefined) {
console.info('Succeeded in closing result set');
} else {
@@ -3760,7 +3760,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -3822,7 +3822,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -3867,11 +3867,11 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.backup(file, (err, data) => {
+ kvStore.backup(file, function(err) => {
if (err) {
console.error(`Failed to backup.code is ${err.code},message is ${err.message} `);
} else {
- console.info(`Succeeded in backupping data.data=${data}`);
+ console.info(`Succeeded in backupping data`);
}
});
} catch (e) {
@@ -3912,8 +3912,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.backup(file).then((data) => {
- console.info(`Succeeded in backupping data.data=${data}`);
+ kvStore.backup(file).then(() => {
+ console.info(`Succeeded in backupping data`);
}).catch((err) => {
console.error(`Failed to backup.code is ${err.code},message is ${err.message}`);
});
@@ -3950,11 +3950,11 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.restore(file, (err, data) => {
+ kvStore.restore(file, (err) => {
if (err) {
console.error(`Failed to restore.code is ${err.code},message is ${err.message}`);
} else {
- console.info(`Succeeded in restoring data.data=${data}`);
+ console.info(`Succeeded in restoring data`);
}
});
} catch (e) {
@@ -3995,8 +3995,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.restore(file).then((data) => {
- console.info(`Succeeded in restoring data.data=${data}`);
+ kvStore.restore(file).then(() => {
+ console.info(`Succeeded in restoring data`);
}).catch((err) => {
console.error(`Failed to restore.code is ${err.code},message is ${err.message}`);
});
@@ -4124,7 +4124,7 @@ try {
console.info(`startTransaction 0 ${data}`);
count++;
});
- kvStore.startTransaction(async function (err, data) {
+ kvStore.startTransaction(async function (err) {
if (err != undefined) {
console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`);
return;
@@ -4132,7 +4132,7 @@ try {
console.info('Succeeded in starting Transaction');
let entries = putBatchString(10, 'batch_test_string_key');
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -4182,7 +4182,7 @@ try {
console.info(`startTransaction 0 ${data}`);
count++;
});
- kvStore.startTransaction().then(async (err) => {
+ kvStore.startTransaction().then(async () => {
console.info('Succeeded in starting Transaction');
}).catch((err) => {
console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`);
@@ -4218,7 +4218,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.commit(function (err, data) {
+ kvStore.commit(function (err) {
if (err == undefined) {
console.info('Succeeded in committing');
} else {
@@ -4256,7 +4256,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.commit().then(async (err) => {
+ kvStore.commit().then(async () => {
console.info('Succeeded in committing');
}).catch((err) => {
console.error(`Failed to commit.code is ${err.code},message is ${err.message}`);
@@ -4292,7 +4292,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.rollback(function (err,data) {
+ kvStore.rollback(function (err) {
if (err == undefined) {
console.info('Succeeded in rolling back');
} else {
@@ -4330,7 +4330,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.rollback().then(async (err) => {
+ kvStore.rollback().then(async () => {
console.info('Succeeded in rolling back');
}).catch((err) => {
console.error(`Failed to rollback.code is ${err.code},message is ${err.message}`);
@@ -4359,7 +4359,7 @@ Sets data synchronization, which can be enabled or disabled. This API uses an as
```js
try {
- kvStore.enableSync(true, function (err, data) {
+ kvStore.enableSync(true, function (err) {
if (err == undefined) {
console.info('Succeeded in enabling sync');
} else {
@@ -4395,7 +4395,7 @@ Sets data synchronization, which can be enabled or disabled. This API uses a pro
```js
try {
- kvStore.enableSync(true).then((err) => {
+ kvStore.enableSync(true).then(() => {
console.info('Succeeded in enabling sync');
}).catch((err) => {
console.error(`Failed to enable sync.code is ${err.code},message is ${err.message}`);
@@ -4427,7 +4427,7 @@ Sets the data synchronization range. This API uses an asynchronous callback to r
try {
const localLabels = ['A', 'B'];
const remoteSupportLabels = ['C', 'D'];
- kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err, data) {
+ kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err) {
if (err != undefined) {
console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`);
return;
@@ -4466,7 +4466,7 @@ Sets the data synchronization range. This API uses a promise to return the resul
try {
const localLabels = ['A', 'B'];
const remoteSupportLabels = ['C', 'D'];
- kvStore.setSyncRange(localLabels, remoteSupportLabels).then((err) => {
+ kvStore.setSyncRange(localLabels, remoteSupportLabels).then(() => {
console.info('Succeeded in setting syncRange');
}).catch((err) => {
console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`);
@@ -4496,7 +4496,7 @@ Sets the default delay allowed for KV store synchronization. This API uses an as
```js
try {
const defaultAllowedDelayMs = 500;
- kvStore.setSyncParam(defaultAllowedDelayMs, function (err, data) {
+ kvStore.setSyncParam(defaultAllowedDelayMs, function (err) {
if (err != undefined) {
console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`);
return;
@@ -4533,7 +4533,7 @@ Sets the default delay allowed for KV store synchronization. This API uses a pro
```js
try {
const defaultAllowedDelayMs = 500;
- kvStore.setSyncParam(defaultAllowedDelayMs).then((err) => {
+ kvStore.setSyncParam(defaultAllowedDelayMs).then(() => {
console.info('Succeeded in setting syncParam');
}).catch((err) => {
console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`);
@@ -4550,7 +4550,7 @@ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void
Synchronizes the KV store manually. For details about the synchronization modes of KV stores, see [Cross-Device Synchronization of KV Stores](../../database/data-sync-of-kv-store.md).
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -4560,7 +4560,7 @@ Synchronizes the KV store manually. For details about the synchronization modes
| Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------------------------- |
-| deviceIds | string[] | Yes | List of IDs of the devices in the same networking environment to be synchronized.|
+| deviceIds | string[] | Yes | List of **networkId**s of the devices in the same networking environment to be synchronized.|
| mode | [SyncMode](#syncmode) | Yes | Synchronization mode. |
| delayMs | number | No | Allowed synchronization delay time, in ms. The default value is **0**. |
@@ -4589,14 +4589,14 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
kvStore.on('syncComplete', function (data) {
console.info('Sync dataChange');
});
- kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to sync.code is ${err.code},message is ${err.message}`);
return;
@@ -4619,7 +4619,7 @@ sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void
Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of KV stores, see [Cross-Device Synchronization of KV Stores](../../database/data-sync-of-kv-store.md).
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -4629,7 +4629,7 @@ Synchronizes the KV store manually. This API returns the result synchronously. F
| Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------------------------- |
-| deviceIds | string[] | Yes | List of IDs of the devices in the same networking environment to be synchronized.|
+| deviceIds | string[] | Yes | List of **networkId**s of the devices in the same networking environment to be synchronized.|
| mode | [SyncMode](#syncmode) | Yes | Synchronization mode. |
| query | [Query](#query) | Yes | **Query** object to match. |
| delayMs | number | No | Allowed synchronization delay time, in ms. The default value is **0**.|
@@ -4659,14 +4659,14 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
kvStore.on('syncComplete', function (data) {
console.info('Sync dataChange');
});
- kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to sync.code is ${err.code},message is ${err.message}`);
return;
@@ -4735,7 +4735,7 @@ Subscribes to synchronization complete events.
| Name | Type | Mandatory| Description |
| ------------ | --------------------------------------------- | ---- | ------------------------------------------------------ |
| event | string | Yes | Event to subscribe to. The value is **syncComplete**, which indicates a synchronization complete event.|
-| syncCallback | Callback<Array<[string, number]>> | Yes | Callback invoked to return the synchronization complete event.|
+| syncCallback | Callback<Array<[string, number]>> | Yes | Callback invoked to return the synchronization complete event. |
**Example**
@@ -4746,7 +4746,7 @@ try {
kvStore.on('syncComplete', function (data) {
console.info(`syncComplete ${data}`);
});
- kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then((data) => {
+ kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then(() => {
console.info('succeeded in putting');
}).catch((err) => {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
@@ -4969,7 +4969,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -5024,8 +5024,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting data.data=${data}`);
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => {
console.info(`Succeeded in getting data.data=${data}`);
}).catch((err) => {
@@ -5075,7 +5075,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -5135,7 +5135,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async (data) => {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async () => {
console.info('Succeeded in putting');
kvStore.get('localDeviceId', KEY_TEST_STRING_ELEMENT).then((data) => {
console.info('Succeeded in getting');
@@ -5191,7 +5191,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5258,7 +5258,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (entries) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries');
@@ -5320,7 +5320,7 @@ try {
entries.push(entry);
}
console.info(`entries : ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5392,7 +5392,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entries) => {
console.info('Succeeded in getting entries');
@@ -5453,7 +5453,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -5519,7 +5519,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -5584,7 +5584,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5661,7 +5661,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
var query = new distributedKVStore.Query();
query.deviceId('localDeviceId');
@@ -5722,7 +5722,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5735,7 +5735,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -5796,7 +5796,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -5807,7 +5807,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -5859,7 +5859,7 @@ try {
}
console.info('Succeeded in getting resultSet');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return;
@@ -5918,7 +5918,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultSet.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing resultSet');
}).catch((err) => {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
@@ -5975,7 +5975,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5990,7 +5990,7 @@ try {
}
console.info('Succeeded in getting resultSet');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return;
@@ -6056,7 +6056,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -6071,7 +6071,7 @@ try {
});
query.deviceId('localDeviceId');
console.info("GetResultSet " + query.getSqlLike());
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing resultSet');
}).catch((err) => {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
@@ -6129,7 +6129,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -6194,7 +6194,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -6209,7 +6209,7 @@ try {
}
console.info('Succeeded in getting resultSet');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return;
@@ -6266,7 +6266,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -6326,7 +6326,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -6384,7 +6384,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -6449,7 +6449,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -6499,7 +6499,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -6561,7 +6561,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -6623,7 +6623,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -6695,7 +6695,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
diff --git a/en/application-dev/reference/apis/js-apis-distributedMissionManager.md b/en/application-dev/reference/apis/js-apis-distributedMissionManager.md
index 506b940eae2f206b9a1bb5a10a39350abcd99753..97bba800fdf3549c1e4b33bded39f481f98006ab 100644
--- a/en/application-dev/reference/apis/js-apis-distributedMissionManager.md
+++ b/en/application-dev/reference/apis/js-apis-distributedMissionManager.md
@@ -368,8 +368,8 @@ Continues a mission on a remote device. This API uses an asynchronous callback t
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | ----- |
-| parameter | [ContinueDeviceInfo](#js-apis-inner-application-continueDeviceInfo.md) | Yes | Parameters required for mission continuation.|
-| options | [ContinueCallback](#js-apis-inner-application-continueCallback.md) | Yes | Callback invoked when the mission continuation is complete.|
+| parameter | [ContinueDeviceInfo](js-apis-inner-application-continueDeviceInfo.md) | Yes | Parameters required for mission continuation.|
+| options | [ContinueCallback](js-apis-inner-application-continueCallback.md) | Yes | Callback invoked when the mission continuation is complete.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result.|
**Error codes**
@@ -426,8 +426,8 @@ Continues a mission on a remote device. This API uses a promise to return the re
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | ----- |
-| parameter | [ContinueDeviceInfo](#js-apis-inner-application-continueDeviceInfo.md) | Yes | Parameters required for mission continuation.|
-| options | [ContinueCallback](#js-apis-inner-application-continueCallback.md) | Yes | Callback invoked when the mission continuation is complete.|
+| parameter | [ContinueDeviceInfo](js-apis-inner-application-continueDeviceInfo.md) | Yes | Parameters required for mission continuation.|
+| options | [ContinueCallback](js-apis-inner-application-continueCallback.md) | Yes | Callback invoked when the mission continuation is complete.|
**Return value**
diff --git a/en/application-dev/reference/apis/js-apis-nfcController.md b/en/application-dev/reference/apis/js-apis-nfcController.md
index 4c55691b61cd60cb59543ae0881a719d5bb8fc1b..c9c909b93e7b345a99fd934078b76af6873d639a 100644
--- a/en/application-dev/reference/apis/js-apis-nfcController.md
+++ b/en/application-dev/reference/apis/js-apis-nfcController.md
@@ -176,7 +176,7 @@ Unsubscribes from the NFC state changes. The subscriber will not receive NFC sta
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **nfcStateChange**.|
-| callback | Callback<[NfcState](#nfcstate)> | No| Callback for the NFC state changes. This parameter can be left blank.|
+| callback | Callback<[NfcState](#nfcstate)> | No| Callback for the NFC state changes. This parameter can be left blank. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-nfcTag.md b/en/application-dev/reference/apis/js-apis-nfcTag.md
index f7f5b2b9362ed875d776c645be7d596de2755bfd..747e536b1a518b806f5df66f1efc2288d0c5bb80 100644
--- a/en/application-dev/reference/apis/js-apis-nfcTag.md
+++ b/en/application-dev/reference/apis/js-apis-nfcTag.md
@@ -53,6 +53,7 @@ Before developing applications related to tag read and write, you must declare N
> - The **name** field under **metadata** is mandatory. It must be **tag-tech** and cannot be changed.
> - The **value** field under **metadata** is mandatory. It can be **NfcA**, **NfcB**, **NfcF**, **NfcV**, **IsoDep**, **Ndef**, **MifareClassic**, **MifareUL**, **NdefFormatable** or any of their combinations. Incorrect settings of this field will cause a parsing failure.
> - The **name** field under **requestPermissions** is mandatory. It must be **ohos.permission.NFC_TAG** and cannot be changed.
+
## **Modules to Import**
```js
@@ -98,7 +99,7 @@ onCreate(want, launchParam) {
if (isNfcATag) {
var nfcA;
try {
- nfcA = tag.getNfcATag(taginfo);
+ nfcA = tag.getNfcATag(tagInfo);
} catch (error) {
console.log("tag.getNfcATag caught error: " + error);
}
@@ -109,7 +110,7 @@ onCreate(want, launchParam) {
if (isIsoDepTag) {
var isoDep;
try {
- isoDep = tag.getIsoDep(taginfo);
+ isoDep = tag.getIsoDep(tagInfo);
} catch (error) {
console.log("tag.getIsoDep caught error: " + error);
}
@@ -139,8 +140,8 @@ Obtains an **NfcATag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description**|
-| -------- | -------- |
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
| [NfcATag](js-apis-nfctech.md#nfcatag) | **NfcATag** object obtained.|
## tag.getNfcA9+
@@ -159,16 +160,16 @@ Obtains an **NfcATag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description**|
-| -------- | -------- |
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
| [NfcATag](js-apis-nfctech.md#nfcatag) | **NfcATag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getNfcBTag
@@ -190,9 +191,9 @@ Obtains an **NfcBTag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description** |
-| -------- | ---------------- |
-| [NfcBTag](js-apis-nfctech.md#nfcbtag) | **NfcBTag** object obtained.|
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
+| [NfcBTag](js-apis-nfctech.md#nfcbtag) | **NfcBTag** object obtained.|
## tag.getNfcB9+
@@ -210,16 +211,16 @@ Obtains an **NfcBTag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description** |
-| -------- | ---------------- |
-| [NfcBTag](js-apis-nfctech.md#nfcbtag) | **NfcBTag** object obtained.|
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
+| [NfcBTag](js-apis-nfctech.md#nfcbtag) | **NfcBTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getNfcFTag
@@ -241,9 +242,9 @@ Obtains an **NfcFTag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description** |
-| -------- | ---------------- |
-| [NfcFTag](js-apis-nfctech.md#nfcftag) | **NfcFTag** object obtained.|
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
+| [NfcFTag](js-apis-nfctech.md#nfcftag) | **NfcFTag** object obtained.|
## tag.getNfcF9+
@@ -261,16 +262,16 @@ Obtains an **NfcFTag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description** |
-| -------- | ---------------- |
-| [NfcFTag](js-apis-nfctech.md#nfcftag) | **NfcFTag** object obtained.|
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
+| [NfcFTag](js-apis-nfctech.md#nfcftag) | **NfcFTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getNfcVTag
@@ -292,9 +293,9 @@ Obtains an **NfcVTag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description** |
-| -------- | ---------------- |
-| [NfcVTag](js-apis-nfctech.md#nfcvtag) | **NfcVTag** object obtained.|
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
+| [NfcVTag](js-apis-nfctech.md#nfcvtag) | **NfcVTag** object obtained.|
## tag.getNfcV9+
@@ -312,16 +313,16 @@ Obtains an **NfcVTag** object, which allows access to the tags that use the NFC-
**Return value**
-| **Type**| **Description** |
-| -------- | ---------------- |
-| [NfcVTag](js-apis-nfctech.md#nfcvtag) | **NfcVTag** object obtained.|
+| **Type** | **Description** |
+| ------------------------------------- | ------------- |
+| [NfcVTag](js-apis-nfctech.md#nfcvtag) | **NfcVTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getIsoDep9+
@@ -334,22 +335,22 @@ Obtains an **IsoDepTag** object, which allows access to the tags that use the IS
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------------------------------- |
-| taginfo | [TagInfo](#taginfo) | Yes| Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**. |
+| Name | Type | Mandatory | Description |
+| ------- | ------------------- | ---- | ---------------------------------------- |
+| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**.|
**Return value**
-| **Type**| **Description** |
-| ---------- | ------------------|
-| [IsoDepTag](js-apis-nfctech.md#isodeptag9) | **IsoDepTag** object obtained.|
+| **Type** | **Description** |
+| ---------------------------------------- | ----------------------------------- |
+| [IsoDepTag](js-apis-nfctech.md#isodeptag9) | **IsoDepTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getNdef9+
@@ -362,27 +363,27 @@ Obtains an **NdefTag** object, which allows access to the tags in the NFC Data E
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------------------------------- |
-| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**. |
+| Name | Type | Mandatory | Description |
+| ------- | ------------------- | ---- | ---------------------------------------- |
+| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**.|
**Return value**
-| **Type**| **Description** |
-| ---------| -------------- |
-| [NdefTag](js-apis-nfctech.md#ndeftag9) | **NdefTag** object obtained.|
+| **Type** | **Description** |
+| -------------------------------------- | ------------------------------- |
+| [NdefTag](js-apis-nfctech.md#ndeftag9) | **NdefTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getMifareClassic9+
-getMifareClassic(tagInfo: [TagInfo](#taginfo)): [MifareClassicTag](js-apis-nfctech.md#mifareclassictag-9)
+getMifareClassic(tagInfo: [TagInfo](#taginfo)): [MifareClassicTag](js-apis-nfctech.md#mifareclassictag9)
Obtains a **MifareClassicTag** object, which allows access to the tags that use MIFARE Classic.
@@ -390,22 +391,22 @@ Obtains a **MifareClassicTag** object, which allows access to the tags that use
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------------------------------- |
-| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**. |
+| Name | Type | Mandatory | Description |
+| ------- | ------------------- | ---- | ---------------------------------------- |
+| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**.|
**Return value**
-| **Type**| **Description** |
-| ----------------- | ------------------------|
-| [MifareClassicTag](js-apis-nfctech.md#mifareclassictag-9) | **MifareClassicTag** object obtained.|
+| **Type** | **Description** |
+| ---------------------------------------- | ---------------------------------------- |
+| [MifareClassicTag](js-apis-nfctech.md#mifareclassictag-9) | **MifareClassicTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getMifareUltralight9+
@@ -417,22 +418,22 @@ Obtains a **MifareUltralightTag** object, which allows access to the tags that u
**System capability**: SystemCapability.Communication.NFC.Tag
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------------------------------- |
-| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**. |
+| Name | Type | Mandatory | Description |
+| ------- | ------------------- | ---- | ---------------------------------------- |
+| taginfo | [TagInfo](#taginfo) | Yes | Tag information including the technology type and related parameters, which are obtained from **tag.getTagInfo(want: Want)**.|
**Return value**
-| **Type**| **Description** |
-| -------------------- | ---------------------------|
-| [MifareUltralightTag](js-apis-nfctech.md#mifareultralighttag9) | **MifareUltralightTag** object obtained.|
+| **Type** | **Description** |
+| ---------------------------------------- | ---------------------------------------- |
+| [MifareUltralightTag](js-apis-nfctech.md#mifareultralighttag9) | **MifareUltralightTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getNdefFormatable9+
@@ -445,16 +446,16 @@ Obtains an **NdefFormatableTag** object, which allows access to the tags that ar
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
-| [NdefFormatableTag](js-apis-nfctech.md#ndefformatabletag) | **NdefFormatableTag** object obtained.|
+| **Type** | **Description** |
+| ---------------------------------------- | ---------------------------------------- |
+| [NdefFormatableTag](js-apis-nfctech.md#ndefformatabletag) | **NdefFormatableTag** object obtained.|
**Error codes**
For details about the error codes, see [NFC Error Codes](../errorcodes/errorcode-nfc.md).
-| ID| Error Message|
-| ------- | -------|
+| ID | Error Message |
+| ------- | ---------------------------------------- |
| 3100201 | Tag running state is abnormal in service. |
## tag.getTagInfo9+
@@ -467,14 +468,14 @@ Obtains **TagInfo** from **Want**, which is initialized by the NFC service and c
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------------------------- | ---- | ---------------------------------------- |
-| want | [Want](js-apis-app-ability-want.md#Want) | Yes | Data obtained from the parameters of the **onCreate** entry function when an ability is dispatched. |
+| Name | Type | Mandatory | Description |
+| ---- | ---------------------------------------- | ---- | --------------------------------- |
+| want | [Want](js-apis-app-ability-want.md#Want) | Yes | Data obtained from the parameters of the **onCreate** entry function when an ability is dispatched.|
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| ------------------- | --------------------------- |
| [TagInfo](#taginfo) | **TagInfo** object obtained.|
@@ -488,14 +489,14 @@ Creates an NDEF record based on the specified URI.
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------------- |
-| uri | string | Yes| Data to write to the NDEF record.|
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ---------------------- |
+| uri | string | Yes | Data to write to the NDEF record.|
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| -------------------------- | ---------------------------------------- |
| [NdefRecord](#ndefrecord9) | NDEF record created. For details, see *NFCForum-TS-NDEF_1.0*.|
**Example**
@@ -527,15 +528,15 @@ Creates an NDEF record based on the specified text data and encoding type.
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------------- |
-| text | string | Yes | Text to write to the NDEF record.|
-| locale | string | Yes | Encoding mode of the text.|
+| Name | Type | Mandatory | Description |
+| ------ | ------ | ---- | ------------------------ |
+| text | string | Yes | Text to write to the NDEF record.|
+| locale | string | Yes | Encoding mode of the text. |
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| -------------------------- | ---------------------------------------- |
| [NdefRecord](#ndefrecord9) | NDEF record created. For details, see *NFCForum-TS-NDEF_1.0*.|
**Example**
@@ -569,15 +570,15 @@ Creates an NDEF record based on the specified MIME data and type.
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------------- |
-| mimeType | string | Yes | MIME type that complies with RFC rules, for example, **text/plain** or **image/jpeg**.|
-| mimeData | number[] | Yes | MIME data, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
+| Name | Type | Mandatory | Description |
+| -------- | -------- | ---- | ---------------------------------------- |
+| mimeType | string | Yes | MIME type that complies with RFC rules, for example, **text/plain** or **image/jpeg**.|
+| mimeData | number[] | Yes | MIME data, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**. |
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| -------------------------- | ---------------------------------------- |
| [NdefRecord](#ndefrecord9) | NDEF record created. For details, see *NFCForum-TS-NDEF_1.0*.|
**Example**
@@ -609,16 +610,16 @@ Creates an NDEF record based on application-specific data.
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------------- |
-| domainName | string | Yes | Bundle name of the application or domain name of the organization that releases the applications.|
-| type | string | Yes | Type of the application data.|
-| externalData | number[] | Yes | Application data, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
+| Name | Type | Mandatory | Description |
+| ------------ | -------- | ---- | ----------------------------------- |
+| domainName | string | Yes | Bundle name of the application or domain name of the organization that releases the applications. |
+| type | string | Yes | Type of the application data. |
+| externalData | number[] | Yes | Application data, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| -------------------------- | ---------------------------------------- |
| [NdefRecord](#ndefrecord9) | NDEF record created. For details, see *NFCForum-TS-NDEF_1.0*.|
**Example**
@@ -652,14 +653,14 @@ Converts an NDEF message to bytes.
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------------- |
-| ndefMessage | [NdefMessage](js-apis-nfctech.md#ndefmessage9) | Yes | NDEF message to convert.|
+| Name | Type | Mandatory | Description |
+| ----------- | ---------------------------------------- | ---- | ----------- |
+| ndefMessage | [NdefMessage](js-apis-nfctech.md#ndefmessage9) | Yes | NDEF message to convert.|
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| -------- | ---------------------------------------- |
| number[] | NDEF message in bytes, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
**Example**
@@ -693,14 +694,14 @@ Creates an NDEF message from raw byte data. The data must comply with the NDEF r
**Parameters**
-| **Name**| **Type**| **Mandatory**| **Description**|
-| -------- | -------- | -------- | -------- |
-| data | number[] | Yes| Raw byte data, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**. The data must comply with the NDEF record format.|
+| **Name**| **Type** | **Mandatory**| **Description** |
+| ------- | -------- | ------ | ---------------------------------------- |
+| data | number[] | Yes | Raw byte data, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**. The data must comply with the NDEF record format.|
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| ---------------------------------------- | ---------------------------------------- |
| [NdefMessage](js-apis-nfctech.md#ndefmessage9) | NDEF message created. For details, see *NFCForum-TS-NDEF_1.0*.|
**Example**
@@ -727,14 +728,14 @@ Creates an NDEF message from the NDEF records list.
**Parameters**
-| **Name**| **Type**| **Mandatory**| **Description**|
-| -------- | -------- | -------- | -------- |
-| ndefRecords | [NdefRecord](js-apis-nfcTag.md#ndefrecord9)[] | Yes| NDEF record list used to create the NDEF message. For details, see *NFCForum-TS-NDEF_1.0*.|
+| **Name** | **Type** | **Mandatory**| **Description** |
+| ----------- | ---------------------------------------- | ------ | ---------------------------------------- |
+| ndefRecords | [NdefRecord](js-apis-nfcTag.md#ndefrecord9)[] | Yes | NDEF record list used to create the NDEF message. For details, see *NFCForum-TS-NDEF_1.0*.|
**Return value**
-| **Type**| **Description** |
-| ------------------ | --------------------------|
+| **Type** | **Description** |
+| ---------------------------------------- | ---------------------------------------- |
| [NdefMessage](js-apis-nfctech.md#ndefmessage9) | NDEF message created. For details, see *NFCForum-TS-NDEF_1.0*.|
**Example**
@@ -762,67 +763,66 @@ Defines the **TagInfo** object, which provides information about the tag technol
**Required permissions**: ohos.permission.NFC_TAG
-| **Name**| **Type**| **Readable**| **Writable**| **Description**|
-| -------- | -------- | -------- | -------- | -------- |
-| uid9+ | number[] | Yes| No| Tag unique identifier (UID), which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
-| technology9+ | number[] | Yes| No| Supported technologies. Each number is a constant indicating the supported technology.|
-| supportedProfiles | number[] | Yes| No| Supported profiles. This parameter is not supported since API version 9. Use [technology](#taginfo).|
-| extrasData9+ | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap)[] | Yes| No| Extended attribute value of the tag technology.
**System API**: This is a system API.|
-| tagRfDiscId9+ | number | Yes| No| ID allocated when the tag is discovered.
**System API**: This is a system API.|
-| remoteTagService9+ | [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | Yes| No| Remote object of the NFC service process used for interface communication between the client and the service.
**System API**: This is a system API.|
-
+| **Name** | **Type** | **Readable**| **Writable**| **Description** |
+| ----------------------------- | ---------------------------------------- | ------ | ------ | ---------------------------------------- |
+| uid9+ | number[] | Yes | No | Tag unique identifier (UID), which consists of hexadecimal numbers ranging from **0x00** to **0xFF**. |
+| technology9+ | number[] | Yes | No | Supported technologies. Each number is a constant indicating the supported technology. |
+| supportedProfiles | number[] | Yes | No | Supported profiles. This parameter is not supported since API version 9. Use [tag.TagInfo#technology](#tagtaginfo) instead.|
+| extrasData9+ | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#pacmap)[] | Yes | No | Extended attribute value of the tag technology.
**System API**: This is a system API. |
+| tagRfDiscId9+ | number | Yes | No | ID allocated when the tag is discovered.
**System API**: This is a system API. |
+| remoteTagService9+ | [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | Yes | No | Remote object of the NFC service process used for interface communication between the client and the service.
**System API**: This is a system API.|
## NdefRecord9+
Defines an NDEF record. For details, see *NFCForum-TS-NDEF_1.0*.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Type**| **Readable**| **Writable**| **Description**|
-| -------- | -------- | -------- | -------- | -------- |
-| tnf | number | Yes| No| Type name field (TNF) of the NDEF record.|
-| rtdType| number[] | Yes| No| Record type definition (RTD) of the NDEF record. It consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
-| id | number[] | Yes| No| NDEF record ID, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
-| payload | number[] | Yes| No| NDEF payload, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
+| **Name** | **Type** | **Readable**| **Writable**| **Description** |
+| ------- | -------- | ------ | ------ | ---------------------------------------- |
+| tnf | number | Yes | No | Type name field (TNF) of the NDEF record. |
+| rtdType | number[] | Yes | No | Record type definition (RTD) of the NDEF record. It consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
+| id | number[] | Yes | No | NDEF record ID, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
+| payload | number[] | Yes | No | NDEF payload, which consists of hexadecimal numbers ranging from **0x00** to **0xFF**.|
## Technology Type Definition
Enumerates the tag technology types.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| NFC_A | 1 | NFC-A (ISO 14443-3A).|
+| **Name** | **Value**| **Description** |
+| ---------------------------- | ----- | ------------------------ |
+| NFC_A | 1 | NFC-A (ISO 14443-3A). |
| NFC_B | 2 | NFC-B (ISO 14443-3B).|
-| ISO_DEP | 3 | ISO-DEP (ISO 14443-4).|
-| NFC_F | 4 | NFC-F (JIS 6319-4).|
-| NFC_V | 5 | NFC-V (ISO 15693).|
-| NDEF | 6 | NDEF.|
-| NDEF_FORMATABLE9+ | 7 | NDEF formattable.|
-| MIFARE_CLASSIC | 8 | MIFARE Classic.|
-| MIFARE_ULTRALIGHT | 9 | MIFARE Ultralight.|
+| ISO_DEP | 3 | ISO-DEP (ISO 14443-4).|
+| NFC_F | 4 | NFC-F (JIS 6319-4). |
+| NFC_V | 5 | NFC-V (ISO 15693). |
+| NDEF | 6 | NDEF. |
+| NDEF_FORMATABLE9+ | 7 | NDEF formattable. |
+| MIFARE_CLASSIC | 8 | MIFARE Classic. |
+| MIFARE_ULTRALIGHT | 9 | MIFARE Ultralight. |
## TnfType9+
Enumerates the TNF types. For details, see *NFCForum-TS-NDEF_1.0*.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| TNF_EMPTY | 0x0 | Empty.|
-| TNF_WELL_KNOWN | 0x1 | NFC Forum Well Known Type [NFC RTD].|
-| TNF_MEDIA | 0x2 | Media-type as defined in RFC 2046 [RFC 2046].|
-| TNF_ABSOLUTE_URI | 0x3 | Absolute URI as defined in RFC 3986 [RFC 3986].|
-| TNF_EXT_APP | 0x4 | NFC Forum external type [NFC RTD].|
-| TNF_UNKNOWN | 0x5 | Unknown.|
-| TNF_UNCHANGED | 0x6 | Unchanged (see section 2.3.3 in *NFCForum-TS-NDEF_1.0*).|
+| **Name** | **Value**| **Description** |
+| ---------------- | ----- | ---------------------------------------- |
+| TNF_EMPTY | 0x0 | Empty. |
+| TNF_WELL_KNOWN | 0x1 | NFC Forum Well Known Type [NFC RTD]. |
+| TNF_MEDIA | 0x2 | Media-type as defined in RFC 2046 [RFC 2046].|
+| TNF_ABSOLUTE_URI | 0x3 | Absolute URI as defined in RFC 3986 [RFC 3986].|
+| TNF_EXT_APP | 0x4 | NFC Forum external type [NFC RTD]. |
+| TNF_UNKNOWN | 0x5 | Unknown. |
+| TNF_UNCHANGED | 0x6 | Unchanged (see section 2.3.3 in *NFCForum-TS-NDEF_1.0*). |
## NDEF Record RTD
Enumerates the NDEF record types. For details about the RTD, see *NFCForum-TS-NDEF_1.0*.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| RTD_TEXT9+ | [0x54] | NDEF record of the text type.|
+| **Name** | **Value** | **Description** |
+| --------------------- | ------ | ------------------ |
+| RTD_TEXT9+ | [0x54] | NDEF record of the text type. |
| RTD_URI9+ | [0x55] | NDEF record of the URI type.|
## NfcForumType9+
@@ -830,46 +830,47 @@ Enumerates the NFC Forum tag types.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| NFC_FORUM_TYPE_1 | 1 | NFC Forum tag type 1.|
-| NFC_FORUM_TYPE_2 | 2 | NFC Forum tag type 2.|
-| NFC_FORUM_TYPE_3 | 3 | NFC Forum tag type 3.|
-| NFC_FORUM_TYPE_4 | 4 | NFC Forum tag type 4.|
-| MIFARE_CLASSIC | 101 | MIFARE Classic.|
+| **Name** | **Value**| **Description** |
+| ---------------- | ----- | ----------------- |
+| NFC_FORUM_TYPE_1 | 1 | NFC Forum tag type 1. |
+| NFC_FORUM_TYPE_2 | 2 | NFC Forum tag type 2. |
+| NFC_FORUM_TYPE_3 | 3 | NFC Forum tag type 3. |
+| NFC_FORUM_TYPE_4 | 4 | NFC Forum tag type 4. |
+| MIFARE_CLASSIC | 101 | MIFARE Classic.|
## MifareClassicType9+
Enumerates the MIFARE Classic tag types.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| TYPE_UNKNOWN | 0 | Unknown type.|
-| TYPE_CLASSIC | 1 | MIFARE Classic.|
-| TYPE_PLUS | 2 | MIFARE Plus.|
-| TYPE_PRO | 3 | MIFARE Pro.|
+| **Name** | **Value**| **Description** |
+| ------------ | ----- | ----------------- |
+| TYPE_UNKNOWN | 0 | Unknown type. |
+| TYPE_CLASSIC | 1 | MIFARE Classic.|
+| TYPE_PLUS | 2 | MIFARE Plus. |
+| TYPE_PRO | 3 | MIFARE Pro. |
## MifareClassicSize9+
Enumerates the sizes of a MIFARE Classic tag.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| MC_SIZE_MINI | 320 | Each tag has 5 sectors, and each sector has 4 blocks.|
-| MC_SIZE_1K | 1024 | Each tag has 16 sectors, and each sector has 4 blocks.|
-| MC_SIZE_2K | 2048 | Each tag has 32 sectors, and each sector has 4 blocks.|
-| MC_SIZE_4K | 4096 | Each tag has 40 sectors, and each sector has 4 blocks.|
+| **Name** | **Value**| **Description** |
+| ------------ | ----- | ------------------ |
+| MC_SIZE_MINI | 320 | Each tag has 5 sectors, and each sector has 4 blocks. |
+| MC_SIZE_1K | 1024 | Each tag has 16 sectors, and each sector has 4 blocks.|
+| MC_SIZE_2K | 2048 | Each tag has 32 sectors, and each sector has 4 blocks.|
+| MC_SIZE_4K | 4096 | Each tag has 40 sectors, and each sector has 4 blocks.|
## MifareUltralightType9+
Enumerates the MIFARE Ultralight tag types.
**System capability**: SystemCapability.Communication.NFC.Tag
-| **Name**| **Value**| **Description**|
-| -------- | -------- | -------- |
-| TYPE_UNKNOWN | 0 | Unknown type.|
-| TYPE_ULTRALIGHT | 1 | MIFARE Ultralight.|
-| TYPE_ULTRALIGHT_C | 2 | MIFARE Ultralight C.|
+| **Name** | **Value**| **Description** |
+| ----------------- | ----- | ---------------------- |
+| TYPE_UNKNOWN | 0 | Unknown type. |
+| TYPE_ULTRALIGHT | 1 | MIFARE Ultralight. |
+| TYPE_ULTRALIGHT_C | 2 | MIFARE Ultralight C.|
+
\ No newline at end of file
diff --git a/en/application-dev/reference/apis/js-apis-osAccount.md b/en/application-dev/reference/apis/js-apis-osAccount.md
index ff49d8d1d84f03186de36aca3665b5729486bafe..ed266a44339d9af7e1cdb351dd305cf225a0b7d1 100644
--- a/en/application-dev/reference/apis/js-apis-osAccount.md
+++ b/en/application-dev/reference/apis/js-apis-osAccount.md
@@ -2433,7 +2433,7 @@ Unsubscribes from the OS account activation states, including the states of the
| -------- | -------------------------- | ---- | ------------------------------------------------------------ |
| type | 'activate' \| 'activating' | Yes | Type of the event to unsubscribe from. The value **activate** means an event indicating that an OS account is activated, and **activating** means an event indicating that an OS account is being activated.|
| name | string | Yes | Subscription name, which can be customized. The value cannot be empty or exceed 1024 bytes, and must be the same as the value passed by **on()**.|
-| callback | Callback<number> | No | Callback to unregister. By default, **0** is returned. |
+| callback | Callback<number> | No | Callback for the OS account activation state events. By default, no value is passed, which unsubscribes from all the callbacks for the OS account activation state events. |
**Error codes**
@@ -5649,7 +5649,7 @@ Obtains authentication information of the specified type. This API uses a promis
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------- | ---- | -------- |
-| authType | [AuthType](#authtype8) | No | Authentication credential type.|
+| authType | [AuthType](#authtype8) | No | Authentication type. By default, no value is passed, which means to obtain information about all authentication types.|
**Return value**
@@ -5929,12 +5929,14 @@ Defines the executor property.
**System capability**: SystemCapability.Account.OsAccount
-| Name | Type | Mandatory | Description |
-| ------------ | ---------------------------------------- | ----- | ----------------- |
-| result | number | Yes | Result. |
-| authSubType | [AuthSubType](#authsubtype8) | Yes | Authentication credential subtype.|
-| remainTimes | number | No | Number of remaining authentication times. |
-| freezingTime | number | No | Freezing time. |
+| Name | Type | Readable| Writable| Description |
+| ------------ | ---------------------------- | ----- | -----|----------------- |
+| result | number | Yes | Yes | Result. |
+| authSubType | [AuthSubType](#authsubtype8) | Yes | Yes | Authentication credential subtype.|
+| remainTimes | number | Yes | Yes | Number of remaining authentication times. |
+| freezingTime | number | Yes | Yes | Freezing time. |
+| enrollmentProgress10+ | string | Yes | Yes | Enrollment progress. By default, no value is passed.|
+| sensorInfo10+ | string | Yes | Yes | Sensor information. By default, no value is passed.|
## AuthResult8+
@@ -5946,9 +5948,9 @@ Defines the authentication result information.
| Name | Type | Mandatory | Description |
| ------------ | ----------- | ----- | ----------------- |
-| token | Uint8Array | No | Authentication token. |
-| remainTimes | number | No | Number of remaining authentication times. |
-| freezingTime | number | No | Freezing time. |
+| token | Uint8Array | No | Authentication token. By default, no value is passed. |
+| remainTimes | number | No | Number of remaining authentication times. By default, no value is passed. |
+| freezingTime | number | No | Freezing time. By default, no value is passed. |
## CredentialInfo8+
@@ -5974,7 +5976,7 @@ Defines the request result information.
| Name | Type | Mandatory | Description |
| ------------ | ----------- | ----- | ----------------- |
-| credentialId | Uint8Array | No | Credential ID. |
+| credentialId | Uint8Array | No | Credential ID. By default, no value is passed. |
## EnrolledCredInfo8+
@@ -6004,6 +6006,8 @@ Enumerates the types of properties to obtain.
| AUTH_SUB_TYPE | 1 | Authentication credential subtype.|
| REMAIN_TIMES | 2 | Remaining time. |
| FREEZING_TIME | 3 | Freezing time. |
+| ENROLLMENT_PROGRESS10+ | 4 | Enrollment progress. |
+| SENSOR_INFO10+ | 5 | Sensor information. |
## SetPropertyType8+
@@ -6047,6 +6051,9 @@ Enumerates the authentication credential subtypes.
| PIN_MIXED | 10002 | Custom mixed credentials.|
| FACE_2D | 20000 | 2D face credential. |
| FACE_3D | 20001 | 3D face credential. |
+| FINGERPRINT_CAPACITIVE10+ | 30000 | Capacitive fingerprint. |
+| FINGERPRINT_OPTICAL10+ | 30001 | Optical fingerprint. |
+| FINGERPRINT_ULTRASONIC10+ | 30002 | Ultrasonic fingerprint. |
| DOMAIN_MIXED9+ | 10240001 | Mixed domain authentication credentials. |
## AuthTrustLevel8+
@@ -6136,6 +6143,8 @@ Enumerates the tip codes for fingerprint authentication.
| FINGERPRINT_TIP_PARTIAL | 3 | Only part of the fingerprint image is detected. |
| FINGERPRINT_TIP_TOO_FAST | 4 | The fingerprint image is incomplete due to quick motion. |
| FINGERPRINT_TIP_TOO_SLOW | 5 | Failed to read the fingerprint image due to lack of motion. |
+| FINGERPRINT_TIP_FINGER_DOWN10+ | 6 | Press your finger. |
+| FINGERPRINT_TIP_FINGER_UP10+ | 7 | Lift your finger. |
## OsAccountInfo
@@ -6148,16 +6157,16 @@ Defines the OS account information.
| localId | number | Yes | ID of the target OS account. |
| localName | string | Yes | OS account name. |
| type | [OsAccountType](#osaccounttype) | Yes | OS account type. |
-| constraints | Array<string> | No | [Constraints](#constraints) on the OS account.|
+| constraints | Array<string> | No | OS account [Constraints](#constraints). By default, no value is passed.|
| isVerified8+ | boolean | Yes | Whether to verify the OS account. |
-| photo8+ | string | No | Profile photo of the OS account. |
+| photo8+ | string | No | OS account avatar. By default, no value is passed. |
| createTime8+ | number | Yes | Time when the OS account was created. |
-| lastLoginTime8+ | number | No | Last login time of the OS account. |
+| lastLoginTime8+ | number | No | Last login time of the OS account. By default, no value is passed. |
| serialNumber8+ | number | Yes | SN of the OS account. |
| isActived8+ | boolean | Yes | Whether the OS account is activated. |
| isCreateCompleted8+ | boolean | Yes | Whether the OS account information is complete. |
-| distributedInfo | [distributedAccount.DistributedInfo](js-apis-distributed-account.md) | No | Distributed account information. |
-| domainInfo8+ | [DomainAccountInfo](#domainaccountinfo8) | No | Domain account information. |
+| distributedInfo | [distributedAccount.DistributedInfo](js-apis-distributed-account.md) | No | Distributed account information. By default, no value is passed. |
+| domainInfo8+ | [DomainAccountInfo](#domainaccountinfo8) | No | Domain account information. By default, no value is passed. |
## DomainAccountInfo8+
@@ -6169,7 +6178,7 @@ Defines the domain account information.
| ----------- | ------ | ---- | ---------- |
| domain | string | Yes | Domain name. |
| accountName | string | Yes | Domain account name.|
-| accountId10+ | string | No | Domain account ID.
**System API**: This is a system API.|
+| accountId10+ | string | No | Domain account ID.
**System API**: It is a system API and is left blank by default.|
## Constraints
diff --git a/en/application-dev/reference/apis/js-apis-privacyManager.md b/en/application-dev/reference/apis/js-apis-privacyManager.md
index 403d9a6db944073b19a80d1b086e4adc98d8f4dd..505ae1ec5d4c8eaa9f301f1adeaace7adb2173a0 100644
--- a/en/application-dev/reference/apis/js-apis-privacyManager.md
+++ b/en/application-dev/reference/apis/js-apis-privacyManager.md
@@ -59,7 +59,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // You can use getApplicationInfo to obtain the access token ID.
try {
- privacyManager.addPermissionUsedRecord(tokenID, "ohos.permission.PERMISSION_USED_STATS", 1, 0).then(() => {
+ privacyManager.addPermissionUsedRecord(tokenID, 'ohos.permission.PERMISSION_USED_STATS', 1, 0).then(() => {
console.log('addPermissionUsedRecord success');
}).catch((err) => {
console.log(`addPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
@@ -88,7 +88,7 @@ The permission usage record includes the application identity (token ID) of the
| permissionName | Permissions | Yes | Name of the permission.|
| successCount | number | Yes | Number of successful accesses.|
| failCount | number | Yes | Number of failed accesses.|
-| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If a usage record is added successfully, **err** is **undefine**. Otherwise, **err** is an error object.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If a usage record is added successfully, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
@@ -109,7 +109,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // You can use getApplicationInfo to obtain the access token ID.
try {
- privacyManager.addPermissionUsedRecord(tokenID, "ohos.permission.PERMISSION_USED_STATS", 1, 0, (err, data) => {
+ privacyManager.addPermissionUsedRecord(tokenID, 'ohos.permission.PERMISSION_USED_STATS', 1, 0, (err, data) => {
if (err) {
console.log(`addPermissionUsedRecord fail, err->${JSON.stringify(err)}`);
} else {
@@ -161,14 +161,14 @@ For details about the error codes, see [Ability Access Control Error Codes](../e
import privacyManager from '@ohos.privacyManager';
let request = {
- "tokenId": 1,
- "isRemote": false,
- "deviceId": "device",
- "bundleName": "bundle",
- "permissionNames": [],
- "beginTime": 0,
- "endTime": 1,
- "flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
+ 'tokenId': 1,
+ 'isRemote': false,
+ 'deviceId': 'device',
+ 'bundleName': 'bundle',
+ 'permissionNames': [],
+ 'beginTime': 0,
+ 'endTime': 1,
+ 'flag':privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
};
try {
privacyManager.getPermissionUsedRecord(request).then((data) => {
@@ -196,7 +196,7 @@ Obtains historical permission usage records. This API uses an asynchronous callb
| Name | Type | Mandatory| Description |
| -------- | ------------------- | ---- | ------------------------------------------ |
| request | [PermissionUsedRequest](#permissionusedrequest) | Yes| Request for querying permission usage records.|
-| callback | AsyncCallback<[PermissionUsedResponse](#permissionusedresponse)> | Yes| Callback invoked to return the result. If the query is successful, **err** is **undefine** and **data** is the permission usage record. Otherwise, **err** is an error object.|
+| callback | AsyncCallback<[PermissionUsedResponse](#permissionusedresponse)> | Yes| Callback invoked to return the result. If the query is successful, **err** is **undefined** and **data** is the permission usage record. Otherwise, **err** is an error object.|
**Error codes**
@@ -216,14 +216,14 @@ For details about the error codes, see [Ability Access Control Error Codes](../e
import privacyManager from '@ohos.privacyManager';
let request = {
- "tokenId": 1,
- "isRemote": false,
- "deviceId": "device",
- "bundleName": "bundle",
- "permissionNames": [],
- "beginTime": 0,
- "endTime": 1,
- "flag":privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
+ 'tokenId': 1,
+ 'isRemote': false,
+ 'deviceId': 'device',
+ 'bundleName': 'bundle',
+ 'permissionNames': [],
+ 'beginTime': 0,
+ 'endTime': 1,
+ 'flag':privacyManager.PermissionUsageFlag.FLAG_PERMISSION_USAGE_DETAIL,
};
try {
privacyManager.getPermissionUsedRecord(request, (err, data) => {
@@ -281,7 +281,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // You can use getApplicationInfo to obtain the access token ID.
try {
- privacyManager.startUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS").then(() => {
+ privacyManager.startUsingPermission(tokenID, 'ohos.permission.PERMISSION_USED_STATS').then(() => {
console.log('startUsingPermission success');
}).catch((err) => {
console.log(`startUsingPermission fail, err->${JSON.stringify(err)}`);
@@ -307,7 +307,7 @@ Starts to use a permission and flushes the permission usage record. This API is
| -------------- | --------------------- | ---- | ------------------------------------ |
| tokenID | number | Yes | Application token ID of the invoker. The value can be obtained from [ApplicationInfo](js-apis-bundle-ApplicationInfo.md).|
| permissionName | Permissions | Yes | Permission to use. |
-| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the permission is successfully used, **err** is **undefine**. Otherwise, **err** is an error object.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the permission is successfully used, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
@@ -329,7 +329,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // You can use getApplicationInfo to obtain the access token ID.
try {
- privacyManager.startUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS", (err, data) => {
+ privacyManager.startUsingPermission(tokenID, 'ohos.permission.PERMISSION_USED_STATS', (err, data) => {
if (err) {
console.log(`startUsingPermission fail, err->${JSON.stringify(err)}`);
} else {
@@ -384,7 +384,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // You can use getApplicationInfo to obtain the access token ID.
try {
- privacyManager.stopUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS").then(() => {
+ privacyManager.stopUsingPermission(tokenID, 'ohos.permission.PERMISSION_USED_STATS').then(() => {
console.log('stopUsingPermission success');
}).catch((err) => {
console.log(`stopUsingPermission fail, err->${JSON.stringify(err)}`);
@@ -410,7 +410,7 @@ Stops using a permission. This API is called by a system application and uses a
| -------------- | --------------------- | ---- | ------------------------------------ |
| tokenID | number | Yes | Application token ID of the invoker. The value can be obtained from [ApplicationInfo](js-apis-bundle-ApplicationInfo.md).|
| permissionName | Permissions | Yes | Permission to use. |
-| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefine**. Otherwise, **err** is an error object.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
@@ -432,7 +432,7 @@ import privacyManager from '@ohos.privacyManager';
let tokenID = 0; // You can use getApplicationInfo to obtain the access token ID.
try {
- privacyManager.stopUsingPermission(tokenID, "ohos.permission.PERMISSION_USED_STATS", (err, data) => {
+ privacyManager.stopUsingPermission(tokenID, 'ohos.permission.PERMISSION_USED_STATS', (err, data) => {
if (err) {
console.log(`stopUsingPermission fail, err->${JSON.stringify(err)}`);
} else {
@@ -482,7 +482,7 @@ import privacyManager from '@ohos.privacyManager';
let permissionList = [];
try {
privacyManager.on('activeStateChange', permissionList, (data) => {
- console.debug("receive permission state change, data:" + JSON.stringify(data));
+ console.debug('receive permission state change, data:' + JSON.stringify(data));
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -514,7 +514,7 @@ For details about the error codes, see [Ability Access Control Error Codes](../e
| ID| Error Message|
| -------- | -------- |
| 12100001 | The permissionNames in the list are all invalid, or the list size exceeds 1024 bytes. |
-| 12100004 | The interface is not used together with "on()".|
+| 12100004 | The interface is not used together with 'on'.|
| 12100007 | Service is abnormal. |
| 12100008 | Out of memory. |
@@ -550,14 +550,14 @@ Represents the request for querying permission usage records.
| Name | Type | Mandatory | Description |
| -------- | -------------- | ---- | ---------------------------------------- |
-| tokenId | number | No | Token ID of the application (invoker). |
-| isRemote | boolean | No | Whether the token ID belongs to the application on a remote device. The default value is **false**.|
-| deviceId | string | No | ID of the device hosting the target application. |
-| bundleName | string | No | Bundle name of the target application.|
-| permissionNames | Array<Permissions> | No | Permissions to query. |
-| beginTime | number | No | Start time of the query, in ms. The default value is **0**, indicating that no start time is set.|
-| endTime | number | No | End time of the query, in ms. The default value is **0**, indicating that no end time is set.|
-| flag | [PermissionUsageFlag](#permissionusageflag) | Yes | Query mode. The default value is **FLAG_PERMISSION_USAGE_SUMMARY**.|
+| tokenId | number | No | Token ID of the application (invoker).
By default, all applications are queried. |
+| isRemote | boolean | No | Whether to query the permission usage records of the remote device.
The default value is **false**, which means the permission usage records of the local device are queried by default.|
+| deviceId | string | No | ID of the device hosting the target application.
The default value is the local device ID. |
+| bundleName | string | No | Bundle name of the target application.
By default, all applications are queried.|
+| permissionNames | Array<Permissions> | No | Permissions to query.
By default, the usage records of all permissions are queried. |
+| beginTime | number | No | Start time of the query, in ms.
The default value is **0**, which means the start time is not set.|
+| endTime | number | No | End time of the query, in ms.
The default value is **0**, which means the end time is not set.|
+| flag | [PermissionUsageFlag](#permissionusageflag) | Yes | Query mode.|
## PermissionUsedResponse
@@ -567,9 +567,9 @@ Represents the permission usage records of all applications.
| Name | Type | Mandatory | Description |
| -------- | -------------- | ---- | ---------------------------------------- |
-| beginTime | number | No | Start time of the query, in ms.|
-| endTime | number | No | End time of the query, in ms.|
-| bundleRecords | Array<[BundleUsedRecord](#bundleusedrecord)> | No | Permission usage records. |
+| beginTime | number | Yes | Start time of the query, in ms.|
+| endTime | number | Yes | End time of the query, in ms.|
+| bundleRecords | Array<[BundleUsedRecord](#bundleusedrecord)> | Yes | Permission usage records. |
## BundleUsedRecord
@@ -579,11 +579,11 @@ Represents the permission access records of an application.
| Name | Type | Mandatory | Description |
| -------- | -------------- | ---- | ---------------------------------------- |
-| tokenId | number | No | Token ID of the application (invoker). |
-| isRemote | boolean | No | Whether the token ID belongs to the application on a remote device. The default value is **false**.|
-| deviceId | string | No | ID of the device hosting the target application. |
-| bundleName | string | No | Bundle name of the target application.|
-| permissionRecords | Array<[PermissionUsedRecord](#permissionusedrecord)> | No | Permission usage records of the target application. |
+| tokenId | number | Yes | Token ID of the application (invoker). |
+| isRemote | boolean | Yes | Whether the token ID belongs to the application on a remote device. The default value is **false**.|
+| deviceId | string | Yes | ID of the device hosting the target application. |
+| bundleName | string | Yes | Bundle name of the target application.|
+| permissionRecords | Array<[PermissionUsedRecord](#permissionusedrecord)> | Yes | Permission usage records of the target application. |
## PermissionUsedRecord
@@ -593,14 +593,14 @@ Represents the usage records of a permission.
| Name | Type | Mandatory | Description |
| -------- | -------------- | ---- | ---------------------------------------- |
-| permissionName | Permissions | No | Name of the permission. |
-| accessCount | number | No | Total number of times that the permission is accessed.|
-| rejectCount | number | No | Total number of times that the access to the permission is rejected.|
-| lastAccessTime | number | No | Last time when the permission was accessed, accurate to ms.|
-| lastRejectTime | number | No | Last time when the access to the permission was rejected, accurate to ms.|
-| lastAccessDuration | number | No | Last access duration, in ms.|
-| accessRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | No | Successful access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
-| rejectRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | No | Rejected access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
+| permissionName | Permissions | Yes | Name of the permission. |
+| accessCount | number | Yes | Total number of times that the permission is accessed.|
+| rejectCount | number | Yes | Total number of times that the access to the permission is rejected.|
+| lastAccessTime | number | Yes | Last time when the permission was accessed, accurate to ms.|
+| lastRejectTime | number | Yes | Last time when the access to the permission was rejected, accurate to ms.|
+| lastAccessDuration | number | Yes | Last access duration, in ms.|
+| accessRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | Yes | Successful access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
+| rejectRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | Yes | Rejected access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
## UsedRecordDetail
@@ -610,9 +610,9 @@ Represents the details of a single access record.
| Name | Type | Mandatory | Description |
| -------- | -------------- | ---- | ---------------------------------------- |
-| status | number | No | Access status. |
-| timestamp | number | No | Access timestamp, in ms.|
-| accessDuration | number | No | Access duration, in ms. |
+| status | number | Yes | Access status. |
+| timestamp | number | Yes | Access timestamp, in ms.|
+| accessDuration | number | Yes | Access duration, in ms. |
## PermissionActiveStatus
diff --git a/en/application-dev/reference/apis/js-apis-uitest.md b/en/application-dev/reference/apis/js-apis-uitest.md
index b14811afdb9d1305579768c96a733d2c84e93085..673744bf89745e4b929bddf57db88f7de730c33f 100644
--- a/en/application-dev/reference/apis/js-apis-uitest.md
+++ b/en/application-dev/reference/apis/js-apis-uitest.md
@@ -20,7 +20,7 @@ This module provides the following functions:
## Modules to Import
```js
-import {UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix, UiDirection, MouseButton} from '@ohos.UiTest';
+import {UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix, UiDirection, MouseButton, UIElementInfo, UIEventObserver} from '@ohos.UiTest';
```
## MatchPattern
@@ -141,10 +141,31 @@ Describes the injected simulated mouse button.
| MOUSE_BUTTON_RIGHT | 1 | Right button on the mouse. |
| MOUSE_BUTTON_MIDDLE | 2 | Middle button on the mouse.|
+## UIElementInfo10+
+
+Provides information about the UI event.
+
+**System capability**: SystemCapability.Test.UiTest
+
+| Name | Type | Readable| Writable| Description |
+| ---------- | ------ | ---- | ---- | --------------------- |
+| bundleName | string | Yes | No | Bundle name of the home application. |
+| type | string | Yes | No | Component or window type. |
+| text | string | Yes | No | Text information of the component or window.|
+
## On9+
Since API version 9, the UiTest framework provides a wide range of UI component feature description APIs in the **On** class to filter and match components.
-The API capabilities provided by the **On** class exhibit the following features: 1. Allow one or more attributes as the match conditions. For example, you can specify both the **text** and **id** attributes to find the target component.
2. Provide multiple match patterns for component attributes.
3. Support absolute positioning and relative positioning for components. APIs such as [ON.isBefore](#isbefore9) and [ON.isAfter](#isafter9) can be used to specify the features of adjacent components to assist positioning.
All APIs provided in the **On** class are synchronous. You are advised to use the static constructor **ON** to create an **On** object in chain mode.
+
+The API capabilities provided by the **On** class exhibit the following features:
+
+- Allow one or more attributes as the match conditions. For example, you can specify both the **text** and **id** attributes to find the target component.
+
+- Provide multiple match patterns for component attributes.
+
+- Support absolute positioning and relative positioning for components. APIs such as [ON.isBefore](#isbefore9) and [ON.isAfter](#isafter9) can be used to specify the features of adjacent components to assist positioning.
+
+All APIs provided in the **On** class are synchronous. You are advised to use the static constructor **ON** to create an **On** object in chain mode.
```js
ON.text('123').type('button');
@@ -244,7 +265,7 @@ Specifies the clickable status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| b | boolean | No | Clickable status of the target component.
**true**: clickable.
**false**: not clickable.
Default value: **true** |
+| b | boolean | No | Clickable status of the target component.
**true**: clickable.
**false**: not clickable.
Default value: **true**|
**Return value**
@@ -270,7 +291,7 @@ Specifies the long-clickable status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| b | boolean | No | Long-clickable status of the target component.
**true**: long-clickable.
**false**: not long-clickable.
Default value: **true** |
+| b | boolean | No | Long-clickable status of the target component.
**true**: long-clickable.
**false**: not long-clickable.
Default value: **true**|
**Return value**
@@ -297,7 +318,7 @@ Specifies the scrollable status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ----------------------------------------------------------- |
-| b | boolean | No | Scrollable status of the target component.
**true**: scrollable.
**false**: not scrollable.
Default value: **true** |
+| b | boolean | No | Scrollable status of the target component.
**true**: scrollable.
**false**: not scrollable.
Default value: **true**|
**Return value**
@@ -323,7 +344,7 @@ Specifies the enabled status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | --------------------------------------------------------- |
-| b | boolean | No | Enabled status of the target component.
**true**: enabled.
**false**: not enabled.
Default value: **true** |
+| b | boolean | No | Enabled status of the target component.
**true**: enabled.
**false**: not enabled.
Default value: **true**|
**Return value**
@@ -349,7 +370,7 @@ Specifies the focused status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ----------------------------------------------------- |
-| b | boolean | No | Focused status of the target component.
**true**: focused.
**false**: not focused.
Default value: **true** |
+| b | boolean | No | Focused status of the target component.
**true**: focused.
**false**: not focused.
Default value: **true**|
**Return value**
@@ -375,7 +396,7 @@ Specifies the selected status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| b | boolean | No | Selected status of the target component.
**true**: selected.
**false**: not selected.
Default value: **true** |
+| b | boolean | No | Selected status of the target component.
**true**: selected.
**false**: not selected.
Default value: **true**|
**Return value**
@@ -401,7 +422,7 @@ Specifies the checked status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| b | boolean | No | Checked status of the target component.
**true**: checked.
**false**: not checked.
Default value: **false** |
+| b | boolean | No | Checked status of the target component.
**true**: checked.
**false**: not checked.
Default value: **false**|
**Return value**
@@ -427,7 +448,7 @@ Specifies the checkable status attribute of the target component.
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| b | boolean | No | Checkable status of the target component.
**true**: checkable.
**false**: not checkable.
Default value: **false** |
+| b | boolean | No | Checkable status of the target component.
**true**: checkable.
**false**: not checkable.
Default value: **false**|
**Return value**
@@ -523,7 +544,7 @@ let on = ON.within(ON.type('List')); // Create an On object using the static con
inWindow(bundleName: string): On;
-Specifies that the target component is within the given application window.
+Specifies that the target component is located within the given application window.
**System capability**: SystemCapability.Test.UiTest
@@ -542,12 +563,13 @@ Specifies that the target component is within the given application window.
**Example**
```js
-let on = ON.inWindow('com.uitestScene.acts'); // Create an On object using the static constructor ON, specifying that the target component is within the given application window.
+let on = ON.inWindow('com.uitestScene.acts'); // Create an On object using the static constructor ON, specifying that the target component is located within the given application window.
```
## Component9+
-In **UiTest** of API version 9, the **Component** class represents a component on the UI and provides APIs for obtaining component attributes, clicking a component, scrolling to search for a component, and text injection.
+Represents a component on the UI and provides APIs for obtaining component attributes, clicking a component, scrolling to search for a component, and text injection.
+
All APIs provided in this class use a promise to return the result and must be invoked using **await**.
### click9+
@@ -564,8 +586,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -591,8 +613,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -618,8 +640,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -651,8 +673,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -684,8 +706,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -717,8 +739,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -750,8 +772,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -783,8 +805,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -816,8 +838,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -853,8 +875,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -890,8 +912,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -899,7 +921,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
async function demo() {
let driver = Driver.create();
let checkBox = await driver.findComponent(ON.type('Checkbox'));
- if(await checkBox.isChecked) {
+ if(await checkBox.isChecked()) {
console.info('This checkBox is checked');
} else {
console.info('This checkBox is not checked');
@@ -927,8 +949,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -936,7 +958,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
async function demo() {
let driver = Driver.create();
let checkBox = await driver.findComponent(ON.type('Checkbox'));
- if(await checkBox.isCheckable) {
+ if(await checkBox.isCheckable()) {
console.info('This checkBox is checkable');
} else {
console.info('This checkBox is not checkable');
@@ -964,8 +986,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1002,8 +1024,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1040,8 +1062,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1077,8 +1099,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1114,8 +1136,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1139,8 +1161,8 @@ Clears text in this component. This API is applicable to text boxes.
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1178,8 +1200,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1211,8 +1233,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1244,8 +1266,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1277,8 +1299,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1311,8 +1333,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1344,8 +1366,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the component is invisible or destroyed. |
**Example**
@@ -1360,6 +1382,7 @@ async function demo() {
## Driver9+
The **Driver** class is the main entry to the UiTest framework. It provides APIs for features such as component matching/search, key injection, coordinate clicking/sliding, and screenshot.
+
All APIs provided by this class, except for **Driver.create()**, use a promise to return the result and must be invoked using **await**.
### create9+
@@ -1382,7 +1405,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------ |
-| 17000001 | Initialize failed. |
+| 17000001 | if the test framework failed to initialize. |
**Example**
@@ -1412,7 +1435,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1449,7 +1472,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1486,7 +1509,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1523,7 +1546,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1561,7 +1584,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1592,8 +1615,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000003 | Component existence assertion failed. |
+| 17000002 | if the async function was not called with await. |
+| 17000003 | if the assertion failed. |
**Example**
@@ -1618,7 +1641,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1649,7 +1672,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1682,7 +1705,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1715,7 +1738,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1747,7 +1770,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1779,7 +1802,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1814,7 +1837,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1849,7 +1872,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1886,7 +1909,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1917,7 +1940,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1948,7 +1971,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -1979,7 +2002,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2010,7 +2033,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2041,7 +2064,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2066,7 +2089,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2091,7 +2114,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2129,7 +2152,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2163,7 +2186,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2201,7 +2224,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2221,7 +2244,7 @@ async function demo() {
### fling10+
-fling(direction: UiDirection, speed: number): Promise;
+fling(direction: UiDirection, speed: number): Promise\;
Simulates a fling operation on the screen, in the specified direction and speed.
@@ -2240,7 +2263,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2253,7 +2276,7 @@ async function demo() {
### screenCapture10+
-screenCapture(savePath: string, rect?: Rect): Promise;
+screenCapture(savePath: string, rect?: Rect): Promise\;
Captures the specified area of the current screen and saves the captured screenshot as a PNG image to the specified path.
@@ -2278,7 +2301,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2291,7 +2314,7 @@ async function demo() {
### mouseClick10+
-mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise;
+mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise\;
Injects a mouse click at the specified coordinates, with the optional key or key combination. For example, if the value of **key1** is **2072**, the **Ctrl** button is pressed with the mouse click.
@@ -2302,8 +2325,8 @@ Injects a mouse click at the specified coordinates, with the optional key or key
| Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | ------------------- |
| p | [Point](#point9) | Yes | Coordinates of the mouse click. |
-| btnId | [MouseButton](#mousebutton10) | Yes | Mouse button pressesd. |
-| key1 | number | Yes | The first key value.|
+| btnId | [MouseButton](#mousebutton10) | Yes | Mouse button pressed. |
+| key1 | number | No | The first key value.|
| key2 | number | No | The second key value.|
**Error codes**
@@ -2312,7 +2335,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2325,7 +2348,7 @@ async function demo() {
### mouseScroll10+
-mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number): Promise;
+mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number): Promise\;
Injects a mouse scroll action at the specified coordinates, with the optional key or key combination. For example, if the value of **key1** is **2072**, the **Ctrl** button is pressed with mouse scrolling.
@@ -2338,7 +2361,7 @@ Injects a mouse scroll action at the specified coordinates, with the optional ke
| p | [Point](#point9) | Yes | Coordinates of the mouse click. |
| down | boolean | Yes | Whether the scroll wheel slides downward. |
| d | number | Yes | Number of grids by which the scroll wheel slides. Sliding by one grid means a 120-pixel offset of the target point.|
-| key1 | number | Yes | The first key value. |
+| key1 | number | No | The first key value. |
| key2 | number | No | The second key value. |
**Error codes**
@@ -2347,7 +2370,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2360,7 +2383,7 @@ async function demo() {
### mouseMoveTo10+
-mouseMoveTo(p: Point): Promise;
+mouseMoveTo(p: Point): Promise\;
Moves the cursor to the target point.
@@ -2378,7 +2401,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
+| 17000002 | if the async function was not called with await. |
**Example**
@@ -2389,6 +2412,37 @@ async function demo() {
}
```
+### createUIEventObserver10+
+
+createUIEventObserver(): UIEventObserver;
+
+Creates a UI event listener.
+
+**System capability**: SystemCapability.Test.UiTest
+
+**Return value**
+
+| Type | Description |
+| ----------------------------------------------- | ------------------------------------- |
+| Promise\<[UIEventObserver](#uieventobserver10)> | Promise used to return the target window.|
+
+**Error codes**
+
+For details about the error codes, see [UiTest Error Codes](../errorcodes/errorcode-uitest.md).
+
+| ID| Error Message |
+| -------- | ---------------------------------------- |
+| 17000002 | if the async function was not called with await. |
+
+**Example**
+
+```js
+async function demo() {
+ let driver = Driver.create();
+ let obeserver = await driver.createUiEventObserve();
+}
+```
+
## PointerMatrix9+
Implements a **PointerMatrix** object that stores coordinates and behaviors of each action of each finger in a multi-touch operation.
@@ -2455,6 +2509,7 @@ async function demo() {
## UiWindow9+
The **UiWindow** class represents a window on the UI and provides APIs for obtaining window attributes, dragging a window, and adjusting the window size.
+
All APIs provided in this class use a promise to return the result and must be invoked using **await**.
### getBundleName9+
@@ -2477,8 +2532,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2510,8 +2565,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2543,8 +2598,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2576,8 +2631,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2609,8 +2664,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2642,8 +2697,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2669,8 +2724,8 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
**Example**
@@ -2703,9 +2758,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2739,9 +2794,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2767,9 +2822,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2795,9 +2850,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2823,9 +2878,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2851,9 +2906,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2879,9 +2934,9 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
-| 17000002 | API does not allow calling concurrently. |
-| 17000004 | Component lost/UiWindow lost. |
-| 17000005 | This operation is not supported. |
+| 17000002 | if the async function was not called with await. |
+| 17000004 | if the window is invisible or destroyed. |
+| 17000005 | if the action is not supported on this window. |
**Example**
@@ -2893,10 +2948,78 @@ async function demo() {
}
```
+## UIEventObserver10+
+
+UI event listener.
+
+### once('toastShow')
+
+once(type: 'toastShow', callback: Callback\):void;
+
+Subscribes to events of the toast component. This API uses a callback to return the result.
+
+**System capability**: SystemCapability.Test.UiTest
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | -------------------------------------------- | ---- | --------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'toastShow'**.|
+| callback | Callback\<[UIElementInfo](#uielementinfo10)> | Yes | Callback used to return the result. |
+
+**Example**
+
+```js
+async function demo() {
+ let observer = await driver.createUIEventObserver()
+ let callback = (UIElementInfo)=>{
+ console.info(UIElementInfo.bundleName)
+ console.info(UIElementInfo.text)
+ console.info(UIElementInfo.type)
+ }
+ observer.once('toastShow', callback)
+}
+```
+
+### once('dialogShow')
+
+once(type: 'dialogShow', callback: Callback\): void;
+
+Subscribes to events of the dialog component. This API uses a callback to return the result.
+
+**System capability**: SystemCapability.Test.UiTest
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | -------------------------------------------- | ---- | ---------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'dialogShow'**.|
+| callback | Callback\<[UIElementInfo](#uielementinfo10)> | Yes | Callback used to return the result. |
+
+**Example**
+
+```js
+async function demo() {
+ let observer = await driver.createUIEventObserver()
+ let callback = (UIElementInfo)=>{
+ console.info(UIElementInfo.bundleName)
+ console.info(UIElementInfo.text)
+ console.info(UIElementInfo.type)
+ }
+ observer.once('dialogShow', callback)
+}
+```
+
## By(deprecated)
The UiTest framework provides a wide range of UI component feature description APIs in the **By** class to filter and match components.
-The API capabilities provided by the **By** class exhibit the following features:
1. Allow one or more attributes as the match conditions. For example, you can specify both the **text** and **id** attributes to find the target component.
2. Provide multiple match patterns for component attributes.
3. Support absolute positioning and relative positioning for components. APIs such as [By.isBefore(deprecated)](#isbeforedeprecated) and [By.isAfter(deprecated)](#isafterdeprecated) can be used to specify the features of adjacent components to assist positioning.
All APIs provided in the **By** class are synchronous. You are advised to use the static constructor **BY** to create a **By** object in chain mode.
+The API capabilities provided by the **By** class exhibit the following features:
+
+- Allow one or more attributes as the match conditions. For example, you can specify both the **text** and **id** attributes to find the target component.
+- Provide multiple match patterns for component attributes.
+- Support absolute positioning and relative positioning for components. APIs such as [By.isBefore(deprecated)](#isbeforedeprecated) and [By.isAfter(deprecated)](#isafterdeprecated) can be used to specify the features of adjacent components to assist positioning.
+
+All APIs provided in the **By** class are synchronous. You are advised to use the static constructor **BY** to create a **By** object in chain mode.
This API is deprecated since API version 9. You are advised to use [On9+](#on9) instead.
@@ -2910,7 +3033,7 @@ text(txt: string, pattern?: MatchPattern): By
Specifies the text attribute of the target component. Multiple match patterns are supported.
-This API is deprecated since API version 9. You are advised to use [text9+](#text9).
+This API is deprecated since API version 9. You are advised to use [text9+](#text9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -2940,7 +3063,7 @@ key(key: string): By
Specifies the key attribute of the target component.
-This API is deprecated since API version 9. You are advised to use [id9+](#id9).
+This API is deprecated since API version 9. You are advised to use [id9+](#id9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -2998,7 +3121,7 @@ type(tp: string): By
Specifies the type attribute of the target component.
-This API is deprecated since API version 9. You are advised to use [type9+](#type9).
+This API is deprecated since API version 9. You are advised to use [type9+](#type9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3027,7 +3150,7 @@ clickable(b?: boolean): By
Specifies the clickable status attribute of the target component.
-This API is deprecated since API version 9. You are advised to use [clickable9+](#clickable9).
+This API is deprecated since API version 9. You are advised to use [clickable9+](#clickable9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3035,7 +3158,7 @@ This API is deprecated since API version 9. You are advised to use [clickable**true**: clickable.
**false**: not clickable.
Default value: **true** |
+| b | boolean | No | Clickable status of the target component.
**true**: clickable.
**false**: not clickable.
Default value: **true**|
**Return value**
@@ -3056,7 +3179,7 @@ scrollable(b?: boolean): By
Specifies the scrollable status attribute of the target component.
-This API is deprecated since API version 9. You are advised to use [scrollable9+](#scrollable9).
+This API is deprecated since API version 9. You are advised to use [scrollable9+](#scrollable9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3064,7 +3187,7 @@ This API is deprecated since API version 9. You are advised to use [scrollable**true**: scrollable.
**false**: not scrollable.
Default value: **true** |
+| b | boolean | No | Scrollable status of the target component.
**true**: scrollable.
**false**: not scrollable.
Default value: **true**|
**Return value**
@@ -3084,7 +3207,7 @@ enabled(b?: boolean): By
Specifies the enabled status attribute of the target component.
-This API is deprecated since API version 9. You are advised to use [enabled9+](#enabled9).
+This API is deprecated since API version 9. You are advised to use [enabled9+](#enabled9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3092,7 +3215,7 @@ This API is deprecated since API version 9. You are advised to use [enabled
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | --------------------------------------------------------- |
-| b | boolean | No | Enabled status of the target component.
**true**: enabled.
**false**: not enabled.
Default value: **true** |
+| b | boolean | No | Enabled status of the target component.
**true**: enabled.
**false**: not enabled.
Default value: **true**|
**Return value**
@@ -3112,7 +3235,7 @@ focused(b?: boolean): By
Specifies the focused status attribute of the target component.
-This API is deprecated since API version 9. You are advised to use [focused9+](#focused9).
+This API is deprecated since API version 9. You are advised to use [focused9+](#focused9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3120,7 +3243,7 @@ This API is deprecated since API version 9. You are advised to use [focused
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ----------------------------------------------------- |
-| b | boolean | No | Focused status of the target component.
**true**: focused.
**false**: not focused.
Default value: **true** |
+| b | boolean | No | Focused status of the target component.
**true**: focused.
**false**: not focused.
Default value: **true**|
**Return value**
@@ -3140,7 +3263,7 @@ selected(b?: boolean): By
Specifies the selected status of the target component.
-This API is deprecated since API version 9. You are advised to use [selected9+](#selected9).
+This API is deprecated since API version 9. You are advised to use [selected9+](#selected9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3148,7 +3271,7 @@ This API is deprecated since API version 9. You are advised to use [selected**true**: selected.
**false**: not selected.
Default value: **true** |
+| b | boolean | No | Selected status of the target component.
**true**: selected.
**false**: not selected.
Default value: **true**|
**Return value**
@@ -3168,7 +3291,7 @@ isBefore(by: By): By
Specifies that the target component is located before the given attribute component.
-This API is deprecated since API version 9. You are advised to use [isBefore9+](#isbefore9).
+This API is deprecated since API version 9. You are advised to use [isBefore9+](#isbefore9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3194,9 +3317,9 @@ let by = BY.isBefore(BY.text('123')); // Use the static constructor BY to create
isAfter(by: By): By
-Specifies the target component is located after the given attribute component.
+Specifies that the target component is located after the given attribute component.
-This API is deprecated since API version 9. You are advised to use [isAfter9+](#isafter9).
+This API is deprecated since API version 9. You are advised to use [isAfter9+](#isafter9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3221,6 +3344,7 @@ let by = BY.isAfter(BY.text('123')); // Use the static constructor BY to create
## UiComponent(deprecated)
In **UiTest**, the **UiComponent** class represents a component on the UI and provides APIs for obtaining component attributes, clicking a component, scrolling to search for a component, and text injection.
+
All APIs provided in this class use a promise to return the result and must be invoked using **await**.
This API is deprecated since API version 9. You are advised to use [Component9+](#component9) instead.
@@ -3231,7 +3355,7 @@ click(): Promise\
Clicks this component.
-This API is deprecated since API version 9. You are advised to use [click9+](#click9).
+This API is deprecated since API version 9. You are advised to use [click9+](#click9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3251,7 +3375,7 @@ doubleClick(): Promise\
Double-clicks this component.
-This API is deprecated since API version 9. You are advised to use [doubleClick9+](#doubleclick9).
+This API is deprecated since API version 9. You are advised to use [doubleClick9+](#doubleclick9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3271,7 +3395,7 @@ longClick(): Promise\
Long-clicks this component.
-This API is deprecated since API version 9. You are advised to use [longClick9+](#longclick9).
+This API is deprecated since API version 9. You are advised to use [longClick9+](#longclick9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3317,7 +3441,7 @@ getKey(): Promise\
Obtains the key of this component.
-This API is deprecated since API version 9. You are advised to use [getId9+](#getid9).
+This API is deprecated since API version 9. You are advised to use [getId9+](#getid9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3343,7 +3467,7 @@ getText(): Promise\
Obtains the text information of this component.
-This API is deprecated since API version 9. You are advised to use [getText9+](#gettext9).
+This API is deprecated since API version 9. You are advised to use [getText9+](#gettext9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3369,7 +3493,7 @@ getType(): Promise\
Obtains the type of this component.
-This API is deprecated since API version 9. You are advised to use [getType9+](#gettype9).
+This API is deprecated since API version 9. You are advised to use [getType9+](#gettype9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3395,7 +3519,7 @@ isClickable(): Promise\
Obtains the clickable status of this component.
-This API is deprecated since API version 9. You are advised to use [isClickable9+](#isclickable9).
+This API is deprecated since API version 9. You are advised to use [isClickable9+](#isclickable9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3425,7 +3549,7 @@ isScrollable(): Promise\
Obtains the scrollable status of this component.
-This API is deprecated since API version 9. You are advised to use [isScrollable9+](#isscrollable9).
+This API is deprecated since API version 9. You are advised to use [isScrollable9+](#isscrollable9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3456,7 +3580,7 @@ isEnabled(): Promise\
Obtains the enabled status of this component.
-This API is deprecated since API version 9. You are advised to use [isEnabled9+](#isenabled9).
+This API is deprecated since API version 9. You are advised to use [isEnabled9+](#isenabled9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3487,7 +3611,7 @@ isFocused(): Promise\
Obtains the focused status of this component.
-This API is deprecated since API version 9. You are advised to use [isFocused9+](#isfocused9).
+This API is deprecated since API version 9. You are advised to use [isFocused9+](#isfocused9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3517,7 +3641,7 @@ isSelected(): Promise\
Obtains the selected status of this component.
-This API is deprecated since API version 9. You are advised to use [isSelected9+](#isselected9).
+This API is deprecated since API version 9. You are advised to use [isSelected9+](#isselected9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3547,7 +3671,7 @@ inputText(text: string): Promise\
Enters text into this component (available for text boxes).
-This API is deprecated since API version 9. You are advised to use [inputText9+](#inputtext9).
+This API is deprecated since API version 9. You are advised to use [inputText9+](#inputtext9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3573,7 +3697,7 @@ scrollSearch(by: By): Promise\
Scrolls on this component to search for the target component (applicable to components that support scrolling, such as **\**).
-This API is deprecated since API version 9. You are advised to use [scrollSearch9+](#scrollsearch9).
+This API is deprecated since API version 9. You are advised to use [scrollSearch9+](#scrollsearch9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3602,6 +3726,7 @@ async function demo() {
## UiDriver(deprecated)
The **UiDriver** class is the main entry to the UiTest framework. It provides APIs for features such as component matching/search, key injection, coordinate clicking/sliding, and screenshot.
+
All APIs provided by this class, except for **UiDriver.create()**, use a promise to return the result and must be invoked using **await**.
This API is deprecated since API version 9. You are advised to use [Driver9+](#driver9) instead.
@@ -3612,7 +3737,7 @@ static create(): UiDriver
Creates a **UiDriver** object and returns the object created. This API is a static API.
-This API is deprecated since API version 9. You are advised to use [create9+](#create9).
+This API is deprecated since API version 9. You are advised to use [create9+](#create9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3636,7 +3761,7 @@ delayMs(duration: number): Promise\
Delays this **UiDriver** object within the specified duration.
-This API is deprecated since API version 9. You are advised to use [delayMs9+](#delayms9).
+This API is deprecated since API version 9. You are advised to use [delayMs9+](#delayms9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3661,7 +3786,7 @@ findComponent(by: By): Promise\
Searches this **UiDriver** object for the target component that matches the given attributes.
-This API is deprecated since API version 9. You are advised to use [findComponent9+](#findcomponent9).
+This API is deprecated since API version 9. You are advised to use [findComponent9+](#findcomponent9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3692,7 +3817,7 @@ findComponents(by: By): Promise\>
Searches this **UiDriver** object for all components that match the given attributes.
-This API is deprecated since API version 9. You are advised to use [findComponents9+](#findcomponents9).
+This API is deprecated since API version 9. You are advised to use [findComponents9+](#findcomponents9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3723,7 +3848,7 @@ assertComponentExist(by: By): Promise\
Asserts that a component that matches the given attributes exists on the current page. If the component does not exist, the API throws a JS exception, causing the current test case to fail.
-This API is deprecated since API version 9. You are advised to use [assertComponentExist9+](#assertcomponentexist9).
+This API is deprecated since API version 9. You are advised to use [assertComponentExist9+](#assertcomponentexist9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3748,7 +3873,7 @@ pressBack(): Promise\
Presses the Back button on this **UiDriver** object.
-This API is deprecated since API version 9. You are advised to use [pressBack9+](#pressback9).
+This API is deprecated since API version 9. You are advised to use [pressBack9+](#pressback9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3767,7 +3892,7 @@ triggerKey(keyCode: number): Promise\
Triggers the key of this **UiDriver** object that matches the given key code.
-This API is deprecated since API version 9. You are advised to use [triggerKey9+](#triggerkey9).
+This API is deprecated since API version 9. You are advised to use [triggerKey9+](#triggerkey9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3793,7 +3918,7 @@ click(x: number, y: number): Promise\
Clicks a specific point of this **UiDriver** object based on the given coordinates.
-This API is deprecated since API version 9. You are advised to use [click9+](#click9).
+This API is deprecated since API version 9. You are advised to use [click9+](#click9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3819,7 +3944,7 @@ doubleClick(x: number, y: number): Promise\
Double-clicks a specific point of this **UiDriver** object based on the given coordinates.
-This API is deprecated since API version 9. You are advised to use [doubleClick9+](#doubleclick9).
+This API is deprecated since API version 9. You are advised to use [doubleClick9+](#doubleclick9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3845,7 +3970,7 @@ longClick(x: number, y: number): Promise\
Long-clicks a specific point of this **UiDriver** object based on the given coordinates.
-This API is deprecated since API version 9. You are advised to use [longClick9+](#longclick9).
+This API is deprecated since API version 9. You are advised to use [longClick9+](#longclick9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3871,7 +3996,7 @@ swipe(startx: number, starty: number, endx: number, endy: number): Promise\9+
](#swipe9).
+This API is deprecated since API version 9. You are advised to use [swipe9+](#swipe9) instead.
**System capability**: SystemCapability.Test.UiTest
@@ -3899,7 +4024,7 @@ screenCap(savePath: string): Promise\
Captures the current screen of this **UiDriver** object and saves it as a PNG image to the given save path.
-This API is deprecated since API version 9. You are advised to use [screenCap9+](#screencap9).
+This API is deprecated since API version 9. You are advised to use [screenCap9+](#screencap9) instead.
**System capability**: SystemCapability.Test.UiTest
diff --git a/en/application-dev/reference/apis/js-apis-wifi.md b/en/application-dev/reference/apis/js-apis-wifi.md
index 9eb6f28a9880ada20a1a5c6bce2bac006a6efd5f..76f27aa775302ff5d313d17f664401b6364e25b9 100644
--- a/en/application-dev/reference/apis/js-apis-wifi.md
+++ b/en/application-dev/reference/apis/js-apis-wifi.md
@@ -31,6 +31,17 @@ Enables WLAN.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.enableWifi();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.disableWifi
@@ -50,6 +61,18 @@ Disables WLAN.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.disableWifi();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+
+```
## wifi.isWifiActive
@@ -67,6 +90,18 @@ Checks whether WLAN is enabled.
| -------- | -------- |
| boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let isActivate = wifi.isActivate();
+ console.info("isActivate:" + isActivate);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.scan
@@ -84,6 +119,17 @@ Starts a scan for WLAN.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.scan();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.getScanInfos
@@ -119,46 +165,47 @@ Obtains the scan result. This API uses an asynchronous callback to return the re
| callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the detected hotspots. Otherwise, **err** is a non-zero value and **data** is empty.|
**Example**
- ```js
- import wifi from '@ohos.wifi';
-
- wifi.getScanInfos((err, result) => {
- if (err) {
- console.error("get scan info error");
- return;
- }
-
- var len = Object.keys(result).length;
- console.log("wifi received scan info: " + len);
- for (var i = 0; i < len; ++i) {
- console.info("ssid: " + result[i].ssid);
- console.info("bssid: " + result[i].bssid);
- console.info("capabilities: " + result[i].capabilities);
- console.info("securityType: " + result[i].securityType);
- console.info("rssi: " + result[i].rssi);
- console.info("band: " + result[i].band);
- console.info("frequency: " + result[i].frequency);
- console.info("channelWidth: " + result[i].channelWidth);
- console.info("timestamp: " + result[i].timestamp);
- }
- });
-
- wifi.getScanInfos().then(result => {
- var len = Object.keys(result).length;
- console.log("wifi received scan info: " + len);
- for (var i = 0; i < len; ++i) {
- console.info("ssid: " + result[i].ssid);
- console.info("bssid: " + result[i].bssid);
- console.info("capabilities: " + result[i].capabilities);
- console.info("securityType: " + result[i].securityType);
- console.info("rssi: " + result[i].rssi);
- console.info("band: " + result[i].band);
- console.info("frequency: " + result[i].frequency);
- console.info("channelWidth: " + result[i].channelWidth);
- console.info("timestamp: " + result[i].timestamp);
- }
- });
- ```
+
+```js
+import wifi from '@ohos.wifi';
+
+wifi.getScanInfos((err, result) => {
+ if (err) {
+ console.error("get scan info error");
+ return;
+ }
+
+ var len = Object.keys(result).length;
+ console.log("wifi received scan info: " + len);
+ for (var i = 0; i < len; ++i) {
+ console.info("ssid: " + result[i].ssid);
+ console.info("bssid: " + result[i].bssid);
+ console.info("capabilities: " + result[i].capabilities);
+ console.info("securityType: " + result[i].securityType);
+ console.info("rssi: " + result[i].rssi);
+ console.info("band: " + result[i].band);
+ console.info("frequency: " + result[i].frequency);
+ console.info("channelWidth: " + result[i].channelWidth);
+ console.info("timestamp: " + result[i].timestamp);
+ }
+});
+
+wifi.getScanInfos().then(result => {
+ var len = Object.keys(result).length;
+ console.log("wifi received scan info: " + len);
+ for (var i = 0; i < len; ++i) {
+ console.info("ssid: " + result[i].ssid);
+ console.info("bssid: " + result[i].bssid);
+ console.info("capabilities: " + result[i].capabilities);
+ console.info("securityType: " + result[i].securityType);
+ console.info("rssi: " + result[i].rssi);
+ console.info("band: " + result[i].band);
+ console.info("frequency: " + result[i].frequency);
+ console.info("channelWidth: " + result[i].channelWidth);
+ console.info("timestamp: " + result[i].timestamp);
+ }
+});
+```
## WifiScanInfo
@@ -238,6 +285,25 @@ Adds network configuration. This API uses a promise to return the result.
| -------- | -------- |
| Promise<number> | Promise used to return the WLAN configuration ID. If **-1** is returned, the network configuration fails to be added.|
+ **Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifi.addDeviceConfig(config).then(result => {
+ console.info("result:" + JSON.stringify(result));
+ });
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
+
## WifiDeviceConfig
Represents the WLAN configuration.
@@ -252,13 +318,13 @@ Represents the WLAN configuration.
| preSharedKey | string | Yes| No| PSK of the hotspot.|
| isHiddenSsid | boolean | Yes| No| Whether the network is hidden.|
| securityType | [WifiSecurityType](#wifisecuritytype) | Yes| No| Security type.|
-| creatorUid | number | Yes| No| ID of the creator.
**System API**: This is a system API.|
-| disableReason | number | Yes| No| Reason for disabling WLAN.
**System API**: This is a system API.|
-| netId | number | Yes| No| Network ID.
**System API**: This is a system API.|
-| randomMacType | number | Yes| No| Random MAC type.
**System API**: This is a system API.|
-| randomMacAddr | string | Yes| No| Random MAC address.
**System API**: This is a system API.|
-| ipType | [IpType](#iptype7) | Yes| No| IP address type.
**System API**: This is a system API.|
-| staticIp | [IpConfig](#ipconfig7) | Yes| No| Static IP address configuration.
**System API**: This is a system API.|
+| creatorUid | number | Yes| No| ID of the creator.
**System API**: This is a system API.|
+| disableReason | number | Yes| No| Reason for disabling WLAN.
**System API**: This is a system API.|
+| netId | number | Yes| No| Network ID.
**System API**: This is a system API.|
+| randomMacType | number | Yes| No| Random MAC type.
**System API**: This is a system API.|
+| randomMacAddr | string | Yes| No| Random MAC address.
**System API**: This is a system API.|
+| ipType | [IpType](#iptype7) | Yes| No| IP address type.
**System API**: This is a system API.|
+| staticIp | [IpConfig](#ipconfig7) | Yes| No| Static IP address configuration.
**System API**: This is a system API.|
## IpType7+
@@ -312,7 +378,24 @@ Adds network configuration. This API uses an asynchronous callback to return the
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifi.addDeviceConfig(config,(error,result) => {
+ console.info("result:" + JSON.stringify(result));
+ });
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.addUntrustedConfig7+
addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean>
@@ -335,6 +418,23 @@ Adds the configuration of an untrusted network. This API uses a promise to retur
| -------- | -------- |
| Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifi.addUntrustedConfig(config).then(result => {
+ console.info("result:" + JSON.stringify(result));
+ });
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.addUntrustedConfig7+
@@ -353,6 +453,23 @@ Adds the configuration of an untrusted network. This API uses an asynchronous ca
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
| callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifi.addUntrustedConfig(config,(error,result) => {
+ console.info("result:" + JSON.stringify(result));
+ });
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.removeUntrustedConfig7+
@@ -376,6 +493,21 @@ Removes the configuration of an untrusted network. This API uses a promise to re
| -------- | -------- |
| Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let networkId = 0;
+ wifi.removeUntrustedConfig(networkId).then(result => {
+ console.info("result:" + JSON.stringify(result));
+ });
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
+
## wifi.removeUntrustedConfig7+
@@ -394,6 +526,19 @@ Removes the configuration of an untrusted network. This API uses an asynchronous
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
| callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let networkId = 0;
+ wifi.removeUntrustedConfig(networkId,(error,result) => {
+ console.info("result:" + JSON.stringify(result));
+ });
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.connectToNetwork
@@ -419,6 +564,18 @@ Connects to the specified network.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let networkId = 0;
+ wifi.connectToNetwork(networkId);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.connectToDevice
@@ -445,6 +602,22 @@ Connects to the specified network.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 3
+ }
+ wifi.connectToDevice(config);
+
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.disconnect
@@ -465,6 +638,16 @@ Disconnects the network.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.disconnect();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.getSignalLevel
@@ -489,6 +672,20 @@ Obtains the WLAN signal level.
| -------- | -------- |
| number | Signal level obtained. The value range is [0, 4].|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let rssi = 0;
+ let band = 0;
+ let level = wifi.getSignalLevel(rssi,band);
+ console.info("lelvel:" + JSON.stringify(lelvel));
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+
+```
## wifi.getLinkedInfo
@@ -524,23 +721,23 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
| callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.|
**Example**
- ```js
- import wifi from '@ohos.wifi';
-
- wifi.getLinkedInfo((err, data) => {
- if (err) {
- console.error("get linked info error");
- return;
- }
- console.info("get wifi linked info: " + JSON.stringify(data));
- });
-
- wifi.getLinkedInfo().then(data => {
- console.info("get wifi linked info: " + JSON.stringify(data));
- }).catch(error => {
- console.info("get linked info error");
- });
- ```
+```js
+import wifi from '@ohos.wifi';
+
+wifi.getLinkedInfo((err, data) => {
+ if (err) {
+ console.error("get linked info error");
+ return;
+ }
+ console.info("get wifi linked info: " + JSON.stringify(data));
+});
+
+wifi.getLinkedInfo().then(data => {
+ console.info("get wifi linked info: " + JSON.stringify(data));
+}).catch(error => {
+ console.info("get linked info error");
+});
+```
## WifiLinkedInfo
@@ -553,18 +750,18 @@ Represents the WLAN connection information.
| -------- | -------- | -------- | -------- | -------- |
| ssid | string | Yes| No| SSID of the hotspot, in UTF-8 format.|
| bssid | string | Yes| No| BSSID of the hotspot.|
-| networkId | number | Yes| No| Network configuration ID.
**System API**: This is a system API.|
+| networkId | number | Yes| No| Network configuration ID.
**System API**: This is a system API.|
| rssi | number | Yes| No| RSSI of the hotspot, in dBm.|
| band | number | Yes| No| Frequency band of the WLAN AP.|
| linkSpeed | number | Yes| No| Speed of the WLAN AP.|
| frequency | number | Yes| No| Frequency of the WLAN AP.|
| isHidden | boolean | Yes| No| Whether to hide the WLAN AP.|
| isRestricted | boolean | Yes| No| Whether to restrict data volume at the WLAN AP.|
-| chload | number | Yes| No| Channel load. A larger value indicates a higher load.
**System API**: This is a system API.|
-| snr | number | Yes| No| Signal-to-noise ratio (SNR).
**System API**: This is a system API.|
+| chload | number | Yes| No| Channel load. A larger value indicates a higher load.
**System API**: This is a system API.|
+| snr | number | Yes| No| Signal-to-noise ratio (SNR).
**System API**: This is a system API.|
| macAddress | string | Yes| No| MAC address of the device.|
| ipAddress | number | Yes| No| IP address of the device that sets up the WLAN connection.|
-| suppState | [SuppState](#suppstate) | Yes| No| Supplicant state.
**System API**: This is a system API.|
+| suppState | [SuppState](#suppstate) | Yes| No| Supplicant state.
**System API**: This is a system API.|
| connState | [ConnState](#connstate) | Yes| No| WLAN connection state.|
@@ -684,6 +881,19 @@ Checks whether the device supports the specified WLAN feature.
| -------- | -------- |
| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let featureId = 0;
+ let ret = wifi.isFeatureSupported(featureId);
+ console.info("isFeatureSupported:" + ret);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+
+```
## wifi.getDeviceMacAddress7+
@@ -703,6 +913,18 @@ Obtains the device MAC address.
| -------- | -------- |
| string[] | MAC address obtained.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let ret = wifi.getDeviceMacAddress();
+ console.info("deviceMacAddress:" + JSON.stringify(ret));
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+
+```
## wifi.getIpInfo7+
@@ -720,6 +942,17 @@ Obtains IP information.
| -------- | -------- |
| [IpInfo](#ipinfo7) | IP information obtained.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let info = wifi.getIpInfo();
+ console.info("info:" + JSON.stringify(info));
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## IpInfo7+
@@ -754,6 +987,17 @@ Obtains the country code.
| -------- | -------- |
| string | Country code obtained.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let code = wifi.getCountryCode();
+ console.info("code:" + code);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.reassociate7+
@@ -773,6 +1017,16 @@ Re-associates with the network.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.reassociate();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.reconnect7+
@@ -792,6 +1046,16 @@ Reconnects to the network.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.reconnect();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.getDeviceConfigs7+
@@ -811,6 +1075,17 @@ Obtains network configuration.
| -------- | -------- |
| Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let configs = wifi.getDeviceConfigs();
+ console.info("configs:" + JSON.stringify(configs));
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.updateNetwork7+
@@ -836,6 +1111,22 @@ Updates network configuration.
| -------- | -------- |
| number | ID of the updated network configuration. The value **-1** indicates that the operation has failed.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 3
+ }
+ let ret = wifi.updateNetwork(config);
+ console.error("ret:" + ret);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.disableNetwork7+
@@ -861,6 +1152,17 @@ Disables network configuration.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let netId = 0;
+ wifi.disableNetwork(netId);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.removeAllNetwork7+
@@ -880,6 +1182,16 @@ Removes the configuration of all networks.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.removeAllNetwork();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.removeDevice7+
@@ -905,6 +1217,17 @@ Removes the specified network configuration.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let id = 0;
+ wifi.removeDevice(id);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.enableHotspot7+
@@ -924,6 +1247,16 @@ Enables this hotspot.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.enableHotspot();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.disableHotspot7+
@@ -943,6 +1276,16 @@ Disables this hotspot.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifiManager';
+
+try {
+ wifiManager.disableHotspot();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.isHotspotDualBandSupported7+
@@ -962,6 +1305,17 @@ Checks whether the hotspot supports dual band.
| -------- | -------- |
| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let ret = wifi.isHotspotDualBandSupported();
+ console.info("result:" + ret);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.isHotspotActive7+
@@ -981,6 +1335,17 @@ Checks whether this hotspot is active.
| -------- | -------- |
| boolean | Returns **true** if the hotspot is active; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let ret = wifi.isHotspotActive();
+ console.info("result:" + ret);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.setHotspotConfig7+
@@ -1006,6 +1371,25 @@ Sets hotspot configuration.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ ssid: "****",
+ securityType: 3,
+ band: 0,
+ channel: 0,
+ preSharedKey: "****",
+ maxConn: 0
+ }
+ let ret = wifi.setHotspotConfig();
+ console.info("result:" + ret);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## HotspotConfig7+
@@ -1042,6 +1426,17 @@ obtains hotspot configuration.
| -------- | -------- |
| [HotspotConfig](#hotspotconfig7) | Hotspot configuration obtained.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = wifi.getHotspotConfig();
+ console.info("result:" + JSON.stringify(config));
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.getStations7+
@@ -1061,6 +1456,17 @@ Obtains information about the connected stations.
| -------- | -------- |
| Array<[StationInfo](#stationinfo7)> | Connected stations obtained.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let stations = wifi.getStations();
+ console.info("result:" + JSON.stringify(stations));
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## StationInfo7+
@@ -1136,6 +1542,22 @@ Obtains P2P link information. This API uses an asynchronous callback to return t
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+wifi.getP2pLinkedInfo((err, data) => {
+ if (err) {
+ console.error("get p2p linked info error");
+ return;
+ }
+ console.info("get wifi p2p linked info: " + JSON.stringify(data));
+});
+
+wifi.getP2pLinkedInfo().then(data => {
+ console.info("get wifi p2p linked info: " + JSON.stringify(data));
+});
+```
## wifi.getCurrentGroup8+
@@ -1170,6 +1592,22 @@ Obtains the current P2P group information. This API uses an asynchronous callbac
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+wifi.getCurrentGroup((err, data) => {
+ if (err) {
+ console.error("get current P2P group error");
+ return;
+ }
+ console.info("get current P2P group: " + JSON.stringify(data));
+});
+
+wifi.getCurrentGroup().then(data => {
+ console.info("get current P2P group: " + JSON.stringify(data));
+});
+```
## wifi.getP2pPeerDevices8+
@@ -1204,6 +1642,22 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.|
+**Example**
+```js
+import wifi from '@ohos.wifiManager';
+
+wifi.getP2pPeerDevices((err, data) => {
+ if (err) {
+ console.error("get P2P peer devices error");
+ return;
+ }
+ console.info("get P2P peer devices: " + JSON.stringify(data));
+});
+
+wifi.getP2pPeerDevices().then(data => {
+ console.info("get P2P peer devices: " + JSON.stringify(data));
+});
+```
## WifiP2pDevice8+
@@ -1257,6 +1711,24 @@ Creates a P2P group.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let config = {
+ deviceAddress: "****",
+ netId: 0,
+ passphrase: "*****",
+ groupName: "****",
+ goBand: 0
+ }
+ wifi.createGroup(config);
+
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## WifiP2PConfig8+
@@ -1302,6 +1774,16 @@ Removes this P2P group.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.removeGroup();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.p2pConnect8+
@@ -1328,71 +1810,71 @@ Sets up a P2P connection.
**Example**
- ```js
- import wifi from '@ohos.wifi';
-
- var recvP2pConnectionChangeFunc = result => {
- console.info("p2p connection change receive event: " + JSON.stringify(result));
- wifi.getP2pLinkedInfo((err, data) => {
- if (err) {
- console.error('failed to get getP2pLinkedInfo: ' + JSON.stringify(err));
- return;
- }
- console.info("get getP2pLinkedInfo: " + JSON.stringify(data));
- });
- }
- wifi.on("p2pConnectionChange", recvP2pConnectionChangeFunc);
-
- var recvP2pDeviceChangeFunc = result => {
- console.info("p2p device change receive event: " + JSON.stringify(result));
- }
- wifi.on("p2pDeviceChange", recvP2pDeviceChangeFunc);
-
- var recvP2pPeerDeviceChangeFunc = result => {
- console.info("p2p peer device change receive event: " + JSON.stringify(result));
- wifi.getP2pPeerDevices((err, data) => {
- if (err) {
- console.error('failed to get peer devices: ' + JSON.stringify(err));
- return;
- }
- console.info("get peer devices: " + JSON.stringify(data));
- var len = Object.keys(data).length;
- for (var i = 0; i < len; ++i) {
- if (data[i].deviceName === "my_test_device") {
- console.info("p2p connect to test device: " + data[i].deviceAddress);
- var config = {
- "deviceAddress":data[i].deviceAddress,
- "netId":-2,
- "passphrase":"",
- "groupName":"",
- "goBand":0,
- }
- wifi.p2pConnect(config);
- }
- }
- });
- }
- wifi.on("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
-
- var recvP2pPersistentGroupChangeFunc = () => {
- console.info("p2p persistent group change receive event");
-
- wifi.getCurrentGroup((err, data) => {
- if (err) {
- console.error('failed to get current group: ' + JSON.stringify(err));
- return;
- }
- console.info("get current group: " + JSON.stringify(data));
- });
- }
- wifi.on("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);
-
- setTimeout(function() {wifi.off("p2pConnectionChange", recvP2pConnectionChangeFunc);}, 125 * 1000);
- setTimeout(function() {wifi.off("p2pDeviceChange", recvP2pDeviceChangeFunc);}, 125 * 1000);
- setTimeout(function() {wifi.off("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);}, 125 * 1000);
- setTimeout(function() {wifi.off("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);}, 125 * 1000);
- console.info("start discover devices -> " + wifi.startDiscoverDevices());
- ```
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pConnectionChangeFunc = result => {
+ console.info("p2p connection change receive event: " + JSON.stringify(result));
+ wifi.getP2pLinkedInfo((err, data) => {
+ if (err) {
+ console.error('failed to get getP2pLinkedInfo: ' + JSON.stringify(err));
+ return;
+ }
+ console.info("get getP2pLinkedInfo: " + JSON.stringify(data));
+ });
+}
+wifi.on("p2pConnectionChange", recvP2pConnectionChangeFunc);
+
+var recvP2pDeviceChangeFunc = result => {
+ console.info("p2p device change receive event: " + JSON.stringify(result));
+}
+wifi.on("p2pDeviceChange", recvP2pDeviceChangeFunc);
+
+var recvP2pPeerDeviceChangeFunc = result => {
+ console.info("p2p peer device change receive event: " + JSON.stringify(result));
+ wifi.getP2pPeerDevices((err, data) => {
+ if (err) {
+ console.error('failed to get peer devices: ' + JSON.stringify(err));
+ return;
+ }
+ console.info("get peer devices: " + JSON.stringify(data));
+ var len = Object.keys(data).length;
+ for (var i = 0; i < len; ++i) {
+ if (data[i].deviceName === "my_test_device") {
+ console.info("p2p connect to test device: " + data[i].deviceAddress);
+ var config = {
+ "deviceAddress":data[i].deviceAddress,
+ "netId":-2,
+ "passphrase":"",
+ "groupName":"",
+ "goBand":0,
+ }
+ wifi.p2pConnect(config);
+ }
+ }
+ });
+}
+wifi.on("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
+
+var recvP2pPersistentGroupChangeFunc = () => {
+ console.info("p2p persistent group change receive event");
+
+ wifi.getCurrentGroup((err, data) => {
+ if (err) {
+ console.error('failed to get current group: ' + JSON.stringify(err));
+ return;
+ }
+ console.info("get current group: " + JSON.stringify(data));
+ });
+}
+wifi.on("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);
+
+setTimeout(function() {wifi.off("p2pConnectionChange", recvP2pConnectionChangeFunc);}, 125 * 1000);
+setTimeout(function() {wifi.off("p2pDeviceChange", recvP2pDeviceChangeFunc);}, 125 * 1000);
+setTimeout(function() {wifi.off("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);}, 125 * 1000);
+setTimeout(function() {wifi.off("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);}, 125 * 1000);
+console.info("start discover devices -> " + wifi.startDiscoverDevices());
+```
## wifi.p2pCancelConnect8+
@@ -1410,6 +1892,16 @@ Cancels this P2P connection.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.p2pCancelConnect();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.startDiscoverDevices8+
@@ -1427,6 +1919,16 @@ Starts to discover devices.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.startDiscoverDevices();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.stopDiscoverDevices8+
@@ -1444,6 +1946,16 @@ Stops discovering devices.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ wifi.stopDiscoverDevices();
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.deletePersistentGroup8+
@@ -1470,6 +1982,17 @@ Deletes a persistent group.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let netId = 0;
+ wifi.deletePersistentGroup(netId);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## WifiP2pGroupInfo8+
@@ -1514,6 +2037,17 @@ Sets the device name.
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+try {
+ let name = "****";
+ wifi.setDeviceName(netId);
+}catch(error){
+ console.error("failed:" + JSON.stringify(error));
+}
+```
## wifi.on('wifiStateChange')7+
@@ -1560,19 +2094,19 @@ Unregisters the WLAN state change events.
| callback | Callback<number> | No| Callback for the WLAN state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Example**
- ```js
- import wifi from '@ohos.wifi';
-
- var recvPowerNotifyFunc = result => {
- console.info("Receive power state change event: " + result);
- }
-
- // Register an event.
- wifi.on("wifiStateChange", recvPowerNotifyFunc);
-
- // Unregister an event.
- wifi.off("wifiStateChange", recvPowerNotifyFunc);
- ```
+```js
+import wifi from '@ohos.wifi';
+
+var recvPowerNotifyFunc = result => {
+ console.info("Receive power state change event: " + result);
+}
+
+// Register an event.
+wifi.on("wifiStateChange", recvPowerNotifyFunc);
+
+// Unregister an event.
+wifi.off("wifiStateChange", recvPowerNotifyFunc);
+```
## wifi.on('wifiConnectionChange')7+
@@ -1617,6 +2151,20 @@ Unregisters the WLAN connection state change events.
| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
| callback | Callback<number> | No| Callback for the WLAN connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvWifiConnectionChangeFunc = result => {
+ console.info("Receive wifi connection change event: " + result);
+}
+
+// Register an event.
+wifi.on("wifiConnectionChange", recvWifiConnectionChangeFunc);
+
+// Unregister an event.
+wifi.off("wifiConnectionChange", recvWifiConnectionChangeFunc);
+```
## wifi.on('wifiScanStateChange')7+
@@ -1660,6 +2208,20 @@ Unregisters the WLAN scan state change events.
| type | string | Yes| Event type. The value is **wifiScanStateChange**.|
| callback | Callback<number> | No| Callback for the WLAN scan state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvWifiScanStateChangeFunc = result => {
+ console.info("Receive Wifi scan state change event: " + result);
+}
+
+// Register an event.
+wifi.on("wifiScanStateChange", recvWifiScanStateChangeFunc);
+
+// Unregister an event.
+wifi.off("wifiScanStateChange", recvWifiScanStateChangeFunc);
+```
## wifi.on('wifiRssiChange')7+
@@ -1696,7 +2258,20 @@ Unregisters the RSSI change events.
| type | string | Yes| Event type. The value is **wifiRssiChange**.|
| callback | Callback<number> | No| Callback for the RSSI. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvWifiRssiChangeFunc = result => {
+ console.info("Receive wifi rssi change event: " + result);
+}
+
+// Register an event.
+wifi.on("wifiRssiChange", recvWifiRssiChangeFunc);
+// Unregister an event.
+wifi.off("wifiRssiChange", recvWifiRssiChangeFunc);
+```
## wifi.on('hotspotStateChange')7+
on(type: "hotspotStateChange", callback: Callback<number>): void
@@ -1723,6 +2298,20 @@ Registers the hotspot state change events.
| 2 | Activating|
| 3 | Deactivating|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvHotspotStateChangeFunc = result => {
+ console.info("Receive hotspot state change event: " + result);
+}
+
+// Register an event.
+wifi.on("hotspotStateChange", recvHotspotStateChangeFunc);
+
+// Unregister an event.
+wifi.off("hotspotStateChange", recvHotspotStateChangeFunc);
+```
## wifi.off('hotspotStateChange')7+
@@ -1786,6 +2375,20 @@ Unregisters the P2P state change events.
| type | string | Yes| Event type. The value is **p2pStateChange**.|
| callback | Callback<number> | No| Callback for the P2P state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pStateChangeFunc = result => {
+ console.info("Receive p2p state change event: " + result);
+}
+
+// Register an event.
+wifi.on("p2pStateChange", recvP2pStateChangeFunc);
+
+// Unregister an event.
+wifi.off("p2pStateChange", recvP2pStateChangeFunc);
+```
## wifi.on('p2pConnectionChange')8+
@@ -1822,6 +2425,20 @@ Unregisters the P2P connection state change events.
| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | No| Callback for the P2P connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pConnectionChangeFunc = result => {
+ console.info("Receive p2p connection change event: " + result);
+}
+
+// Register an event.
+wifi.on("p2pConnectionChange", recvP2pConnectionChangeFunc);
+
+// Unregister an event.
+wifi.off("p2pConnectionChange", recvP2pConnectionChangeFunc);
+```
## wifi.on('p2pDeviceChange')8+
@@ -1858,6 +2475,20 @@ Unregisters the P2P device state change events.
| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
| callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | No| Callback for the P2P device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pDeviceChangeFunc = result => {
+ console.info("Receive recv p2p device change event: " + result);
+}
+
+// Register an event.
+wifi.on("p2pDeviceChange", recvP2pDeviceChangeFunc);
+
+// Unregister an event.
+wifi.off("p2pDeviceChange", recvP2pDeviceChangeFunc);
+```
## wifi.on('p2pPeerDeviceChange')8+
@@ -1894,6 +2525,20 @@ Unregisters the P2P peer device state change events.
| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | No| Callback for the peer device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pPeerDeviceChangeFunc = result => {
+ console.info("Receive recv p2p peer device change event: " + result);
+}
+
+// Register an event.
+wifi.on("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
+
+// Unregister an event.
+wifi.off("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
+```
## wifi.on('p2pPersistentGroupChange')8+
@@ -1930,6 +2575,21 @@ Unregisters the P2P persistent group state change events.
| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
| callback | Callback<void> | No| Callback for the P2P persistent group state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pPersistentGroupChangeFunc = result => {
+ console.info("Receive recv p2p persistent group change event: " + result);
+}
+
+// Register an event.
+wifi.on("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);
+
+// Unregister an event.
+wifi.off("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);
+
+```
## wifi.on('p2pDiscoveryChange')8+
@@ -1972,3 +2632,18 @@ Unregisters the P2P device discovery state change events.
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
| callback | Callback<number> | No| Callback for the P2P device discovery state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+
+**Example**
+```js
+import wifi from '@ohos.wifi';
+
+var recvP2pDiscoveryChangeFunc = result => {
+ console.info("Receive recv p2p discovery change event: " + result);
+}
+
+// Register an event.
+wifi.on("p2pDiscoveryChange", recvP2pDiscoveryChangeFunc);
+
+// Unregister an event.
+wifi.off("p2pDiscoveryChange", recvP2pDiscoveryChangeFunc);
+```
diff --git a/en/application-dev/reference/apis/js-apis-wifiManager.md b/en/application-dev/reference/apis/js-apis-wifiManager.md
index dc9beb94d7fcc13d6c82e805bf8855d537e907bd..6d560d345805826369d8b83cfdcbee53a47b00f5 100644
--- a/en/application-dev/reference/apis/js-apis-wifiManager.md
+++ b/en/application-dev/reference/apis/js-apis-wifiManager.md
@@ -26,18 +26,29 @@ Enables WLAN.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.enableWifi();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
## wifi.disableWifi9+
@@ -53,18 +64,30 @@ Disables WLAN.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.disableWifi();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.isWifiActive9+
isWifiActive(): boolean
@@ -77,132 +100,119 @@ Checks whether WLAN is enabled.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let isActivate = wifiManager.isActivate();
+ console.info("isActivate:" + isActivate);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.scan9+
scan(): void
Starts a scan for WLAN.
-**Required permissions**: **ohos.permission.SET_WIFI_INFO** and **ohos.permission.LOCATION**
+**Required permissions**: ohos.permission.SET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.STA
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
-## wifi.getScanResults9+
-
-getScanResults(): Promise<Array<WifiScanInfo>>
-
-Obtains the scan result. This API uses a promise to return the result.
-
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_PEERS_MAC (or ohos.permission.LOCATION)
-
-**System capability**: SystemCapability.Communication.WiFi.STA
-
-**Return value**
-
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | Promise used to return the hotspots detected.|
-
-**Error codes**
+**Example**
-For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
+```
+ import wifi from '@ohos.wifiManager';
-| **Type**| **Description**|
- | -------- | -------- |
-| 2501000 | Operation failed.|
+ try {
+ wifiManager.scan();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
-## wifi.getScanResults9+
+## wifi.getScanInfoList9+
-getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void
+getScanInfoList(): Array<WifiScanInfo>;
-Obtains the scan result. This API uses an asynchronous callback to return the result.
+Obtains the scan result.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_PEERS_MAC (or ohos.permission.LOCATION)
+**Required permissions**: ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION))
**System capability**: SystemCapability.Communication.WiFi.STA
-**Parameters**
+**Return value**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the detected hotspots. Otherwise, **err** is a non-zero value and **data** is empty.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiScanInfo](#wifiscaninfo)> | Returns the hotspots detected.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
**Example**
- ```js
- import wifi from '@ohos.wifi';
-
- wifi.getScanInfos((err, result) => {
- if (err) {
- console.error("get scan info error");
- return;
- }
-
- var len = Object.keys(result).length;
- console.log("wifi received scan info: " + len);
- for (var i = 0; i < len; ++i) {
- console.info("ssid: " + result[i].ssid);
- console.info("bssid: " + result[i].bssid);
- console.info("capabilities: " + result[i].capabilities);
- console.info("securityType: " + result[i].securityType);
- console.info("rssi: " + result[i].rssi);
- console.info("band: " + result[i].band);
- console.info("frequency: " + result[i].frequency);
- console.info("channelWidth: " + result[i].channelWidth);
- console.info("timestamp: " + result[i].timestamp);
- }
- });
-
- wifi.getScanInfos().then(result => {
- var len = Object.keys(result).length;
- console.log("wifi received scan info: " + len);
- for (var i = 0; i < len; ++i) {
- console.info("ssid: " + result[i].ssid);
- console.info("bssid: " + result[i].bssid);
- console.info("capabilities: " + result[i].capabilities);
- console.info("securityType: " + result[i].securityType);
- console.info("rssi: " + result[i].rssi);
- console.info("band: " + result[i].band);
- console.info("frequency: " + result[i].frequency);
- console.info("channelWidth: " + result[i].channelWidth);
- console.info("timestamp: " + result[i].timestamp);
- }
- });
- ```
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let scanInfoList = wifiManager.getScanInfoList();
+ console.info("scanInfoList:" + JSON.stringify(scanInfoList));
+ let len = Object.keys(result).length;
+ console.log("wifi received scan info: " + len);
+ if(len > 0){
+ for (var i = 0; i < len; ++i) {
+ console.info("ssid: " + scanInfoList[i].ssid);
+ console.info("bssid: " + scanInfoList[i].bssid);
+ console.info("capabilities: " + scanInfoList[i].capabilities);
+ console.info("securityType: " + scanInfoList[i].securityType);
+ console.info("rssi: " + scanInfoList[i].rssi);
+ console.info("band: " + scanInfoList[i].band);
+ console.info("frequency: " + scanInfoList[i].frequency);
+ console.info("channelWidth: " + scanInfoList[i].channelWidth);
+ console.info("timestamp: " + scanInfoList[i].timestamp);
+ }
+ }
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
## WifiScanInfo9+
@@ -248,59 +258,65 @@ Enumerates the WLAN security types.
| WIFI_SEC_TYPE_WAPI_PSK9+ | 9 | WAPI-PSK.|
-## WifiInfoElem9+
+## WifiBandType10+
-Represents a WLAN information element.
+Enumerates the Wi-Fi band types.
**System capability**: SystemCapability.Communication.WiFi.STA
+| **Name**| **Value**| **Description**|
+| -------- | -------- | -------- |
+| WIFI_BAND_NONE | 0 | Invalid band type|
+| WIFI_BAND_2G | 1 | 2.4 GHz|
+| WIFI_BAND_5G | 2 | 5 GHz|
+| WIFI_BAND_6G | 3 | 6 GHz|
+| WIFI_BAND_60G | 4 | 60 GHz|
-| **Name**| **Type**| **Readable**| **Writable**| **Description**|
-| -------- | -------- | -------- | -------- | -------- |
-| eid | number | Yes| No| ID of the information element.|
-| content | Uint8Array | Yes| No| Content of the information element.|
-
-
-## WifiChannelWidth9+
+## WifiStandard10+
-Enumerates the WLAN channel widths.
+Enumerates the Wi-Fi standards.
**System capability**: SystemCapability.Communication.WiFi.STA
-
| **Name**| **Value**| **Description**|
| -------- | -------- | -------- |
-| WIDTH_20MHZ | 0 | 20 MHz.|
-| WIDTH_40MHZ | 1 | 40 MHz.|
-| WIDTH_80MHZ | 2 | 80 MHz.|
-| WIDTH_160MHZ | 3 | 160 MHz.|
-| WIDTH_80MHZ_PLUS | 4 | 80 MHz+.|
-| WIDTH_INVALID | 5 | Invalid value.|
+| WIFI_STANDARD_UNDEFINED | 0 | Invalid Wi-Fi standard|
+| WIFI_STANDARD_11A | 1 | 802.11a|
+| WIFI_STANDARD_11B | 2 | 802.11b|
+| WIFI_STANDARD_11G | 3 | 802.11g|
+| WIFI_STANDARD_11N | 4 | 802.11n|
+| WIFI_STANDARD_11AC | 5 | 802.11ac|
+| WIFI_STANDARD_11AX | 6 | 802.11ax|
+| WIFI_STANDARD_11AD | 7 | 802.11ad|
+## WifiInfoElem9+
-## wifi.getScanResultsSync9+
+Represents a WLAN information element.
-getScanResultsSync(): Array<[WifiScanInfo](#wifiscaninfo)>
+**System capability**: SystemCapability.Communication.WiFi.STA
-Obtains the scan result. This API returns the result synchronously.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_PEERS_MAC (or ohos.permission.LOCATION)
+| **Name**| **Type**| **Readable**| **Writable**| **Description**|
+| -------- | -------- | -------- | -------- | -------- |
+| eid | number | Yes| No| ID of the information element.|
+| content | Uint8Array | Yes| No| Content of the information element.|
-**System capability**: SystemCapability.Communication.WiFi.STA
-**Return value**
+## WifiChannelWidth9+
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.|
+Enumerates the WLAN channel widths.
-**Error codes**
+**System capability**: SystemCapability.Communication.WiFi.STA
-For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
-| 2501000 | Operation failed.|
+| **Name**| **Value**| **Description**|
+| -------- | -------- | -------- |
+| WIDTH_20MHZ | 0 | 20 MHz|
+| WIDTH_40MHZ | 1 | 40 MHz|
+| WIDTH_80MHZ | 2 | 80 MHz|
+| WIDTH_160MHZ | 3 | 160 MHz|
+| WIDTH_80MHZ_PLUS | 4 | 80 MHz+|
+| WIDTH_INVALID | 5 | Invalid value|
## wifi.addDeviceConfig9+
@@ -316,24 +332,43 @@ Adds network configuration. This API uses a promise to return the result.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<number> | Promise used to return the ID of the added network configuration. If **-1** is returned, the network configuration fails to be added.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<number> | Promise used to return the ID of the added network configuration. If **-1** is returned, the network configuration fails to be added.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifiManager.addDeviceConfig(config).then(result => {
+ console.info("result:" + JSON.stringify(result));
+ });
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## WifiDeviceConfig9+
Represents the WLAN configuration.
@@ -348,14 +383,14 @@ Represents the WLAN configuration.
| preSharedKey | string | Yes| No| PSK of the hotspot.|
| isHiddenSsid | boolean | Yes| No| Whether the network is hidden.|
| securityType | [WifiSecurityType](#wifisecuritytype) | Yes| No| Security type.|
-| creatorUid | number | Yes| No| ID of the creator.
**System API**: This is a system API.|
-| disableReason | number | Yes| No| Reason for disabling WLAN.
**System API**: This is a system API.|
-| netId | number | Yes| No| Network ID.
**System API**: This is a system API.|
-| randomMacType | number | Yes| No| Random MAC type.
**System API**: This is a system API.|
-| randomMacAddr | string | Yes| No| Random MAC address.
**System API**: This is a system API.|
-| ipType | [IpType](#iptype9) | Yes| No| IP address type.
**System API**: This is a system API.|
-| staticIp | [IpConfig](#ipconfig9) | Yes| No| Static IP address configuration.
**System API**: This is a system API.|
-| eapConfig9+ | [WifiEapConfig](#wifieapconfig9) | Yes| No| EAP configuration.
**System API**: This is a system API.|
+| creatorUid | number | Yes| No| ID of the creator.
**System API**: This is a system API.|
+| disableReason | number | Yes| No| Reason for disabling WLAN.
**System API**: This is a system API.|
+| netId | number | Yes| No| Network ID.
**System API**: This is a system API.|
+| randomMacType | number | Yes| No| Random MAC type.
**System API**: This is a system API.|
+| randomMacAddr | string | Yes| No| Random MAC address.
**System API**: This is a system API.|
+| ipType | [IpType](#iptype9) | Yes| No| IP address type.
**System API**: This is a system API.|
+| staticIp | [IpConfig](#ipconfig9) | Yes| No| Static IP address configuration.
**System API**: This is a system API.|
+| eapConfig9+ | [WifiEapConfig](#wifieapconfig9) | Yes| No| EAP configuration.
**System API**: This is a system API.|
## IpType9+
@@ -473,19 +508,38 @@ Adds network configuration. This API uses an asynchronous callback to return the
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
- | callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifiManager.addDeviceConfig(config,(error,result) => {
+ console.info("result:" + JSON.stringify(result));
+ });
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.addCandidateConfig9+
addCandidateConfig(config: WifiDeviceConfig): Promise<number>
@@ -498,24 +552,42 @@ Adds the configuration of a candidate network. This API uses a promise to return
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<number> | Promise used to return the network configuration ID.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<number> | Promise used to return the network configuration ID.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+`````
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifiManager.addCandidateConfig(config).then(result => {
+ console.info("result:" + JSON.stringify(result));
+ });
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+`````
+
## wifi.addCandidateConfig9+
addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void
@@ -528,19 +600,37 @@ Adds the configuration of a candidate network. This API uses an asynchronous cal
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
- | callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+`````
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 0
+ }
+ wifiManager.addCandidateConfig(config,(error,result) => {
+ console.info("result:" + JSON.stringify(result));
+ });
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+`````
+
## wifi.removeCandidateConfig9+
removeCandidateConfig(networkId: number): Promise<void>
@@ -553,24 +643,39 @@ Removes the configuration of a candidate network. This API uses a promise to ret
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| ID of the network configuration to remove.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the network configuration to remove.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<void> | Promise used to return the result.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<void> | Promise used to return the result.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let networkId = 0;
+ wifiManager.removeCandidateConfig(networkId).then(result => {
+ console.info("result:" + JSON.stringify(result));
+ });
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.removeCandidateConfig9+
removeCandidateConfig(networkId: number, callback: AsyncCallback<void>): void
@@ -583,48 +688,84 @@ Removes the configuration of a candidate network. This API uses an asynchronous
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| ID of the network configuration to remove.|
- | callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the network configuration to remove.|
+| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let networkId = 0;
+ wifiManager.removeCandidateConfig(networkId,(error,result) => {
+ console.info("result:" + JSON.stringify(result));
+ });
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.getCandidateConfigs9+
getCandidateConfigs(): Array<[WifiDeviceConfig](#wifideviceconfig)>
Obtains candidate network configuration.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.STA
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[WifiDeviceConfig](#wifideviceconfig)> | Candidate network configuration obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiDeviceConfig](#wifideviceconfig)> | Candidate network configuration obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+
+`````
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let configs = wifiManager.getCandidateConfigs();
+ console.info("configs:" + JSON.stringify(configs));
+ let len = Object.keys(configs).length;
+ console.log("result len: " + len);
+ if(len > 0){
+ for (var i = 0; i < len; ++i) {
+ console.info("ssid: " + configs[i].ssid);
+ console.info("bssid: " + configs[i].bssid);
+ }
+ }
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+`````
+
## wifi.connectToCandidateConfig9+
connectToCandidateConfig(networkId: number): void
-Connects to a candidate network.
+Connects to a candidate network added by the application. If the device is already connected to a hotspot, disconnect it from the hotspot first.
**Required permissions**: ohos.permission.SET_WIFI_INFO
@@ -632,24 +773,38 @@ Connects to a candidate network.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| ID of the candidate network configuration.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the candidate network configuration.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let networkId = 0;
+ let ret = wifiManager.connectToCandidateConfig(networkId);
+ console.info("result:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
+
## wifi.connectToNetwork9+
connectToNetwork(networkId: number): void
-Connects to the specified network.
+Connects to the specified network. If the device is already connected to a hotspot, use **disconnect()** to disconnect it from the hotspot first.
**System API**: This is a system API.
@@ -659,24 +814,37 @@ Connects to the specified network.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| Network configuration ID.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| Network configuration ID.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
+**Example**
+
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let networkId = 0;
+ wifiManager.connectToNetwork(networkId);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.connectToDevice9+
connectToDevice(config: WifiDeviceConfig): void
-Connects to the specified network.
+Connects to the specified network. If the device is already connected to a hotspot, use **disconnect()** to disconnect it from the hotspot first.
**System API**: This is a system API.
@@ -687,19 +855,36 @@ Connects to the specified network.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| Configuration of the WLAN to connect. |
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 3
+ }
+ wifiManager.connectToDevice(config);
+
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.disconnect9+
disconnect(): void
@@ -717,10 +902,21 @@ Disconnects the network.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.disconnect();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.getSignalLevel9+
getSignalLevel(rssi: number, band: number): number
@@ -733,25 +929,40 @@ Obtains the WLAN signal level.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | rssi | number | Yes| RSSI of the hotspot, in dBm.|
- | band | number | Yes| Frequency band of the WLAN AP.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| rssi | number | Yes| RSSI of the hotspot, in dBm.|
+| band | number | Yes| Frequency band of the WLAN AP.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | number | Signal level obtained. The value range is [0, 4].|
+| **Type**| **Description**|
+| -------- | -------- |
+| number | Signal level obtained. The value range is [0, 4].|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let rssi = 0;
+ let band = 0;
+ let level = wifiManager.getSignalLevel(rssi,band);
+ console.info("lelvel:" + JSON.stringify(lelvel));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
+
## wifi.getLinkedInfo9+
getLinkedInfo(): Promise<WifiLinkedInfo>
@@ -764,16 +975,16 @@ Obtains WLAN connection information. This API uses a promise to return the resul
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiLinkedInfo](#wifilinkedinfo)> | Promise used to return the WLAN connection information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiLinkedInfo](#wifilinkedinfo)> | Promise used to return the WLAN connection information obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
@@ -789,22 +1000,22 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
**Example**
```js
- import wifi from '@ohos.wifi';
+ import wifi from '@ohos.wifiManager';
wifi.getLinkedInfo((err, data) => {
if (err) {
@@ -832,21 +1043,25 @@ Represents the WLAN connection information.
| -------- | -------- | -------- | -------- | -------- |
| ssid | string | Yes| No| SSID of the hotspot, in UTF-8 format.|
| bssid | string | Yes| No| BSSID of the hotspot.|
-| networkId | number | Yes| No| Network configuration ID.
**System API**: This is a system API.|
+| networkId | number | Yes| No| Network configuration ID.
**System API**: This is a system API.|
| rssi | number | Yes| No| RSSI of the hotspot, in dBm.|
-| band | number | Yes| No| Frequency band of the WLAN AP.|
-| linkSpeed | number | Yes| No| Speed of the WLAN AP.|
+| band | number | Yes| No| Band of the WLAN AP.|
+| linkSpeed | number | Yes| No| Uplink speed of the WLAN AP.|
+| rxLinkSpeed10+ | number | Yes| No| Downlink speed of the WLAN AP.|
+| maxSupportedTxLinkSpeed10+ | number | Yes| No| Maximum uplink speed supported.|
+| maxSupportedRxLinkSpeed10+ | number | Yes| No| Maximum uplink speed supported.|
| frequency | number | Yes| No| Frequency of the WLAN AP.|
| isHidden | boolean | Yes| No| Whether to hide the WLAN AP.|
| isRestricted | boolean | Yes| No| Whether to restrict data volume at the WLAN AP.|
-| chload | number | Yes| No| Channel load. A larger value indicates a higher load.
**System API**: This is a system API.|
-| snr | number | Yes| No| Signal-to-noise ratio (SNR).
**System API**: This is a system API.|
-| macType9+ | number | Yes| No| MAC address type.|
+| chload | number | Yes| No| Channel load. A larger value indicates a higher load.
**System API**: This is a system API.|
+| snr | number | Yes| No| Signal-to-noise ratio (SNR).
**System API**: This is a system API.|
+| macType | number | Yes| No| MAC address type.|
| macAddress | string | Yes| No| MAC address of the device.|
| ipAddress | number | Yes| No| IP address of the device that sets up the WLAN connection.|
-| suppState | [SuppState](#suppstate) | Yes| No| Supplicant state.
**System API**: This is a system API.|
+| suppState | [SuppState](#suppstate) | Yes| No| Supplicant state.
**System API**: This is a system API.|
| connState | [ConnState](#connstate) | Yes| No| WLAN connection state.|
-
+| channelWidth10+ | [WifiChannelWidth](#wifichannelwidth) | Yes| No| Channel bandwidth of the connected hotspot.|
+| wifiStandard10+ | [WifiStandard](#wifistandard) | Yes| No| Wi-Fi standard used by the connected hotspot.|
## ConnState9+
@@ -889,6 +1104,23 @@ Enumerates the supplicant states.
| UNINITIALIZED | 10 | The supplicant failed to set up the connection.|
| INVALID | 11 | Invalid value.|
+## SuppState10+
+
+Enumerates the Wi-Fi standards.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| Name| Value| Description|
+| -------- | -------- | -------- |
+| WIFI_STANDARD_UNDEFINED | 0 | Undefined|
+| WIFI_STANDARD_11A | 1 | 802.11a|
+| WIFI_STANDARD_11B | 2 | 802.11b|
+| WIFI_STANDARD_11G | 3 | 802.11g|
+| WIFI_STANDARD_11N | 4 | 802.11n|
+| WIFI_STANDARD_11AC | 5 | 802.11ac|
+| WIFI_STANDARD_11AX | 6 | 802.11ax|
+| WIFI_STANDARD_11AD | 7 | 802.11ad|
+
## wifi.isConnected9+
@@ -902,18 +1134,31 @@ Checks whether the WLAN is connected.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let ret = wifiManager.isConnected();
+ console.info("isConnected:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
+
## wifi.getSupportedFeatures9+
getSupportedFeatures(): number
@@ -928,9 +1173,9 @@ Obtains the features supported by this device.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | number | Feature value. |
+| **Type**| **Description**|
+| -------- | -------- |
+| number | Feature value. |
**Feature IDs**
@@ -951,10 +1196,23 @@ Obtains the features supported by this device.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2401000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let ret = wifiManager.getSupportedFeatures();
+ console.info("supportedFeatures:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
+
## wifi.isFeatureSupported9+
isFeatureSupported(featureId: number): boolean
@@ -968,24 +1226,38 @@ Checks whether the device supports the specified WLAN feature.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | featureId | number | Yes| Feature ID.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| featureId | number | Yes| Feature ID.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2401000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let featureId = 0;
+ let ret = wifiManager.isFeatureSupported(featureId);
+ console.info("isFeatureSupported:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
+
## wifi.getDeviceMacAddress9+
getDeviceMacAddress(): string[]
@@ -1000,18 +1272,31 @@ Obtains the device MAC address.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | string[] | MAC address obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| string[] | MAC address obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let ret = wifiManager.getDeviceMacAddress();
+ console.info("deviceMacAddress:" + JSON.stringify(ret));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+
+```
+
## wifi.getIpInfo9+
getIpInfo(): IpInfo
@@ -1024,18 +1309,30 @@ Obtains IP information.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | [IpInfo](#ipinfo9) | IP information obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| [IpInfo](#ipinfo9) | IP information obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let info = wifiManager.getIpInfo();
+ console.info("info:" + JSON.stringify(info));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## IpInfo9+
Represents IP information.
@@ -1065,18 +1362,30 @@ Obtains the country code.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | string | Country code obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| string | Country code obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2401000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let code = wifiManager.getCountryCode();
+ console.info("code:" + code);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.reassociate9+
reassociate(): void
@@ -1093,11 +1402,22 @@ Re-associates with the network.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.reassociate();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.reconnect9+
reconnect(): void
@@ -1114,11 +1434,22 @@ Reconnects to the network.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
| 2501001 | Wifi is closed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.reconnect();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.getDeviceConfigs9+
getDeviceConfigs(): Array<[WifiDeviceConfig](#wifideviceconfig)>
@@ -1127,27 +1458,39 @@ Obtains network configuration.
**System API**: This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.GET_WIFI_CONFIG
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, ohos.permission.APPROXIMATELY_LOCATION, and ohos.permission.GET_WIFI_CONFIG
**System capability**: SystemCapability.Communication.WiFi.STA
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
-## wifi.updateNetwork9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let configs = wifiManager.getDeviceConfigs();
+ console.info("configs:" + JSON.stringify(configs));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
-updateNetwork(config: WifiDeviceConfig): number
+## wifi.updateDeviceConfig9+
+
+updateDeviceConfig(config: WifiDeviceConfig): number
Updates network configuration.
@@ -1159,27 +1502,44 @@ Updates network configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| New WLAN configuration.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| New WLAN configuration.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | number | ID of the updated network configuration. The value **-1** indicates that the operation has failed.|
+| **Type**| **Description**|
+| -------- | -------- |
+| number | ID of the updated network configuration. The value **-1** indicates that the operation has failed.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
-## wifi.disableNetwork9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid : "****",
+ preSharedKey : "****",
+ securityType : 3
+ }
+ let ret = wifiManager.updateDeviceConfig(config);
+ console.error("ret:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.disableDeviceConfig9+
-disableNetwork(netId: number): void
+disableDeviceConfig(networkId: number): void
Disables network configuration.
@@ -1191,21 +1551,33 @@ Disables network configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | netId | number | Yes| ID of the network configuration to disable.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| netId | number | Yes| ID of the network configuration to disable.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
-## wifi.removeAllNetwork9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let netId = 0;
+ wifiManager.disableDeviceConfig(netId);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.removeAllDeviceConfigs9+
-removeAllNetwork(): void
+removeAllDeviceConfigs(): void
Removes the configuration of all networks.
@@ -1219,13 +1591,24 @@ Removes the configuration of all networks.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
-## wifi.removeDevice9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.removeAllDeviceConfigs();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.removeDeviceConfig9+
-removeDevice(id: number): void
+removeDeviceConfig(networkId: number): void
Removes the specified network configuration.
@@ -1237,18 +1620,114 @@ Removes the specified network configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | id | number | Yes| ID of the network configuration to remove.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the network configuration to remove.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
+| 2501000 | Operation failed.|
+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let id = 0;
+ wifiManager.removeDeviceConfig(id);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.isBandTypeSupported10+
+
+isBandTypeSupported(bandType: WifiBandType): boolean
+
+Checks whether the current frequency band is supported.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| bandType | WifiBandType | Yes| Wi-Fi band type.|
+
+**Error codes**
+
+For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
+
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let type = 0;
+ boolean isBandTypeSupported = wifiManager.isBandTypeSupported(type);
+ console.info("isBandTypeSupported:" + isBandTypeSupported);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## WifiBandType 10+
+
+Enumerates the Wi-Fi band types.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| Name| Value| Description|
+| -------- | -------- | -------- |
+| WIFI_BAND_NONE | 0 | Undefined|
+| WIFI_BAND_2G | 1 | 2 GHz|
+| WIFI_BAND_5G | 2 | 5 GHz|
+| WIFI_BAND_6G | 3 | 6 GHz|
+| WIFI_BAND_60G | 4 | 60 GHz|
+
+
+## wifi.get5GChannelList10+
+
+get5GChannelList(): Array<number>
+
+Obtains the list of 5 GHz channels supported by this device.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Error codes**
+
+For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
+
+| **ID**| **Error Message**|
+| -------- | -------- |
+| 2501000 | Operation failed.|
+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let channelList = wifiManager.get5GChannelList();
+ console.info("channelList:" + JSON.stringify(channelList));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.enableHotspot9+
enableHotspot(): void
@@ -1265,10 +1744,21 @@ Enables this hotspot.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.enableHotspot();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.disableHotspot9+
disableHotspot(): void
@@ -1285,10 +1775,21 @@ Disables this hotspot.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.disableHotspot();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.isHotspotDualBandSupported9+
isHotspotDualBandSupported(): boolean
@@ -1303,18 +1804,30 @@ Checks whether the hotspot supports dual band.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the hotspot supports dual band; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the hotspot supports dual band; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let ret = wifiManager.isHotspotDualBandSupported();
+ console.info("result:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.isHotspotActive9+
isHotspotActive(): boolean
@@ -1329,18 +1842,30 @@ Checks whether this hotspot is active.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the hotspot is active; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the hotspot is active; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let ret = wifiManager.isHotspotActive();
+ console.info("result:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.setHotspotConfig9+
setHotspotConfig(config: HotspotConfig): void
@@ -1355,18 +1880,38 @@ Sets hotspot configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [HotspotConfig](#hotspotconfig9) | Yes| Hotspot configuration to set.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [HotspotConfig](#hotspotconfig9) | Yes| Hotspot configuration to set.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ ssid: "****",
+ securityType: 3,
+ band: 0,
+ channel: 0,
+ preSharedKey: "****",
+ maxConn: 0
+ }
+ let ret = wifiManager.setHotspotConfig();
+ console.info("result:" + ret);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## HotspotConfig9+
Represents the hotspot configuration.
@@ -1377,12 +1922,12 @@ Represents the hotspot configuration.
| **Name**| **Type**| **Readable**| **Writable**| **Description**|
| -------- | -------- | -------- | -------- | -------- |
-| ssid | string | Yes| No| SSID of the hotspot, in UTF-8 format.|
-| securityType | [WifiSecurityType](#wifisecuritytype) | Yes| No| Security type.|
-| band | number | Yes| No| Hotspot band. The value **1** stands for 2.4 GHz, the value **2** for 5 GHz, and the value **3** for dual band.|
-| preSharedKey | string | Yes| No| PSK of the hotspot.|
-| maxConn | number | Yes| No| Maximum number of connections allowed.|
-
+| ssid | string | Yes| Yes| SSID of the hotspot, in UTF-8 format.|
+| securityType | [WifiSecurityType](#wifisecuritytype) | Yes| Yes| Security type.|
+| band | number | Yes| Yes| Hotspot band. The value **1** stands for 2.4 GHz, the value **2** for 5 GHz, and the value **3** for dual band.|
+| channel10+ | number | Yes| Yes| Hotspot channel (2.4 GHz: 1 to 14; 5 GHz: 7 to 196; Dual-band: not supported currently) |
+| preSharedKey | string | Yes| Yes| PSK of the hotspot.|
+| maxConn | number | Yes| Yes| Maximum number of connections allowed.|
## wifi.getHotspotConfig9+
@@ -1398,44 +1943,68 @@ Obtains hotspot configuration.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | [HotspotConfig](#hotspotconfig9) | Hotspot configuration obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| [HotspotConfig](#hotspotconfig9) | Hotspot configuration obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
-## wifi.getStations9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = wifiManager.getHotspotConfig();
+ console.info("result:" + JSON.stringify(config));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.getHotspotStations9+
-getStations(): Array<[StationInfo](#stationinfo9)>
+getHotspotStations(): Array<[StationInfo](#stationinfo9)>
Obtains information about the connected stations.
**System API**: This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications)
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, ohos.permission.APPROXIMATELY_LOCATION, and ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications)
**System capability**: SystemCapability.Communication.WiFi.AP.Core
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[StationInfo](#stationinfo9)> | Connected stations obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[StationInfo](#stationinfo9)> | Connected stations obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let stations = wifiManager.getHotspotStations();
+ console.info("result:" + JSON.stringify(stations));
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## StationInfo9+
Represents the station information.
@@ -1463,18 +2032,36 @@ Obtains P2P link information. This API uses a promise to return the result.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | Promise used to return the P2P link information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | Promise used to return the P2P link information obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ wifi.getP2pLinkedInfo((err, data) => {
+ if (err) {
+ console.error("get p2p linked info error");
+ return;
+ }
+ console.info("get wifi p2p linked info: " + JSON.stringify(data));
+ });
+
+ wifi.getP2pLinkedInfo().then(data => {
+ console.info("get wifi p2p linked info: " + JSON.stringify(data));
+ });
+```
+
+
## WifiP2pLinkedInfo9+
Represents the P2P link information.
@@ -1512,81 +2099,98 @@ Obtains P2P link information. This API uses an asynchronous callback to return t
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.|
-## wifi.getCurrentGroup9+
+## wifi.getCurrentP2pGroup9+
-getCurrentGroup(): Promise<WifiP2pGroupInfo>
+getCurrentP2pGroup(): Promise<WifiP2pGroupInfo>
Obtains the current P2P group information. This API uses a promise to return the result.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo9)> | Promise used to return the P2P group information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo9)> | Promise used to return the P2P group information obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
-## wifi.getCurrentGroup9+
+## wifi.getCurrentP2pGroup9+
-getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void
+getCurrentP2pGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void
Obtains the current P2P group information. This API uses an asynchronous callback to return the result.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ wifi.getCurrentP2pGroup((err, data) => {
+ if (err) {
+ console.error("get current P2P group error");
+ return;
+ }
+ console.info("get current P2P group: " + JSON.stringify(data));
+ });
+
+ wifi.getCurrentP2pGroup().then(data => {
+ console.info("get current P2P group: " + JSON.stringify(data));
+ });
+```
+
## wifi.getP2pPeerDevices9+
getP2pPeerDevices(): Promise<WifiP2pDevice[]>
Obtains the peer device list in the P2P connection. This API uses a promise to return the result.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pDevice[]](#wifip2pdevice9)> | Promise used to return the peer device list.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pDevice[]](#wifip2pdevice9)> | Promise used to return the peer device list.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.getP2pPeerDevices9+
@@ -1595,24 +2199,41 @@ getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void
Obtains the peer device list in the P2P connection. This API uses an asynchronous callback to return the result.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ wifi.getP2pPeerDevices((err, data) => {
+ if (err) {
+ console.error("get P2P peer devices error");
+ return;
+ }
+ console.info("get P2P peer devices: " + JSON.stringify(data));
+ });
+
+ wifi.getP2pPeerDevices().then(data => {
+ console.info("get P2P peer devices: " + JSON.stringify(data));
+ });
+```
+
## WifiP2pDevice9+
Represents the P2P device information.
@@ -1655,16 +2276,16 @@ Obtains the local device information in the P2P connection. This API uses a prom
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pDevice](#wifip2pdevice9)> | Promise used to return the local device information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pDevice](#wifip2pdevice9)> | Promise used to return the local device information obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.getP2pLocalDevice9+
@@ -1679,14 +2300,34 @@ Obtains the local device information in the P2P connection. This API uses an asy
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the local device information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice9)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the local device information obtained. If **err** is not **0**, an error has occurred.|
+
+| **ID**| **Error Message**|
+| -------- | -------- |
+| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ wifiManager.getP2pLocalDevice((err, data) => {
+ if (err) {
+ console.error("get P2P local device error");
+ return;
+ }
+ console.info("get P2P local device: " + JSON.stringify(data));
+ });
+
+ wifi.getP2pLocalDevice().then(data => {
+ console.info("get P2P local device: " + JSON.stringify(data));
+ });
+```
-## wifi.createGroup9+
+## wifi.createP2pGroup9+
-createGroup(config: WifiP2PConfig): void
+createP2pGroup(config: WifiP2PConfig): void
Creates a P2P group.
@@ -1696,18 +2337,37 @@ Creates a P2P group.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiP2PConfig](#wifip2pconfig9) | Yes| Group configuration.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiP2PConfig](#wifip2pconfig9) | Yes| Group configuration.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let config = {
+ deviceAddress: "****",
+ netId: 0,
+ passphrase: "*****",
+ groupName: "****",
+ goBand: 0
+ }
+ wifiManager.createP2pGroup(config);
+
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## WifiP2PConfig9+
Represents P2P group configuration.
@@ -1736,9 +2396,9 @@ Enumerates the P2P group frequency bands.
| GO_BAND_5GHZ | 2 | 5 GHz.|
-## wifi.removeGroup9+
+## wifi.removeP2pGroup9+
-removeGroup(): void
+removeP2pGroup(): void
Removes this P2P group.
@@ -1750,33 +2410,43 @@ Removes this P2P group.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.removeP2pGroup();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.p2pConnect9+
p2pConnect(config: WifiP2PConfig): void
Sets up a P2P connection.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
-
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiP2PConfig](#wifip2pconfig9) | Yes| P2P group configuration.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiP2PConfig](#wifip2pconfig9) | Yes| P2P group configuration.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
**Example**
@@ -1843,7 +2513,7 @@ For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorco
setTimeout(function() {wifi.off("p2pDeviceChange", recvP2pDeviceChangeFunc);}, 125 * 1000);
setTimeout(function() {wifi.off("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);}, 125 * 1000);
setTimeout(function() {wifi.off("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);}, 125 * 1000);
- console.info("start discover devices -> " + wifi.startDiscoverDevices());
+ console.info("start discover devices -> " + wifi.startP2pDiscoverDevices());
```
## wifi.p2pCancelConnect9+
@@ -1860,17 +2530,28 @@ Cancels this P2P connection.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
-## wifi.startDiscoverDevices9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.p2pCancelConnect();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.startDiscoverP2pDevices9+
-startDiscoverDevices(): void
+startDiscoverP2pDevices(): void
Starts to discover devices.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
@@ -1878,13 +2559,24 @@ Starts to discover devices.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
-## wifi.stopDiscoverDevices9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.startDiscoverP2pDevices();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.stopDiscoverP2pDevices9+
-stopDiscoverDevices(): void
+stopDiscoverP2pDevices(): void
Stops discovering devices.
@@ -1896,13 +2588,24 @@ Stops discovering devices.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
-## wifi.deletePersistentGroup9+
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ wifiManager.stopDiscoverP2pDevices();
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
+## wifi.deletePersistentP2pGroup9+
-deletePersistentGroup(netId: number): void
+deletePersistentP2pGroup(netId: number): void
Deletes a persistent group.
@@ -1915,18 +2618,30 @@ Deletes a persistent group.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | netId | number | Yes| ID of the group to delete.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| netId | number | Yes| ID of the group to delete.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let netId = 0;
+ wifiManager.deletePersistentP2pGroup(netId);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.getP2pGroups9+
getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>
@@ -1935,24 +2650,42 @@ Obtains information about all P2P groups. This API uses a promise to return the
**System API**: This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo9)> > | Promise used to return the group information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo9)> > | Promise used to return the group information obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ wifiManager.getP2pGroups((err, data) => {
+ if (err) {
+ console.error("get P2P groups error");
+ return;
+ }
+ console.info("get P2P groups: " + JSON.stringify(data));
+ });
+
+ wifi.getP2pGroups().then(data => {
+ console.info("get P2P groups: " + JSON.stringify(data));
+ });
+
+```
+
## WifiP2pGroupInfo9+
Represents the P2P group information.
@@ -1980,27 +2713,27 @@ Obtains information about all P2P groups. This API uses an asynchronous callback
**System API**: This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo9)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo9)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
-## wifi.setDeviceName9+
+## wifi.setP2pDeviceName9+
-setDeviceName(devName: string): void
+setP2pDeviceName(devName: string): void
Sets the device name.
@@ -2012,18 +2745,30 @@ Sets the device name.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | devName | string | Yes| Device name to set.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| devName | string | Yes| Device name to set.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+```
+ import wifi from '@ohos.wifiManager';
+
+ try {
+ let name = "****";
+ wifiManager.setP2pDeviceName(netId);
+ }catch(error){
+ console.error("failed:" + JSON.stringify(error));
+ }
+```
+
## wifi.on('wifiStateChange')9+
on(type: "wifiStateChange", callback: Callback<number>): void
@@ -2036,17 +2781,17 @@ Registers the WLAN state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the WLAN state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the WLAN state.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
**WLAN states**
@@ -2071,17 +2816,17 @@ Unregisters the WLAN state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiStateChange**.|
- | callback | Callback<number> | No| Callback for the WLAN state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiStateChange**.|
+| callback | Callback<number> | No| Callback for the WLAN state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
**Example**
@@ -2112,10 +2857,10 @@ Registers the WLAN connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiConnectionChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the WLAN connection state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the WLAN connection state.|
**WLAN connection states**
@@ -2128,8 +2873,8 @@ Registers the WLAN connection state change events.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
## wifi.off('wifiConnectionChange')9+
@@ -2144,19 +2889,34 @@ Unregisters the WLAN connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiConnectionChange**.|
- | callback | Callback<number> | No| Callback for the WLAN connection state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
+| callback | Callback<number> | No| Callback for the WLAN connection state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifi';
+
+ var recvWifiConnectionChangeFunc = result => {
+ console.info("Receive wifi connection change event: " + result);
+ }
+
+ // Register an event.
+ wifi.on("wifiConnectionChange", recvWifiConnectionChangeFunc);
+
+ // Unregister an event.
+ wifi.off("wifiConnectionChange", recvWifiConnectionChangeFunc);
+ ```
+
## wifi.on('wifiScanStateChange')9+
on(type: "wifiScanStateChange", callback: Callback<number>): void
@@ -2169,10 +2929,10 @@ Registers the WLAN scan state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiScanStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the WLAN scan state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiScanStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the WLAN scan state.|
**WLAN scan states**
@@ -2185,8 +2945,8 @@ Registers the WLAN scan state change events.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
## wifi.off('wifiScanStateChange')9+
@@ -2210,10 +2970,25 @@ Unregisters the WLAN scan state change events.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifi';
+
+ var recvWifiScanStateChangeFunc = result => {
+ console.info("Receive Wifi scan state change event: " + result);
+ }
+
+ // Register an event.
+ wifi.on("wifiScanStateChange", recvWifiScanStateChangeFunc);
+
+ // Unregister an event.
+ wifi.off("wifiScanStateChange", recvWifiScanStateChangeFunc);
+ ```
+
## wifi.on('wifiRssiChange')9+
on(type: "wifiRssiChange", callback: Callback<number>): void
@@ -2226,17 +3001,17 @@ Registers the RSSI change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiRssiChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the RSSI, in dBm.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiRssiChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the RSSI, in dBm.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
## wifi.off('wifiRssiChange')9+
@@ -2251,19 +3026,34 @@ Unregisters the RSSI change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiRssiChange**.|
- | callback | Callback<number> | No| Callback for the RSSI change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiRssiChange**.|
+| callback | Callback<number> | No| Callback for the RSSI change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2501000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvWifiRssiChangeFunc = result => {
+ console.info("Receive wifi rssi change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("wifiRssiChange", recvWifiRssiChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("wifiRssiChange", recvWifiRssiChangeFunc);
+ ```
+
## wifi.on('hotspotStateChange')9+
on(type: "hotspotStateChange", callback: Callback<number>): void
@@ -2276,10 +3066,10 @@ Registers the hotspot state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **hotspotStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the hotspot state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **hotspotStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the hotspot state.|
**Hotspot states**
@@ -2294,8 +3084,8 @@ Registers the hotspot state change events.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
## wifi.off('hotspotStateChange')9+
@@ -2310,19 +3100,34 @@ Unregisters the hotspot state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **hotspotStateChange**.|
- | callback | Callback<number> | No| Callback for the hotspot state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **hotspotStateChange**.|
+| callback | Callback<number> | No| Callback for the hotspot state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2601000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvHotspotStateChangeFunc = result => {
+ console.info("Receive hotspot state change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("hotspotStateChange", recvHotspotStateChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("hotspotStateChange", recvHotspotStateChangeFunc);
+ ```
+
## wifi.on('p2pStateChange')9+
on(type: "p2pStateChange", callback: Callback<number>): void
@@ -2335,10 +3140,10 @@ Registers the P2P state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the P2P state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the P2P state.|
**P2P states**
@@ -2354,8 +3159,8 @@ Registers the P2P state change events.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.off('p2pStateChange')9+
@@ -2370,19 +3175,34 @@ Unregisters the P2P state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pStateChange**.|
- | callback | Callback<number> | No| Callback for the P2P state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pStateChange**.|
+| callback | Callback<number> | No| Callback for the P2P state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvP2pStateChangeFunc = result => {
+ console.info("Receive p2p state change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("p2pStateChange", recvP2pStateChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("p2pStateChange", recvP2pStateChangeFunc);
+ ```
+
## wifi.on('p2pConnectionChange')9+
on(type: "p2pConnectionChange", callback: Callback<WifiP2pLinkedInfo>): void
@@ -2395,17 +3215,17 @@ Registers the P2P connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pConnectionChange**.|
- | callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | Yes| Callback invoked to return the P2P connection state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
+| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | Yes| Callback invoked to return the P2P connection state.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.off('p2pConnectionChange')9+
@@ -2420,42 +3240,57 @@ Unregisters the P2P connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pConnectionChange**.|
- | callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | No| Callback for the P2P connection state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
+| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo9)> | No| Callback for the P2P connection state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvP2pConnectionChangeFunc = result => {
+ console.info("Receive p2p connection change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("p2pConnectionChange", recvP2pConnectionChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("p2pConnectionChange", recvP2pConnectionChangeFunc);
+ ```
+
## wifi.on('p2pDeviceChange')9+
on(type: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): void
Registers the P2P device state change events.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDeviceChange**.|
- | callback | Callback<[WifiP2pDevice](#wifip2pdevice9)> | Yes| Callback invoked to return the P2P device state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
+| callback | Callback<[WifiP2pDevice](#wifip2pdevice9)> | Yes| Callback invoked to return the P2P device state.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.off('p2pDeviceChange')9+
@@ -2464,48 +3299,63 @@ off(type: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): void
Unregisters the P2P device state change events.
-**Required permissions**: ohos.permission.LOCATION
+**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDeviceChange**.|
- | callback | Callback<[WifiP2pDevice](#wifip2pdevice9)> | No| Callback for the P2P device state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
+| callback | Callback<[WifiP2pDevice](#wifip2pdevice9)> | No| Callback for the P2P device state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvP2pDeviceChangeFunc = result => {
+ console.info("Receive recv p2p device change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("p2pDeviceChange", recvP2pDeviceChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("p2pDeviceChange", recvP2pDeviceChangeFunc);
+ ```
+
## wifi.on('p2pPeerDeviceChange')9+
on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void
Registers the P2P peer device state change events.
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
- | callback | Callback<[WifiP2pDevice[]](#wifip2pdevice9)> | Yes| Callback invoked to return the P2P peer device state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
+| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice9)> | Yes| Callback invoked to return the P2P peer device state.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.off('p2pPeerDeviceChange')9+
@@ -2514,25 +3364,40 @@ off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): vo
Unregisters the P2P peer device state change events.
-**Required permissions**: ohos.permission.LOCATION
+**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
**System capability**: SystemCapability.Communication.WiFi.P2P
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
- | callback | Callback<[WifiP2pDevice[]](#wifip2pdevice9)> | No| Callback for the P2P peer device state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
+| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice9)> | No| Callback for the P2P peer device state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvP2pPeerDeviceChangeFunc = result => {
+ console.info("Receive recv p2p peer device change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
+ ```
+
## wifi.on('p2pPersistentGroupChange')9+
on(type: "p2pPersistentGroupChange", callback: Callback<void>): void
@@ -2545,17 +3410,17 @@ Registers the P2P persistent group state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
- | callback | Callback<void> | Yes| Callback invoked to return the P2P persistent group state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
+| callback | Callback<void> | Yes| Callback invoked to return the P2P persistent group state.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.off('p2pPersistentGroupChange')9+
@@ -2570,19 +3435,34 @@ Unregisters the P2P persistent group state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
- | callback | Callback<void> | No| Callback for the P2P persistent group state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
+| callback | Callback<void> | No| Callback for the P2P persistent group state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvP2pPersistentGroupChangeFunc = result => {
+ console.info("Receive recv p2p persistent group change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("p2pPersistentGroupChange", recvP2pPersistentGroupChangeFunc);
+ ```
+
## wifi.on('p2pDiscoveryChange')9+
on(type: "p2pDiscoveryChange", callback: Callback<number>): void
@@ -2595,10 +3475,10 @@ Registers the P2P device discovery state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the P2P device discovery state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the P2P device discovery state.|
**P2P discovered device states**
@@ -2611,8 +3491,8 @@ Registers the P2P device discovery state change events.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
## wifi.off('p2pDiscoveryChange')9+
@@ -2627,15 +3507,30 @@ Unregisters the P2P device discovery state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
- | callback | Callback<number> | No| Callback for the P2P device discovery state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
+| callback | Callback<number> | No| Callback for the P2P device discovery state change. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
-| **Type**| **Description**|
- | -------- | -------- |
+| **ID**| **Error Message**|
+| -------- | -------- |
| 2801000 | Operation failed.|
+
+**Example**
+ ```js
+ import wifi from '@ohos.wifiManager';
+
+ var recvP2pDiscoveryChangeFunc = result => {
+ console.info("Receive recv p2p discovery change event: " + result);
+ }
+
+ // Register an event.
+ wifiManager.on("p2pDiscoveryChange", recvP2pDiscoveryChangeFunc);
+
+ // Unregister an event.
+ wifiManager.off("p2pDiscoveryChange", recvP2pDiscoveryChangeFunc);
+ ```
diff --git a/en/application-dev/reference/errorcodes/errorcode-data-rdb.md b/en/application-dev/reference/errorcodes/errorcode-data-rdb.md
index d0e4a40e4ce19f10f5470b6a4b83caaa72707611..823fb7b65b6cc277f64ba7b43b7314baa25d5971 100644
--- a/en/application-dev/reference/errorcodes/errorcode-data-rdb.md
+++ b/en/application-dev/reference/errorcodes/errorcode-data-rdb.md
@@ -4,11 +4,29 @@
>
> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](errorcode-universal.md).
+## 14800000 Internal Error
+
+**Error Message**
+
+Inner error.
+
+**Description**
+
+An error occurs at the underlying database.
+
+**Possible Causes**
+
+Invalid SQL statement is passed in.
+
+**Solution**
+
+Determine the cause of the error based on the log information.
+
## 14800010 Invalid RDB Name
**Error Message**
-Invalid database name.
+Failed to open or delete database by invalid database path.
**Description**
@@ -16,17 +34,17 @@ The RDB store name is invalid.
**Possible Causes**
-The RDB store name is empty or exceeds 1024 bytes.
+The RDB store path is invalid.
**Solution**
-Check that the RDB store name is not empty and does not exceed 1024 bytes.
+Check the RDB store path.
## 14800011 Database File Corrupted
**Error Message**
-Database corrupted.
+Failed to open database by database corrupted.
**Description**
diff --git a/en/application-dev/reference/errorcodes/errorcode-datashare.md b/en/application-dev/reference/errorcodes/errorcode-datashare.md
index d97e4218f2132e0e9fc211450df1e7faebff0fef..566ff62cb6d3d07038e930a472e19ffea8b2b3ef 100644
--- a/en/application-dev/reference/errorcodes/errorcode-datashare.md
+++ b/en/application-dev/reference/errorcodes/errorcode-datashare.md
@@ -8,7 +8,7 @@
**Error Message**
-The dataShareHelper is not initialized successfully.
+The DataShareHelper is not initialized successfully.
**Description**
@@ -23,3 +23,40 @@ The **DataShareHelper** class fails to be created.
1. Obtain the correct URI.
2. Check that the context of the stage model is used.
+
+## 15700011 Failed to Add or Delete a Template
+
+**Error Message**
+
+The uri is not exist.
+
+**Description**
+
+This error code is returned when a template fails to be added or deleted.
+
+**Possible Causes**
+
+1. The input parameter **uri** of **addTemplate()** is incorrect.
+2. The input parameter **uri** of **delTemplate()** is incorrect.
+
+**Solution**
+
+Obtain the correct URI.
+
+## 15700012 Data Area Not Exist
+
+**Error Message**
+
+The data area is not exist.
+
+**Description**
+
+This error code is returned when a data update fails.
+
+**Possible Causes**
+
+The input parameter **bundleName** of **publish()** is incorrect.
+
+**Solution**
+
+Obtain the correct **bundleName** value from the DataShare server provider.
diff --git a/en/application-dev/reference/errorcodes/errorcode-nfc.md b/en/application-dev/reference/errorcodes/errorcode-nfc.md
index 07e1648fe3256d63c9a74a0a580041ebd4b869d9..a8af05666cd02995cda09fd28d9823944fd1699c 100644
--- a/en/application-dev/reference/errorcodes/errorcode-nfc.md
+++ b/en/application-dev/reference/errorcodes/errorcode-nfc.md
@@ -47,3 +47,21 @@ An error occurs when the NFC service executes the tag service logic.
3. Connect to the tag and then perform the read and write operations.
4. Touch and read the card again.
5. Exit the app and read the card again.
+
+## 3200101
+
+**Error Message**
+
+Connected NFC tag running state is abnormal in service.
+
+**Description**
+
+An error occurs when the service logic of the active NFC tag is executed.
+
+**Possible Causes**
+1. The parameter values of the active NFC tag does not match the API called.
+2. The active NFC tag chip does not respond within the specified time or returns an error state.
+
+**Solution**
+1. Check that the active NFC tag parameters match the API called.
+2. Touch and read the card again.
diff --git a/en/application-dev/reference/errorcodes/errorcode-preferences.md b/en/application-dev/reference/errorcodes/errorcode-preferences.md
index 67cd7ab9760d36627b0c29e0b4d3715bb3e9824a..d736c4fecfc1a2c6cc14f55c04dd927db761bde5 100644
--- a/en/application-dev/reference/errorcodes/errorcode-preferences.md
+++ b/en/application-dev/reference/errorcodes/errorcode-preferences.md
@@ -7,7 +7,7 @@
## 15500010 Failed to Delete the User Preference Persistence File
**Error Message**
-Failed to delete preferences.
+Failed to delete preferences file.
**Description**
diff --git a/en/application-dev/ui/arkts-common-components-button.md b/en/application-dev/ui/arkts-common-components-button.md
index 82c893d33aa0049e5b2e815ae6a31b7d13a1775a..8abc45a87a9cc0ed6d0b40eaf907c2afb5692299 100644
--- a/en/application-dev/ui/arkts-common-components-button.md
+++ b/en/application-dev/ui/arkts-common-components-button.md
@@ -258,4 +258,4 @@ Button('Ok', { type: ButtonType.Normal, stateEffect: true })
}
```
- 
+ 
diff --git a/en/application-dev/ui/arkts-navigation-tabs.md b/en/application-dev/ui/arkts-navigation-tabs.md
index f16a5e5df1868c9500ea571deb09e74396f8f77c..28b4c68b55c447c7de9870772ff652c82d837e98 100644
--- a/en/application-dev/ui/arkts-navigation-tabs.md
+++ b/en/application-dev/ui/arkts-navigation-tabs.md
@@ -333,7 +333,7 @@ For non-custom navigation bars, tabs and tab content are linked by default. For
**Figure 11** Lack of linkage between tabs and tab content
-
+
To manually switch between the tabs, use the **onChange** API provided by the **\** component to listen for the index change and pass the index of the active tab to **currentIndex**.
diff --git a/en/application-dev/ui/arkui-overview.md b/en/application-dev/ui/arkui-overview.md
index 4ce38f8259fa449e522a94f7b578e76ceb4fb30f..839bfd17f7ded5c6ead59ca53bfe3a89ba6ddffa 100644
--- a/en/application-dev/ui/arkui-overview.md
+++ b/en/application-dev/ui/arkui-overview.md
@@ -22,7 +22,7 @@ ArkUI is a UI development framework for building OpenHarmony applications. It pr
- **Platform API channel**: ArkUI provides an API extension mechanism through which platform capabilities are encapsulated to produce JavaScript (JS) APIs in a unified style.
-- **Two development paradigms**: ArkUI comes with two development paradigms: [ArkTS-based declarative development paradigm](./ui-ts-overview.md) (declarative development paradigm for short) and [JS-compatible web-like development paradigm](./ui-js-overview.md) (web-like development paradigm for short). You can choose whichever development paradigm that aligns with your practice.
+- **Two development paradigms**: ArkUI comes with two development paradigms: [ArkTS-based declarative development paradigm](arkts-ui-development-overview.md) (declarative development paradigm for short) and [JS-compatible web-like development paradigm](../ui/ui-js-overview.md) (web-like development paradigm for short). You can choose whichever development paradigm that aligns with your practice.
| Development Paradigm | Description | Applicable To | Target Audience |
| -------- | ---------------------------------------- | ---------------- | ------------------- |
diff --git a/en/application-dev/ui/figures/GIF.gif b/en/application-dev/ui/figures/floating_button.gif
similarity index 100%
rename from en/application-dev/ui/figures/GIF.gif
rename to en/application-dev/ui/figures/floating_button.gif
diff --git a/en/application-dev/ui/figures/lack-of-linkage.gif b/en/application-dev/ui/figures/lack-of-linkage.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c0dde5b1ef76e44606de04a979c5e62cf4464438
Binary files /dev/null and b/en/application-dev/ui/figures/lack-of-linkage.gif differ
diff --git a/en/application-dev/website.md b/en/application-dev/website.md
index d5c8e0b5f522b298c4321ad0ead08b96f12b1f04..d976d7948f61e4478fea44fd9c5a1770fef2331e 100644
--- a/en/application-dev/website.md
+++ b/en/application-dev/website.md
@@ -1123,9 +1123,12 @@
- [NotificationTemplate](reference/apis/js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](reference/apis/js-apis-inner-notification-notificationUserInput.md)
- Common Events
+ - [Common Events of the Ability Subsystem](reference/apis/common_event/commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](reference/apis/common_event/commonEvent-bundleManager.md)
- - [Common Events of the Notification Service](reference/apis/common_event/commonEvent-ans.md)
+ - [ͨCommon Events of the Notification Service](reference/apis/common_event/commonEvent-ans.md)
+ - [Common Events of the Resource Scheduling Subsystem](reference/apis/common_event/commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](reference/apis/common_event/commonEvent-telephony.md)
+ - [Common Events of the USB Subsystem](reference/apis/common_event/commonEvent-usb.md)
- Bundle Management
- [@ohos.bundle.appControl(appControl)](reference/apis/js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](reference/apis/js-apis-bundleManager.md)
diff --git a/en/contribute/OpenHarmony-hdf-coding-guide.md b/en/contribute/OpenHarmony-hdf-coding-guide.md
index 2349d0148c5b4c2bd3128afbe5e4b5f026ae5222..276910b4a2a02a608e3b8a5e39deef2f0c8d9009 100644
--- a/en/contribute/OpenHarmony-hdf-coding-guide.md
+++ b/en/contribute/OpenHarmony-hdf-coding-guide.md
@@ -190,7 +190,7 @@ root {
[Description] The HDF places the same type of devices in the same host. You can develop and deploy the driver functionalities of the host by layer, so that one driver has multiple nodes. The following figure shows the HDF driver model.
-
+
Place devices of the same type in the same host. When adding a device, check whether the host of the same type already exists. If such a host already exists, configure the device in the host. Do not configure the same host again. A device belongs to only one driver. Therefore, do not configure the same device in different hosts.
diff --git a/en/contribute/figures/hdf-driver-model.png b/en/contribute/figures/hdf-driver-model.png
new file mode 100644
index 0000000000000000000000000000000000000000..e524ecca84ab2afd674c73abd76ae2ebcc50cb9a
Binary files /dev/null and b/en/contribute/figures/hdf-driver-model.png differ
diff --git a/en/readme/common-event-notification.md b/en/readme/common-event-notification.md
index 745ea06735002601ca57b2fe7ab620ae0162a2af..6242a81042f831a35a4faee004a2fb3bb990f269 100644
--- a/en/readme/common-event-notification.md
+++ b/en/readme/common-event-notification.md
@@ -14,7 +14,7 @@ Each application can subscribe to common events as required. After your applicat
### Architecture
-
+
## Directory Structure
diff --git a/en/release-notes/OpenHarmony-v3.1-beta.md b/en/release-notes/OpenHarmony-v3.1-beta.md
index f166a0b1693e3ee8b9e4c0ea1e62c03ec4138067..08a5dbfcdfe4008dbff693fbc69e6ca4e2579ec6 100644
--- a/en/release-notes/OpenHarmony-v3.1-beta.md
+++ b/en/release-notes/OpenHarmony-v3.1-beta.md
@@ -181,12 +181,9 @@ For details about the adaptation status, see [SIG_DevBoard](https://gitee.com/op
| [Synced Sketchpad (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/DistributeDatabaseDrawEts)| This codelab shows how to implement synchronous writing and interaction between multiple devices based on the distributed feature.| ArkTS |
| [Distributed Database](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)| This codelab shows how to use the Distributed Data Service APIs to facilitate consistent data access between devices.| JS |
| [Relational Database](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData)| This codelab shows how to quickly develop database-related application services based on the relational database and data management capability.| JS |
-| [Simplified Declarative UI Paradigm (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts) | This codelab shows how to implement a gallery app based on OpenHarmony ArkUI components. | ArkTS |
-| [One-Time Development for Multi-device Deployment (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/Multi_device) | This codelab shows how to implement one-time layout development for multi-device deployment based on OpenHarmony ArkTS UI components. | ArkTS |
| [Shopping (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/ShoppingEts) | This codelab shows how to implement a shopping app based on OpenHarmony ArkTS UI components. | ArkTS |
| [Transition Animation (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/TransitionAnimation) | This codelab shows how to implement page transition, component transition, and transition of shared elements based on OpenHarmony ArkUI components. | ArkTS |
| [slider Usage (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SliderExample) | This codelab shows how to use the OpenHarmony ArkUI component **\** to implement the animation effect when users adjust the size and speed of the windmill. | ArkTS |
-| [Liquid Layout (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/FlowLayoutEts) | This codelab shows how to implement the liquid layout based on the OpenHarmony ArkTS UI components. | ArkTS |
| [Dialog Box (ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/CustomDialogEts) | This codelab shows how to implement an alert dialog box and custom dialog box based on OpenHarmony ArkTS UI components. | ArkTS |
diff --git a/en/release-notes/OpenHarmony-v3.1-release.md b/en/release-notes/OpenHarmony-v3.1-release.md
index bba0edfaf38f2a6a90e35e5d4a0dc96cd0fe5785..d69445c2144c0c3f2cb9aa0473ebca9f0fe94ac1 100644
--- a/en/release-notes/OpenHarmony-v3.1-release.md
+++ b/en/release-notes/OpenHarmony-v3.1-release.md
@@ -237,7 +237,6 @@ For more information, visit [Samples](https://gitee.com/openharmony/app_samples)
| [Audio Recording](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS)| This codelab shows how to use **AudioRecorder** to record an audio file and use **AudioPlayer** to play the recorded audio.| ArkTS |
| [Notepad](https://gitee.com/openharmony/codelabs/tree/master/Data/NotePad_OH_ETS)| This codelab shows how to develop a notepad in ArkTS. You can create, delete, and favorite notes, and use the lightweight database to store data persistently. | ArkTS |
| [Distributed Mail Editing](https://gitee.com/openharmony/codelabs/tree/master/Distributed/OHMailETS)| This codelab shows how to develop the distributed email editing function. By leveraging the distributed capabilities, a remote device in the same LAN and with the same login account can be started, and email editing can be continued on the remote device.| ArkTS |
-| [Third-party Library](https://gitee.com/openharmony/codelabs/tree/master/ThirdPartyComponents/VCardDemo)| This codelab shows how to use vcard, a third-party library used in OpenHarmony to write and read contact data in a specified format (file with the extension name **vcard**).| ArkTS |
## Resolved Issues
diff --git a/en/release-notes/OpenHarmony-v3.2-beta5.md b/en/release-notes/OpenHarmony-v3.2-beta5.md
index 3dd8c303fa230e852ccb018b17dd0edf0fc63056..32478099a0a2a3f46457fd6d191d5460ce24b6f7 100644
--- a/en/release-notes/OpenHarmony-v3.2-beta5.md
+++ b/en/release-notes/OpenHarmony-v3.2-beta5.md
@@ -139,7 +139,7 @@ This version has the following updates to OpenHarmony 3.2 Beta4.
From this version on, only the public SDK is released. You can obtain the public SDK from the mirror or download it from DevEco Studio for your application development.
-To use the full SDK that contains system APIs, you must download the full code, compile and build an SDK file, and switch to the full SDK on DevEco Studio. For details about how to compile the full SDK using the source code, see [Full SDK Compilation Guide](../application-dev/quick-start/full-sdk-compile-guide.md).
+To use the full SDK that contains system APIs, you must download the full code, compile and build an SDK file, and switch to the full SDK on DevEco Studio. For details about how to compile the full SDK using the source code, see [Full SDK Compilation Guide](../application-dev/faqs/full-sdk-compile-guide.md).
### Feature Updates
@@ -164,7 +164,7 @@ To use the full SDK that contains system APIs, you must download the full code,
For details about the API changes, see [API Differences](api-diff/v3.2-beta5/Readme-EN.md).
-For details about the API changes of each subsystem, see [Changelogs](changelogs/v3.2-beta5/Readme-EN.md).
+For details about the API changes of each subsystem, see [Changelogs](changelogs/v3.2-beta5/Readme-EN.md).
### Chip and Development Board Adaptation
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-LocalStorage.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-LocalStorage.md
deleted file mode 100644
index f835a558215db6472b339f64797b2e8c88e07a14..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-LocalStorage.md
+++ /dev/null
@@ -1,118 +0,0 @@
-# ArkUI Subsystem LocalStorage Class ChangeLog
-
-## cl.LocalStorage.1 Return Type Change of the get API
-
-Changed the return type from **get\(propName: string): T** to **get\(propName: string): T | undefined**.
-
-**Change Impact**
-
-
-None
-
-## cl.LocalStorage.2 Mandatory/Optional Change of the newValue Parameter in setOrCreate
-**Change Impact**
-
-API declaration before change:
-```js
-setOrCreate(propName: string, newValue?: T): boolean
-```
-API declaration after change:
-```js
-setOrCreate(propName: string, newValue: T): boolean
-```
-The **newValue** parameter becomes mandatory.
-If it is not specified when an application calls the API, the build will fail after the SDK is replaced.
-
-**Adaptation Guide**
-
-```js
-let storage = new LocalStorage();
-storage.setOrCreate('propA', 'hello');
-```
-## cl.LocalStorage.3 link Parameter and Return Type Changes
-**Change Impact**
-
-API declaration before change:
-```js
-link(propName: string, linkUser?: T, subscribersName?: string): T
-```
-API declaration after change:
-```js
-link(propName: string): SubscribedAbstractProperty
-```
-1. The second and third parameters of the **link** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
-2. The return type **T** is changed to **SubscribedAbstractProperty**.
-
-**Adaptation Guide**
-
-```js
-let storage = new LocalStorage({"PropA": "47"});
-let linA = storage.link("PropA");
-linA.set(50);
-```
-
-## cl.LocalStorage.4 setAndLink Parameter and Return Type Changes
-**Change Impact**
-
-API declaration before change:
-```js
-setAndLink(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T
-```
-API declaration after change:
-```js
-setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty
-```
-1. The third and fourth parameters of the **setAndLink** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
-2. The return type **T** is changed to **SubscribedAbstractProperty**.
-
-**Adaptation Guide**
-
-```js
-let storage = new LocalStorage({"PropA": "47"});
-let linA = storage.setAndLink("PropA", "48")
-linA.set(50);
-```
-
-## cl.LocalStorage.5 prop Parameter and Return Type Changes
-**Change Impact**
-
-API declaration before change:
-```js
-prop(propName: string, propUser?: T, subscribersName?: string): T
-```
-API declaration after change:
-```js
-prop(propName: string): SubscribedAbstractProperty
-```
-1. The second and third parameters of the **prop** API are reserved for internal use by the framework. Therefore, the API is changed to contain only one parameter.
-2. The return type **T** is changed to **SubscribedAbstractProperty**.
-
-**Adaptation Guide**
-
-```js
-let storage = new LocalStorage({"PropA": "47"});
-let propA = storage.prop("PropA");
-propA.set(51); // one-way sync
-```
-
-## cl.LocalStorage.6 setAndProp Parameter and Return Type Changes
-**Change Impact**
-
-API declaration before change:
-```js
-setAndProp(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T
-```
-API declaration after change:
-```js
-setAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty
-```
-1. The third and fourth parameters of the **setAndProp** API are reserved for internal use by the framework. Therefore, the API is changed to contain two parameters.
-2. The return type **T** is changed to **SubscribedAbstractProperty**.
-
-**Adaptation Guide**
-
-```js
-let storage = new LocalStorage({"PropA": "47"});
-let propA = storage.setAndProp("PropA", "48");
-propA.set(51); // one-way sync
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-container.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-container.md
deleted file mode 100644
index c32d54a296c01a18d623c9de9bd9b71ef6cf8bc0..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-container.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# ChangeLog of JS API Changes in the commonlibrary Subsystem
-
-Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the commonlibrary subsystem.
-
-## cl.commonlibrary.1 Error Code and Information Change
-Changed error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes in the commonlibrary subsystem.
-
-For details about the changed error codes, see [error codes of language basic class libraries](../../../application-dev/reference/errorcodes/errorcode-utils.md).
-
-No adaptation is required for applications developed using these APIs.
-
-**Key API/Component Changes**
-
-Error code information is redefined for APIs in these classes and marked using **'@throws'** in the `*.d.ts` file of the corresponding module.
-
-The sample code is as follows:
-
-**ArrayList** class before the change:
-
-constructor();
-
-**ArrayList** class after the change:
-
-@throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
-constructor();
-
-**Change Impacts**
-
-None
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-distributeddatamgr.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-distributeddatamgr.md
deleted file mode 100644
index 3689b5c62fa100173b4b5579a38f5763b6535d23..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-distributeddatamgr.md
+++ /dev/null
@@ -1,178 +0,0 @@
-# ChangeLog of JS API Changes of the Distributed Data Management Subsystem
-
-Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the distributed data management subsystem:
-
-## cl.distributeddatamgr.1 API Change
-APIs in the **kv_store** component of the distributed data management subsystem are changed:
-
-**createKVManager** is changed from asynchronous to synchronous, because the execution duration is fixed and short and there is no need to asynchronously wait for the execution result. Therefore, the original APIs **function createKVManager(config: KVManagerConfig): Promise\;** and **function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void;** are changed to **function createKVManager(config: KVManagerConfig): KVManager;**.
-
-You need to adapt your applications based on the following information:
-
-**Change Impacts**
-
-JS APIs in API version 9 are affected. The application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
-| ------------------------ | ------------------ | ------------------------------------------------------------ | -------- |
-| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\; | Deleted |
-| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | Changed |
-
-
-**Adaptation Guide**
-
-The following illustrates how to call **createKVManager** to create a **KVManager** object.
-
-Stage model:
-
-```ts
-import AbilityStage from '@ohos.application.Ability'
-let kvManager;
-export default class MyAbilityStage extends AbilityStage {
- onCreate() {
- console.log("MyAbilityStage onCreate")
- let context = this.context
- const kvManagerConfig = {
- context: context,
- bundleName: 'com.example.datamanagertest',
- }
- try {
- kvManager = distributedKVStore.createKVManager(kvManagerConfig);
- } catch (e) {
- console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
- }
- }
-}
-```
-
-FA model:
-
-```ts
-import featureAbility from '@ohos.ability.featureAbility'
-let kvManager;
-let context = featureAbility.getContext()
-const kvManagerConfig = {
- context: context,
- bundleName: 'com.example.datamanagertest',
-}
-try {
- kvManager = distributedKVStore.createKVManager(kvManagerConfig);
-} catch (e) {
- console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
-}
-```
-
-## cl.distributeddatamgr.2 Migration of function getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts.
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-APIs:
-
-```ts
-function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback): void;
-function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise;
-```
-The APIs are migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
-```
-function getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback): void;
-function getRdbStore(context: Context, config: StoreConfig): Promise;
-```
-
-**Adaptation Guide**
-
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The names of relevant methods should be changed according to the preceding changes.
-
-## cl.distributeddatamgr.3 Migration of function deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-APIs:
-
-```ts
-function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void;
-function deleteRdbStoreV9(context: Context, name: string): Promise;
-```
-The APIs are migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
-```
-function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void;
-function deleteRdbStoreV9(context: Context, name: string): Promise;
-```
-
-**Adaptation Guide**
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The names of relevant methods should be changed according to the preceding changes.
-
-## cl.distributeddatamgr.4 Migration of interface StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-**interface StoreConfigV9** is migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface StoreConfig**.
-
-**Adaptation Guide**
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The names of relevant APIs should be changed according to the preceding changes.
-
-## cl.distributeddatamgr.5 Migration of enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-**enum SecurityLevel** is migrated from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**.
-
-**Adaptation Guide**
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The names of relevant APIs should be changed according to the preceding changes.
-
-## cl.distributeddatamgr.6 Migration of interface RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-**interface RdbStoreV9** is migrated from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface RdbStore**.
-
-**Adaptation Guide**
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The names of relevant APIs should be changed according to the preceding changes.
-
-## cl.distributeddatamgr.7 Migration of class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-**class RdbPredicatesV9** is migrated from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface RdbPredicates**.
-
-**Adaptation Guide**
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The names of relevant APIs should be changed according to the preceding changes.
-
-## cl.distributeddatamgr.8 Migration of interface ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts
-**Change Impacts**
-
-The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-**interface ResultSetV9** is migrated from **api/data/rdb/resultSet.d.ts** to **@ohos.data.relationalStore.d.ts** and is renamed as **interface ResultSet**.
-
-**Adaptation Guide**
-
- * `import rdb from "@ohos.data.rdb"` is changed to `import rdb from "@ohos.data.relationalStore"`.
- * The **ResultSetV9** instance is obtained only via **getRdbStoreV9**. After modifications are made according to cl.distributeddatamgr.2, the code can automatically adapt to **ResultSet**.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-bundlemanager.md
deleted file mode 100644
index 94e7367fe1d8daeee5d9a943ca6d85b463e7be2a..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-bundlemanager.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# Bundle Manager Subsystem Changelog
-
-## cl.bundlemanager.1 Deleted the atomicService Tag from the app.json File
-The **atomicService** tag is deleted from the **app.json** file.
-
-**Change Impact**
-If this tag is used, an error is reported during compilation on DevEco Studio.
-
-**Adaptation Guide**
-Delete the **atomicService** tag from your code.
-
-## cl.bundlemanager.2 Added the bundleType Tag to the app.json File
-The **bundleType** tag is added to the **app.json** file.
-
-**Change Impact**
-For an existing ability with [installationFree](../../../application-dev/quick-start/module-configuration-file.md) set to **true**, **bundleType** must be set to **atomicService** in the **app.json** file. Otherwise, the packaging fails.
-
-**Adaptation Guide**
-Add the [bundleType](../../../application-dev/quick-start/app-configuration-file.md) tag. This tag can be left blank. The default value is **app**. The setting of this tag and the [installationFree](../../../application-dev/quick-start/module-configuration-file.md) field in the **module.json** file must meet the following rules:
-- If **bundleType** is **app**, **installationFree** must be set to **false**.
-- If **bundleType** is **atomicService**, **installationFree** must be set to **true**.
-
-## cl.bundlemanager.3 Deleted the split Field from the ApplicationInfo Struct
-
-The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
-
-**Change Impact**
-If the **split** field is used in your code, the compilation fails.
-
-**Key API/Component Changes**
-The **split** field is deleted from the [ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) struct.
-
-**Adaptation Guide**
-Delete the **split** field from the **ApplicationInfo** struct of your code. The stage model always forcibly splits bundles.
-
-## cl.bundlemanager.4 Deleted the atomicServiceModuleType Field from the HapModuleInfo Struct
-
-The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
-
-**Change Impact**
-If the **atomicServiceModuleType** field is used in your code, the compilation fails.
-
-**Key API/Component Changes**
-The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
-
-**Adaptation Guide**
-Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
-
-## cl.bundlemanager.5 Deleted the AtomicServiceModuleType Enumerated Value
-
-The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
-
-**Change Impact**
-If the **atomicServiceModuleType** field is used in your code, the compilation fails.
-
-**Key API/Component Changes**
-The **atomicServiceModuleType** field is deleted from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct.
-
-**Adaptation Guide**
-Record the setting of the **atomicServiceModuleType** field, delete it from the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct, and set the **moduleType** field in the [HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) struct to the recorded value.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-imf.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-imf.md
deleted file mode 100644
index f158d99d9a0023c67ad982fc6b687563121f4dac..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-imf.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Input Method Framework Subsystem – Input Method Framework Service Changelog
-
-
-## @ohos.InputMethodSubtype Change of name, label, and id
-Changed the **name**, **label**, and **id** attributes since API version 9.
-
-**Change Impact**
-
-Applications must be adapted to the following changes.
-
-| Name| Before Change| After Change|
-| -------- | -------- | -------- |
-| label | (1) Value: ID of the input method subtype.| (1) Value: Label of the input method subtype.|
-| name | (1) Description: Name of the input method subtype. (2) Value: Label of the input method subtype.| (1) Description: Bundle name of the input method; (2) Value: Bundle name of the input method.|
-| id | (1) Value: Bundle name of the input method.| (1) Value: ID of the input method subtype.|
-
-**Adaptation Guide**
-
-Update the code to adapt to the preceding changes.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-screenlock.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-screenlock.md
deleted file mode 100644
index deeaac319aecfd4ba2824b8f23370d6fe2601adc..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-screenlock.md
+++ /dev/null
@@ -1,157 +0,0 @@
-# Theme Framework Subsystem – Screenlock Management Service Changelog
-
-
-## cl.screenlock.1 Permission Change of isLocked and unlock
-Changed the **isLocked** and **unlock** APIs to system APIs since API version 9.
-
-You need to adapt your application based on the following information.
-
-**Change Impact**
-
-The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
-
-- Involved APIs:
-
-```js
- function isLocked(): boolean;
- function unlock(callback: AsyncCallback): void;
- function unlock():Promise;
-```
-
-- Before change:
-
-```js
- * Checks whether the screen is currently locked.
- *
- * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise.
- * @syscap SystemCapability.MiscServices.ScreenLock
- * @since 9
- */
- function isLocked(): boolean;
-
- /**
- * Unlock the screen.
- *
- * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
- * @syscap SystemCapability.MiscServices.ScreenLock
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function unlock(callback: AsyncCallback): void;
-
- /**
- * Unlock the screen.
- *
- * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
- * @syscap SystemCapability.MiscServices.ScreenLock
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function unlock():Promise;
-```
-
-- After change:
-
-```js
- * Checks whether the screen is currently locked.
- *
- * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @syscap SystemCapability.MiscServices.ScreenLock
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function isLocked(): boolean;
-
- /**
- * Unlock the screen.
- *
- * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
- * @syscap SystemCapability.MiscServices.ScreenLock
- * @since 9
- */
- function unlock(callback: AsyncCallback): void;
-
- /**
- * Unlock the screen.
- *
- * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
- * @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
- * @syscap SystemCapability.MiscServices.ScreenLock
- * @since 9
- */
- function unlock():Promise;
-```
-
-
-**Adaptation Guide**
-
-Make sure the APIs are only invoked by system applications.
-
-The code snippet is as follows:
-
-```js
- try {
- let ret = screenLock.isLocked();
- console.error(`Obtain whether the screen is locked successfully , ret is: ${ret}`);
- } catch (error) {
- console.error(`Failed to obtain whether the screen is locked, error is : ${error.code}, ${error.message}`);
- }
-```
-
-```js
- screenlock.unlock((err, data) => {
- if (err) {
- console.error(`Failed to unlock the screen, because: ${err.message}`);
- return;
- }
- console.info(`unlock the screen successfully. result: ${data}`);
- });
-```
-
-```js
- screenlock.unlock().then((data) => {
- console.info(`unlock the screen successfully. result: ${data}`);
- }).catch((err) => {
- console.error(`Failed to unlock the screen, because: ${err.message}`);
- });
-```
-
-
-## cl.screenlock.2 Deprecation of isSecure
-Deprecated the **isSecure** API since API version 9.
-
-You need to adapt your application based on the following information.
-
-**Change Impact**
-
-The API can no longer be used after being deleted.
-
-- Involved APIs:
-
-```js
- function isSecure(): boolean;
-```
-
-- Before change:
-
-```js
- function isSecure(): boolean;
-```
-
-- After change:
-
- The API is deleted.
-
-
-**Adaptation Guide**
-
-Update the code so that the deprecated API is not used.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-wallpaper.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-wallpaper.md
deleted file mode 100644
index 18fff418c0723c7508f6c7eacdb318b95758402b..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-wallpaper.md
+++ /dev/null
@@ -1,306 +0,0 @@
-# Theme Framework Subsystem – Wallpaper Management Service Changelog
-
-
-## cl.wallpaper.1 Permission Change of getColorsSync, getMinHeightSync, getMinWidthSync, restore, and setImage
-Changed the **getColorsSync**, **getMinHeightSync**, **getMinWidthSync**, restore, and **setImage** APIs to system APIs since API version 9.
-
-You need to adapt your application based on the following information.
-
-**Change Impact**
-
-The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
-
-- Involved APIs:
-
-```js
- function getColorsSync(wallpaperType: WallpaperType): Array;
- function getMinHeightSync(): number;
- function getMinWidthSync(): number;
- function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void;
- function restore(wallpaperType: WallpaperType): Promise;
- function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void;
- function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise;
-```
-
-- Before change:
-
-```js
- /**
- * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
- * @param wallpaperType Indicates the wallpaper type.
- * @returns { Array } the Array returned by the function.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function getColorsSync(wallpaperType: WallpaperType): Array;
-
- /**
- * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
- * @returns { number } the number returned by the function.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function getMinHeightSync(): number;
-
- /**
- * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
- * @returns { number } the number returned by the function.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function getMinWidthSync(): number;
-
- /**
- * Removes a wallpaper of the specified type and restores the default one.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void;
-
- /**
- * Removes a wallpaper of the specified type and restores the default one.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function restore(wallpaperType: WallpaperType): Promise;
-
- /**
- * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
- * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void;
-
- /**
- * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
- * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @systemapi Hide this for inner system use.
- * @since 9
- */
- function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise;
-```
-
-- After change:
-
-```js
- /**
- * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
- * @param wallpaperType Indicates the wallpaper type.
- * @returns { Array } the Array returned by the function.
- * @throws {BusinessError} 401 - parameter error.
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function getColorsSync(wallpaperType: WallpaperType): Array;
-
- /**
- * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
- * @returns { number } the number returned by the function.
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function getMinHeightSync(): number;
-
- /**
- * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
- * @returns { number } the number returned by the function.
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function getMinWidthSync(): number;
-
- /**
- * Removes a wallpaper of the specified type and restores the default one.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void;
-
- /**
- * Removes a wallpaper of the specified type and restores the default one.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function restore(wallpaperType: WallpaperType): Promise;
-
- /**
- * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
- * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void;
-
- /**
- * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
- * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
- * @param wallpaperType Indicates the wallpaper type.
- * @throws {BusinessError} 401 - parameter error.
- * @throws {BusinessError} 201 - permission denied.
- * @permission ohos.permission.SET_WALLPAPER
- * @syscap SystemCapability.MiscServices.Wallpaper
- * @since 9
- */
- function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise;
-```
-
-
-**Adaptation Guide**
-
-Make sure the APIs are only invoked by system applications.
-
-The code snippet is as follows:
-
-```js
- try {
- let colors = wallpaper.getColorsSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM);
- console.log(`success to getColorsSync: ${JSON.stringify(colors)}`);
- } catch (error) {
- console.error(`failed to getColorsSync because: ${JSON.stringify(error)}`);
- }
-```
-
-```js
- let minHeight = wallpaper.getMinHeightSync();
-```
-
-```js
- let minWidth = wallpaper.getMinWidthSync();
-```
-
-```js
- wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => {
- if (error) {
- console.error(`failed to restore because: ${JSON.stringify(error)}`);
- return;
- }
- console.log(`success to restore.`);
- });
-```
-
-```js
- wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => {
- console.log(`success to restore.`);
- }).catch((error) => {
- console.error(`failed to restore because: ${JSON.stringify(error)}`);
- });
-```
-
-```js
- // The source type is string.
- let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg";
- wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => {
- if (error) {
- console.error(`failed to setImage because: ${JSON.stringify(error)}`);
- return;
- }
- console.log(`success to setImage.`);
- });
-```
-
-```js
- // The source type is string.
- let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg";
- wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => {
- console.log(`success to setImage.`);
- }).catch((error) => {
- console.error(`failed to setImage because: ${JSON.stringify(error)}`);
- });
-```
-
-
-## cl.wallpaper.2 Deprecation of getIdSync, getFileSync, isChangeAllowed, isUserChangeAllowed, on, off, and RgbaColor
-Deprecated the **getIdSync**, **getFileSync**, **isChangeAllowed**, **isUserChangeAllowed**, **on**, **off**, and **RgbaColor** APIs since API version 9.
-
-You need to adapt your application based on the following information.
-
-**Change Impact**
-
-The APIs can no longer be used after being deleted.
-
-- Involved APIs:
-
-```js
- function getIdSync(wallpaperType: WallpaperType): number;
- function getFileSync(wallpaperType: WallpaperType): number;
- function isChangeAllowed(): boolean;
- function isUserChangeAllowed(): boolean;
- function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void;
- function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void;
- interface RgbaColor {
- red: number;
- green: number;
- blue: number;
- alpha: number;
- }
-```
-
-- Before change:
-
-```js
- function getIdSync(wallpaperType: WallpaperType): number;
- function getFileSync(wallpaperType: WallpaperType): number;
- function isChangeAllowed(): boolean;
- function isUserChangeAllowed(): boolean;
- function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void;
- function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void;
- interface RgbaColor {
- red: number;
- green: number;
- blue: number;
- alpha: number;
- }
-```
-
-- After change:
-
- The APIs are deleted.
-
-
-**Adaptation Guide**
-
-Update the code so that the deprecated APIs are not used.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md
deleted file mode 100644
index abafad96dd7c025fdef8c5144e3f10c0f1ff48f9..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.2/changelogs-bundlemanager.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Bundle Manager Subsystem Changelog
-
-## cl.bundlemanager.1 Field Change of the ApplicationInfo Struct in API Version 9
-
-The **ApplicationInfo** struct [bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) in API version 9 has field changes, with the **systemApp** field being added and the **entryDir** field being deleted.
-
-**Change Impact**
-There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
-
-**Key API/Component Changes**
-The following table describes the changed fields in the **ApplicationInfo** struct.
-| Deleted Field| Added or Changed Field in API Version 9| Type|
-| --- | --- | --- |
-| N/A| systemApp | boolean |
-| entryDir | N/A | string |
-
-**Adaptation Guide**
-Import the bundle manager query module and use the **systemApp** field in the **ApplicationInfo** struct of API version 9. If the **entryDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
-
-## cl.bundlemanager.2 Field Change of the HapModuleInfo Struct in API Version 9
-
-The **moduleSourceDir** field is deleted from the **HapModuleInfo** struct [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) in API version 9.
-
-**Change Impact**
-There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
-
-**Key API/Component Changes**
-The following table describes the changed fields in the **HapModuleInfo** struct.
-| Deleted Field| Added or Changed Field in API Version 9| Type|
-| --- | --- | --- |
-| moduleSourceDir | N/A | string |
-
-**Adaptation Guide**
-Import the bundle manager query module and do not use the **moduleSourceDir** field in the **HapModuleInfo** struct of API version 9. If the **moduleSourceDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md
deleted file mode 100644
index ed95a11140efc969e38d2ba50ad6ec1ed4d08b96..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-bundlemanager.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Bundle Manager Subsystem ChangeLog
-
-## cl.bundlemanager.1 Name Change of the Bundle Manager Distributed Query Module
-
-The name of the bundle manager distributed query module in API version 9 is changed from **ohos.bundle.distributedBundle** to **[ohos.bundle.distributedBundleManager](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts)**. The APIs remain unchanged.
-
-**Change Impacts**
-
-There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt the new module.
-
-**Key API/Component Changes**
-
-The name of the bundle manager distributed query module is changed from **ohos.bundle.distributedBundle** to **ohos.bundle.distributedBundleManager**. The APIs remain unchanged.
-
-**Adaptation Guide**
-
-Change the module to import from **@ohos.bundle.distributedBundle** to **@ohos.bundle.distributedBundleManager**.
-
-```ts
-import distributedBundle form '@ohos.bundle.distributedBundleManager';
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-nfc.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-nfc.md
deleted file mode 100644
index a2499c7699ae3f6742ff3bc4e8bb96a879e73c36..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-nfc.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# ChangeLog of NFC JS API Changes in the Communication Subsystem
-
-Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.2(Mr) has the following API changes in the distributed data management subsystem.
-
-## cl.nfc.1 API Change
-Some NFC JS APIs in API versions 6 to 8 cannot throw error codes and need to be deprecated and deleted, and then APIs in API version 9 are used instead.
-
-You need to adapt your application based on the following information.
-
- **Change Impacts**
-
-Some JS APIs in API versions 6 to 8 are affected. Your application needs to adapt new APIs so that it can properly implement functions in the SDK environment of the new version.
-
-**Key API/Component Changes**
-
-| Module | Class | Method/Attribute/Enumeration/Constant| Change Type|
-| -------------------------------- | ------------- | ------------------- | -------- |
-| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | FeatureType | Deprecated |
-| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | isSupported | Deprecated |
-| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | hasHceCapability | Added |
-| api/@ohos.nfc.controller.d.ts | nfcController | isNfcAvailable | Deprecated |
-| api/@ohos.nfc.controller.d.ts | nfcController | openNfc | Deprecated |
-| api/@ohos.nfc.controller.d.ts | nfcController | closeNfc | Deprecated |
-| api/@ohos.nfc.controller.d.ts | nfcController | enableNfc | Added |
-| api/@ohos.nfc.controller.d.ts | nfcController | disableNfc | Added |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcATag | Deprecated |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcBTag | Deprecated |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcFTag | Deprecated |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcVTag | Deprecated |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcA | Added |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcB | Added |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcF | Added |
-| api/@ohos.nfc.tag.d.ts | tag | getNfcV | Added |
-| api/tag/tagSession.d.ts | TagSession | getTagInfo | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | connectTag | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | reset | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | isTagConnected | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | setSendDataTimeout | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | getSendDataTimeout | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | sendData | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | getMaxSendLength | Deprecated |
-| api/tag/tagSession.d.ts | TagSession | connect | Added |
-| api/tag/tagSession.d.ts | TagSession | resetConnection | Added |
-| api/tag/tagSession.d.ts | TagSession | isConnected | Added |
-| api/tag/tagSession.d.ts | TagSession | setTimeout | Added |
-| api/tag/tagSession.d.ts | TagSession | getTimeout | Added |
-| api/tag/tagSession.d.ts | TagSession | transmit | Added |
-| api/tag/tagSession.d.ts | TagSession | getMaxTransmitSize | Added |
-
-**Adaptation Guide**
-
-View the following API references:
-[@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cardEmulation.md)
-
-[@ohos.nfc.controller (Standard NFC)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-nfcController.md)
-
-[@ohos.nfc.tag (Standard NFC Tags)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-nfcTag.md)
-
-[tagSession (Standard NFC Tag Session)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-tagSession.md)
-```
-
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-bundlemanager.md
deleted file mode 100644
index 3019a09c81ab3d541eea0f5efe38c7483cd2a3d6..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-bundlemanager.md
+++ /dev/null
@@ -1,107 +0,0 @@
-# Bundle Manager Subsystem ChangeLog
-
-## cl.bundlemanager.1 Changed Underlying Capability by Adding Verification to bundle-name in the Signing Certification During Application Installation
-
-During application installation, the **bundle-name** field in the [signing certificate profile](../../../application-dev/security/app-provision-structure.md) is verified against the bundle name of the application.
-
-If the value of **bundle-name** is different from the value of **bundleName** in the application configuration file, the installation fails and the following error information is displayed:
-```
-error: verify signature failed.
-```
-
-**Change Impact**
-
-For applications using system images of 3.2.10.5 or later, if the **bundle-name** field in the signing certificate profile is different from the bundle name of the application, application installation fails. This change has no impact on applications using system images earlier than 3.2.10.5.
-
-**Key API/Component Changes**
-
-No API or component change is involved.
-
-**Adaptation Guide**
-If "error: verify signature failed" is displayed, change **bundle-name** in the signing certificate profile to the bundle name of the application, generate a new signing certificate (with the file name extension .p7b), and sign the application again.
-
-For details about how to use the signing tool and generate a signing certificate, see [hapsigner Guide](../../../application-dev/security/hapsigntool-guidelines.md).
-
-## cl.bundlemanager.2 Changed Underlying Capability by Adding Control over Applications Without Entry Icons
-
-If no entry icon is configured for an application that has not requested the **AllowHideDesktopIcon** privilege, a default icon is displayed on the home screen. Any click on the icon redirects to the application details page. An application is determined to have no entry icon in either of the following scenarios:
-1. The **abilities** field is not configured for the application.
-2. The **abilities** field is configured for the application, but the **skills** field under the ability of any page type does not contain both **ohos.want.action.home** and **entity.system.home**, as follows:
- ```json
- "skills": [
- {
- "actions": [
- "ohos.want.action.home"
- ],
- "entities": [
- "entity.system.home"
- ]
- }
- ]
- ```
-If the application installation mode is **hdc_std install** or **bm install**, a default icon is displayed for the application on the home screen.
-
-If your application does not need an icon to be displayed on the home screen, request the **AllowHideDesktopIcon** privilege and configure it in the signing certificate or trustlist (**install_list_capability.json**). For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
-
-If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **ohos.want.action.home** and **entity.system.home**.
-
-**Change Impact**
-
-For applications using system images of 3.2.10.5 and later versions, if no entry icon is configured for an application, the default icon is displayed on the home screen when the application is installed using the CLI. This change has no impact on applications using system images earlier than 3.2.10.5.
-
-**Key API/Component Changes**
-
-No API or component change is involved.
-
-**Adaptation Guide**
-
-If your application does not need an icon to be displayed on the home screen, request the **AllowHideDesktopIcon** privilege and configure it in the signing certificate or trustlist (**install_list_capability.json**). For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
-
-If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **ohos.want.action.home** and **entity.system.home**.
-
-## cl.bundlemanager.3 Changed Underlying Capability by Restricting AllowAppUsePrivilegeExtension, AllowAppMultiProcess, and AllowFormVisibleNotify from Being Configured in the Signing Certificate
-
-The **AllowAppUsePrivilegeExtension**, **AllowAppMultiProcess**, and **AllowFormVisibleNotify** privileges can no longer be configured in the signing certificate. They can be requested only through the trustlist (**install_list_capability.json**). If your application requests these privileges in the signing certificate, the installation may fail or the privileges may be invalid.
-
-If the following error information is displayed, adapt to the new privilege configuration method. For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
-```
-error: install parse profile prop check error.
-```
-
-For the XTS or local debugging demo, if the **install_list_capability.json** file on the development board cannot be modified, you can change the bundle name of the application to start with **com.acts.** and request the privileges in the signing certificate.
-
-The **AllowAppUsePrivilegeExtension** privilege is requested by configuring it under the **extensionAbilities** field, with the **type** attribute set to **dataShare** or **service**, in the application configuration file. If this privilege is not configured, the installation fails.
-
-**Change Impact**
-
-For applications using system images of 3.2.10.5 or later, if the required privileges are not requested using the trustlist (**install_list_capability.json**), application installation may fail. This change has no impact on applications using system images earlier than 3.2.10.5.
-
-**Key API/Component Changes**
-
-No API or component change is involved.
-
-**Adaptation Guide**
-
-If the following error information is displayed, adapt to the new privilege configuration method. For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
-
-```
-error: install parse profile prop check error.
-```
-
-For the XTS or local debugging demo, if the **install_list_capability.json** file on the development board cannot be modified, you can change the bundle name of the application to start with **com.acts.** and request the privileges in the signing certificate.
-
-## cl.bundlemanager.4 Changed Underlying Capability by Not Decompressing the HAP During HAP Installation
-
-The HAP will no longer be decompressed during installation. After the installation is complete, only the HAP file exists in the installation directory. As a result, the application must use the standard resource management interface, rather than a combined path, to access a resource file.
-
-**Change Impact**
-
-If the application uses a combined path to access a resource file, the access fails. It must use the resource management interface.
-
-**Key API/Component Changes**
-
-No API or component change is involved.
-
-**Adaptation Guide**
-
-The resource management subsystem provides the JS interface for accessing resource files. Reference: [Accessing Resource Files](../../../application-dev/reference/apis/js-apis-resource-manager.md#getrawfilecontent9)
\ No newline at end of file
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-filemanagement.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-filemanagement.md
deleted file mode 100644
index f8f27e77b91602c5d1b54a8e7e5d06f7fabd69c5..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-filemanagement.md
+++ /dev/null
@@ -1,189 +0,0 @@
-# File Management Subsystem Changelog
-
-## cl.filemanagement.1 environment Module Change
-
-The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **environment** module supports error code processing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **environment** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
-
-**Key API/Component Changes**
-
-Before the change, **environment** is imported from **@ohos.environment**:
-
-```js
-import environment from '@ohos.environment';
-```
-
-Now, **environment** is imported from **@ohos.file.environment**:
-
-```js
-import environment from '@ohos.file.environment';
-```
-
-## cl.filemanagement.2 securityLabel Change
-
-Moved the file management subsystem **d.ts** file to the **file** directory. The **securityLabel** module supports error code processing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **securityLabel** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
-
-**Key API/Component Changes**
-
-Before the change, **securityLabel** is imported from **@ohos.securityLabel**:
-
-```js
-import securityLabel from '@ohos.securityLabel';
-```
-
-Now, **securityLabel** is imported from **@ohos.file.securityLabel**:
-
-```js
-import securityLabel from '@ohos.file.securityLabel';
-```
-
-## cl.filemanagement.3 fs Change
-
-Changed the **ino** attribute type of **Stat** under **fs**.
-
-**Change Impact**
-
-The **ino** attribute type is changed from number to BigInt, to adapt to the **inode** range of all types of files in the file system.
-
-**Key API/Component Changes**
-
-The type of the **ino** attribute of **Stat** is changed from number to BigInt.
-
-## cl.filemanagement.4 fileAccess Change
-
-Moved the file management subsystem **d.ts** file to the **file** directory. The **fileAccess** module supports error code processing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **fileAccess** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
-
-**Key API/Component Changes**
-
-Before the change, **fileAccess** is imported from **@ohos.data.fileAccess**:
-
-```js
-import fileAccess from '@ohos.data.fileAccess';
-```
-
-Now, **fileAccess** is imported from **@ohos.file.fileAccess**:
-
-```js
-import fileAccess from '@ohos.file.fileAccess';
-```
-
-## cl.filemanagement.5 fileExtensionInfo Change
-
-Moved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code processing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **fileExtensionInfo** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
-
-**Key API/Component Changes**
-
-Before the change, **fileExtensionInfo** is imported from **@ohos.fileExtensionInfo**:
-
-```js
-import fileExtensionInfo from '@ohos.fileExtensionInfo';
-```
-
-Now, **fileExtensionInfo** is imported from **@ohos.file.fileExtensionInfo**:
-
-```js
-import fileExtensionInfo from '@ohos.file.fileExtensionInfo';
-```
-
-## cl.filemanagement.6 storageStatistics Change
-
-Moved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code processing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **storageStatistics** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
-
-**Key API/Component Changes**
-
-Before the change, **storageStatistics** was imported from **@ohos.storageStatistics**:
-
-```js
-import storageStatistics from '@ohos.storageStatistics';
-```
-
-Now, **storageStatistics** is imported from **@ohos.file.storageStatistics**:
-
-```js
-import storageStatistics from '@ohos.file.storageStatistics';
-```
-
-## cl.filemanagement.7 volumeManager Change
-
-Moved the file management subsystem **d.ts** file to the **file** directory. The **fileExtensionInfo** module supports error code processing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file location and the name of the module to be imported are changed. The **volumeManager** module supports error code processing. See [Adaptation Guide](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details.
-
-**Key API/Component Changes**
-
-Before the change, **volumeManager** was imported from **@ohos.volumeManager**:
-
-```js
-import volumeManager from '@ohos.volumeManager';
-```
-
-Now, **volumeManager** is imported from **@ohos.file.volumeManager**:
-
-```js
-import volumeManager from '@ohos.file.volumeManager';
-```
-
-## cl.filemanagement.8 fileio API Changes
-
-Deprecated the **fileio** APIs, which do not return error codes; added APIs that return error codes.
-
-**Change Impact**
-
-For applications developed based on earlier versions, pay attention to the iterative update of deprecated APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs.
-
-**Key API/Component Changes**
-
-The APIs of **@ohos.fileio** do not support error code handling and are deprecated. New APIs with minor changes in parameters are added in **@ohos.file.fs** to support unified error code handling specifications. The new APIs function the same as the original APIs. The following table lists the API changes.
-The API names remain unchanged.
-
-| Module | Method/Attribute/Enum/Constant | Change Type|
-| ------------------------- | ------------------------------------------------------------ | -------- |
-| @ohos.fileio | **function** access(path: string, mode?: number, callback?: AsyncCallback\): void \| Promise\ | Deprecated |
-| @ohos.fileio | **function** accessSync(path: string, mode?: number): void | Deprecated |
-| @ohos.file.fs | **function** access(path: string, callback?: AsyncCallback\): void \| Promise\ | Added |
-| @ohos.file.fs | **function** accessSync(path: string): boolean | Added |
-| @ohos.fileio | **function** close(fd: number, callback?: AsyncCallback\): void \| Promise\ | Deprecated |
-| @ohos.fileio | **function** closeSync(fd: number): void | Deprecated |
-| @ohos.file.fs | **function** close(file: File \| number, callback?: AsyncCallback\): void \| Promise\ | Added |
-| @ohos.file.fs | **function** closeSync(file: File \| number): void | Added |
-| @ohos.fileio | **function** mkdir(path: string, mode?: number, callback?: AsyncCallback\): void \| Promise\ | Deprecated |
-| @ohos.fileio | **function** mkdirSync(path: string, mode?: number): void | Deprecated |
-| @ohos.file.fs | **function** mkdir(path: string, callback?: AsyncCallback\): void \| Promise\ | Added |
-| @ohos.file.fs | **function** mkdirSync(path: string): void | Added |
-| @ohos.fileio | **function** readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | Deprecated |
-| @ohos.fileio | **function** readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string | Deprecated |
-| @ohos.file.fs | **function** readText(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | Added |
-| @ohos.file.fs | **function** readTextSync(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }): string | Added |
-| @ohos.fileio | **function** Stream.read(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback\): void \| Promise\ | Deprecated |
-| @ohos.fileio | **function** Stream.readSync(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number | Deprecated |
-| @ohos.file.fs | **function** Stream.read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback\): void \| Promise\ | Added |
-| @ohos.file.fs | **function** Stream.readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number | Added |
-| @ohos.fileio | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | Deprecated |
-| @ohos.fileio | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number | Deprecated |
-| @ohos.file.fs | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | Added |
-| @ohos.file.fs | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number | Added |
-
-**Adaptation Guide**
-
-The APIs of @ohos.file.fs support unified exception handling. For details, see [File Management](../../../application-dev/reference/apis/js-apis-file-fs.md).
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-ohos-geoLocationManager.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-ohos-geoLocationManager.md
deleted file mode 100644
index 0d86d0a5fcc2d7149fe02c25e095059f60e24676..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-ohos-geoLocationManager.md
+++ /dev/null
@@ -1,107 +0,0 @@
-# Location Subsystem ChangeLog
-
-## cl.location.1 API Migration from @ohos.geolocation.d.ts to @ohos.geoLocationManager.d.ts
-
-APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
-
-To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
-
-import geoLocationManager from '@ohos.geoLocationManager';
-
-
-**Change Impacts**
-
-All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
-
-import geoLocationManager from '@ohos.geoLocationManager';
-
-**Key API/Component Changes**
-
-| Class | API Type | Declaration | Change Type |
-| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| geolocation | method | function on(type: 'locationChange', request: LocationRequest, callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'locationChange', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function on(type: 'locationServiceState', callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'locationServiceState'** to **type: 'locationEnabledChange'**.|
-| geolocation | method | function off(type: 'locationServiceState', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'locationServiceState'** to **type: 'locationEnabledChange'**.|
-| geolocation | method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'cachedGnssLocationsReporting'** to **type: 'cachedGnssLocationsChange'**.|
-| geolocation | method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback>): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'cachedGnssLocationsReporting'** to **type: 'cachedGnssLocationsChange'**.|
-| geolocation | method | function on(type: 'gnssStatusChange', callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'gnssStatusChange'** to **type: 'satelliteStatusChange'**.|
-| geolocation | method | function off(type: 'gnssStatusChange', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'gnssStatusChange'** to **type: 'satelliteStatusChange'**.|
-| geolocation | method | function on(type: 'nmeaMessageChange', callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'nmeaMessageChange'** to **type: 'nmeaMessage'**.|
-| geolocation | method | function off(type: 'nmeaMessageChange', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'nmeaMessageChange'** to **type: 'nmeaMessage'**.|
-| geolocation | method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'fenceStatusChange'** to **type: 'gnssFenceStatusChange'**.|
-| geolocation | method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed **type: 'fenceStatusChange'** to **type: 'gnssFenceStatusChange'**.|
-| geolocation | method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCurrentLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCurrentLocation(request?: CurrentLocationRequest): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getLastLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function getLastLocation(): Location**.|
-| geolocation | method | function getLastLocation(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function getLastLocation(): Location**.|
-| geolocation | method | function isLocationEnabled(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationEnabled(): boolean**.|
-| geolocation | method | function isLocationEnabled(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationEnabled(): boolean**.|
-| geolocation | method | function requestEnableLocation(callback: AsyncCallback): void; | Deleted. |
-| geolocation | method | function requestEnableLocation(): Promise; | Deleted. |
-| geolocation | method | function enableLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function enableLocation(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function disableLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocation(): void**.|
-| geolocation | method | function disableLocation(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocation(): void**.|
-| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function isGeoServiceAvailable(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isGeocoderAvailable(): boolean**.|
-| geolocation | method | function isGeoServiceAvailable(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isGeocoderAvailable(): boolean**.|
-| geolocation | method | function getCachedGnssLocationsSize(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCachedGnssLocationsSize(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function flushCachedGnssLocations(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function flushCachedGnssLocations(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function sendCommand(command: LocationCommand, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function sendCommand(command: LocationCommand): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function enableLocationMock(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableLocationMock(): void**.|
-| geolocation | method | function enableLocationMock(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableLocationMock(): void**.|
-| geolocation | method | function disableLocationMock(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocationMock(): void**.|
-| geolocation | method | function disableLocationMock(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableLocationMock(): void**.|
-| geolocation | method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setMockedLocations(config: LocationMockConfig): void**.|
-| geolocation | method | function setMockedLocations(config: LocationMockConfig): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setMockedLocations(config: LocationMockConfig): void**.|
-| geolocation | method | function enableReverseGeocodingMock(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableReverseGeocodingMock(): void**.|
-| geolocation | method | function enableReverseGeocodingMock(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function enableReverseGeocodingMock(): void**.|
-| geolocation | method | function disableReverseGeocodingMock(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableReverseGeocodingMock(): void**.|
-| geolocation | method | function disableReverseGeocodingMock(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function disableReverseGeocodingMock(): void**.|
-| geolocation | method | function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setReverseGeocodingMockInfo(mockInfos: Array): void**.|
-| geolocation | method | function setReverseGeocodingMockInfo(mockInfos: Array): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setReverseGeocodingMockInfo(mockInfos: Array): void**.|
-| geolocation | method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean**.|
-| geolocation | method | function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean**.|
-| geolocation | method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void**.|
-| geolocation | method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise; | Migrated to **@ohos.geoLocationManager.d.ts** and changed to **function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void**.|
-| geolocation | interface | SatelliteStatusInfo | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | CachedGnssLocationsRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | GeofenceRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | Geofence | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | ReverseGeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | GeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | GeoAddress | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | LocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | CurrentLocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | Location | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | LocationRequestPriority | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | LocationRequestScenario | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | GeoLocationErrorCode | Deprecated. |
-| geolocation | enum | LocationPrivacyType | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | LocationCommand | Migrated to **@ohos.geoLocationManager.d.ts**. |
-
-
-**(Optional) Adaptation Guide**
-
-The following sample code shows how to call **enableLocation** in the new version:
-
- ```ts
- import geoLocationManager from '@ohos.geoLocationManager';
- try {
- geoLocationManager.enableLocation((err, data) => {
- if (err) {
- console.log('enableLocation: err=' + JSON.stringify(err));
- }
- });
- } catch (err) {
- console.error("errCode:" + err.code + ",errMessage:" + err.message);
- }
- ```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-ohos-geolocation.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-ohos-geolocation.md
deleted file mode 100644
index edcd6bea8cb40b01a9b7cbf278e925273b86d9ce..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-ohos-geolocation.md
+++ /dev/null
@@ -1,92 +0,0 @@
-# Location Subsystem ChangeLog
-
-## cl.location.1 API Migration from @ohos.geolocation.d.ts to @ohos.geoLocationManager.d.ts
-
-APIs in **@ohos.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@ohos.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
-
-To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
-
-import geoLocationManager from '@ohos.geoLocationManager';
-
-
-**Change Impacts**
-
-All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
-
-import geoLocationManager from '@ohos.geoLocationManager';
-
-**Key API/Component Changes**
-
-| Class | API Type | Declaration | Change Type |
-| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| geolocation | namespace | declare namespace geolocation | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **namespace geoLocationManager**.|
-| geolocation | method | function on(type: 'locationChange', request: LocationRequest, callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'locationChange', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function on(type: 'locationServiceState', callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'locationServiceState', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function on(type: 'gnssStatusChange', callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'gnssStatusChange', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function on(type: 'nmeaMessageChange', callback: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'nmeaMessageChange', callback?: Callback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCurrentLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCurrentLocation(request?: CurrentLocationRequest): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getLastLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getLastLocation(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function isLocationEnabled(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function isLocationEnabled(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function requestEnableLocation(callback: AsyncCallback): void; | Deleted. |
-| geolocation | method | function requestEnableLocation(): Promise; | Deleted. |
-| geolocation | method | function enableLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function enableLocation(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function disableLocation(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function disableLocation(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise>; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function isGeoServiceAvailable(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function isGeoServiceAvailable(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCachedGnssLocationsSize(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function getCachedGnssLocationsSize(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function flushCachedGnssLocations(callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function flushCachedGnssLocations(): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function sendCommand(command: LocationCommand, callback: AsyncCallback): void; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | method | function sendCommand(command: LocationCommand): Promise; | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | SatelliteStatusInfo | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | CachedGnssLocationsRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | GeofenceRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | Geofence | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | ReverseGeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | GeoCodeRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | GeoAddress | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | LocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | CurrentLocationRequest | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | interface | Location | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | LocationRequestPriority | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | LocationRequestScenario | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | GeoLocationErrorCode | Deprecated. |
-| geolocation | enum | LocationPrivacyType | Migrated to **@ohos.geoLocationManager.d.ts**. |
-| geolocation | enum | LocationCommand | Migrated to **@ohos.geoLocationManager.d.ts**. |
-
-
-**(Optional) Adaptation Guide**
-
-The following sample code shows how to call **enableLocation** in the new version:
-
- ```ts
- import geoLocationManager from '@ohos.geoLocationManager';
- try {
- geoLocationManager.enableLocation((err, data) => {
- if (err) {
- console.log('enableLocation: err=' + JSON.stringify(err));
- }
- });
- } catch (err) {
- console.error("errCode:" + err.code + ",errMessage:" + err.message);
- }
- ```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-system-geolocation.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-system-geolocation.md
deleted file mode 100644
index 266c351ae272da62759df17c02a2e8368818f9ee..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-system-geolocation.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# Location Subsystem ChangeLog
-
-## cl.location.1 API Migration from @system.geolocation.d.ts to @ohos.geoLocationManager.d.ts
-
-APIs in **@system.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@system.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added.
-
-To use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**.
-
-import geoLocationManager from '@ohos.geoLocationManager';
-
-
-**Change Impacts**
-
-All APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**.
-
-import geoLocationManager from '@ohos.geoLocationManager';
-
-**Key API/Component Changes**
-
-| Class | API Type | Declaration | Change Type |
-| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| Geolocation | class | Geolocation | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager**.|
-| Geolocation | interface | static getLocation(options?: GetLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.getCurrentLocation**.|
-| Geolocation | interface | static getLocationType(options?: GetLocationTypeOption): void; | Deprecated. |
-| Geolocation | interface | static subscribe(options: SubscribeLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.on#event:locationChange**.|
-| Geolocation | interface | static unsubscribe(): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.off#event:locationChange**.|
-| Geolocation | interface | static getSupportedCoordTypes(): Array; | Deprecated. |
-| | interface | GeolocationResponse | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.Location**.|
-| | interface | GetLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest**.|
-| | interface | GetLocationTypeResponse | Deprecated. |
-| | interface | GetLocationTypeOption | Deprecated. |
-| | interface | SubscribeLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.LocationRequest**.|
-
-
-**(Optional) Adaptation Guide**
-
-The following sample code shows how to call **enableLocation** in the new version:
-
- ```ts
- import geoLocationManager from '@ohos.geoLocationManager';
- try {
- geoLocationManager.enableLocation((err, data) => {
- if (err) {
- console.log('enableLocation: err=' + JSON.stringify(err));
- }
- });
- } catch (err) {
- console.error("errCode:" + err.code + ",errMessage:" + err.message);
- }
- ```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-ability.md
deleted file mode 100644
index f2cb2a81bdbd834cee896fda68a3cfa0d2626bd3..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-ability.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Ability Subsystem Changelog
-
-## cl.ability.1 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery
-
-In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.
-The **CPP_CRASH_NO_RESTART** enum is deleted.
-
-**Change Impact**
-
-If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 3.2.10.6, its behavior will change after an upgrade to 3.2.10.6.
-
-**Key API/Component Changes**
-
-**RestartFlag** 9+
-
-Before change:
-| Name | Value | Description |
-| ----------------------------- | ---- | ------------------------------------------------------------ |
-| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
-| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH.|
-| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH.|
-| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.|
-| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
-
-After change:
-| Name | Value | Description |
-| ---------- | ---- | ---------- |
-| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
-| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.|
-| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH.|
-| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.|
-| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
-
-**Adaptation Guide**
-
-Perform adaptation based on the new semantics.
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md
deleted file mode 100644
index aff1454a2ed5fca720e5924f863361a294dacb8f..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md
+++ /dev/null
@@ -1,528 +0,0 @@
-# Web Subsystem Changelog
-
-Compared with earlier versions, OpenHarmony 3.2.10.7 has the following API changes in its web subsystem:
-
-## cl.web.1 HitTestTypeV9 Name Change
-
-Renamed the enum class **HitTestTypeV9** **WebHitTestType** to meet the naming conventions.
-
-**Change Impact**
-
-The enum class **HitTestTypeV9** and APIs that use **HitTestTypeV9** as a parameter or return value cannot be used in OpenHarmony 3.2.10.7 and later versions.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- enum HitTestTypeV9
-
-- Before change:
-
- ```ts
- enum HitTestTypeV9
- ```
-
-- After change:
-
- ```ts
- enum WebHitTestType
- ```
-
-**Adaptation Guide**
-
-Replace **HitTestTypeV9** with **WebHitTestType**.
-
-## cl.web.2 HeaderV9 Name Change
-
-Renamed the struct **HeaderV9** **WebHeader** to meet the naming conventions.
-
-**Change Impact**
-
-The struct **HeaderV9** and APIs that use **HeaderV9** as a parameter or return value cannot be used in OpenHarmony 3.2.10.7 and later versions.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- interface HeaderV9
-
-- Before change:
-
- ```ts
- interface HeaderV9
- ```
-
-- After change:
-
- ```ts
- interface WebHeader
- ```
-
-**Adaptation Guide**
-
-Replace **HeaderV9** with **WebHeader**.
-
-## cl.web.3 Member Change of HitTestValue
-
-Rename the member variable **HitTestTypeV9** in the **HitTestValue** struct **WebHitTestType** to meet the naming conventions.
-
-**Change Impact**
-
-The struct **HitTestValue** and APIs that use **HitTestValue** as a parameter or return value cannot be used in OpenHarmony 3.2.10.7 and later versions.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- interface HitTestValue
-
-- Before change:
-
- ```ts
- interface HitTestValue {
-
- /**
- * Get the hit test type.
- *
- * @since 9
- */
- type: HitTestTypeV9;
-
- /**
- * Get the hit test extra data.
- *
- * @since 9
- */
- extra: string;
- }
- ```
-
-- After change:
-
- ```ts
- interface HitTestValue {
-
- /**
- * Get the hit test type.
- *
- * @since 9
- */
- type: WebHitTestType;
-
- /**
- * Get the hit test extra data.
- *
- * @since 9
- */
- extra: string;
- }
- ```
-
-**Adaptation Guide**
-
-Replace **HitTestTypeV9** with **WebHitTestType**.
-
-## cl.web.4 Parameter Type Change of loadUrl
-
-Changed the type of the **headers** parameter in **loadUrl** to **WebHeader** to meet the naming conventions.
-
-**Change Impact**
-
-The **loadUrl** API that uses the **headers** parameter cannot be used in OpenHarmony 3.2.10.7 and later versions.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- loadUrl(url: string | Resource, headers?: Array\): void
-
-- Before change:
-
- ```ts
- loadUrl(url: string | Resource, headers?: Array): void
- ```
-
-- After change:
-
- ```ts
- loadUrl(url: string | Resource, headers?: Array): void
- ```
-
-**Adaptation Guide**
-
-Change the type of the **headers** parameter in **loadUrl** from **HeaderV9** to **WebHeader**.
-
-## cl.web.5 Return Value Type Change of getHitTest
-
-Changed the return value type of the **getHitTest** API to **WebHitTest** to meet the naming conventions.
-
-**Change Impact**
-
-The **getHitTest** API cannot be used in OpenHarmony 3.2.10.7 and later versions.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- getHitTest(): HitTestTypeV9
-
-- Before change:
-
- ```ts
- getHitTest(): HitTestTypeV9
- ```
-
-- After change:
-
- ```ts
- getHitTest(): WebHitTestType
- ```
-
-**Adaptation Guide**
-
-Change the return value type of the **getHitTest** API from **HitTestTypeV9** to **WebHitTestType**.
-
-## cl.web.6 Moving of the WebMessagePort Class
-
-Moved the **WebMessagePort** class to **@ohos.web.webview.d.ts** and added error throwing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- postMessageEvent(message: WebMessageEvent): void;
- onMessageEvent(callback: (result: string) => void): void;
-
-- Before change:
-
- ```ts
- postMessageEvent(message: WebMessageEvent): void;
- onMessageEvent(callback: (result: string) => void): void;
- ```
-
-- After change:
-
- ```ts
- postMessageEvent(message: WebMessage): void;
- onMessageEvent(callback: (result: WebMessage) => void): void;
- ```
-
-**Adaptation Guide**
-
-Instead of importing APIs from the original **WebMessagePort** class, import APIs from **@ohos.web.webview** as follows:
-
- ```ts
- import web_webview from '@ohos.web.webview';
- ```
-
-## cl.web.7 Moving of the HitTestValue Class
-
-Moved the **HitTestValue** class to **@ohos.web.webview.d.ts**; changed **HitTestValue** from a class to an API; changed the **getType** and **getExtra** from APIs to attributes.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- getType(): HitTestType;
- getExtra(): string;
-
-- Before change:
-
- ```ts
- getType(): HitTestType;
- getExtra(): string;
- ```
-
-- After change:
-
- ```ts
- type: WebHitTestType;
- extra: string;
- ```
-
-**Adaptation Guide**
-
-Instead of importing APIs from the original **HitTestValue** class, import APIs from **@ohos.web.webview** as follows:
-
- ```ts
- import web_webview from '@ohos.web.webview';
- ```
-
-## cl.web.8 Moving of API Version 9 APIs Under WebCookie
-
-Moved APIs of API version 9 in the **WebCookie** class to **web.webview.webview.WebCookieManager**
-and added error throwing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
-The APIs in the class are static.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- isCookieAllowed(): boolean;
- isThirdPartyCookieAllowed(): boolean;
- putAcceptCookieEnabled(accept: boolean): void;
- putAcceptThirdPartyCookieEnabled(accept: boolean): void;
- setCookie(url: string, value: string): boolean;
- saveCookieSync(): boolean;
- getCookie(url: string): string;
- existCookie(): boolean;
- deleteEntireCookie(): void;
- deleteSessionCookie(): void;
-
-- Before change:
-
- ```ts
- isCookieAllowed(): boolean;
- isThirdPartyCookieAllowed(): boolean;
- putAcceptCookieEnabled(accept: boolean): void;
- putAcceptThirdPartyCookieEnabled(accept: boolean): void;
- setCookie(url: string, value: string): boolean;
- saveCookieSync(): boolean;
- getCookie(url: string): string;
- existCookie(): boolean;
- deleteEntireCookie(): void;
- deleteSessionCookie(): void;
- ```
-
-- After change:
-
- ```ts
- static isCookieAllowed(): boolean;
- static isThirdPartyCookieAllowed(): boolean;
- static putAcceptCookieEnabled(accept: boolean): void;
- static putAcceptThirdPartyCookieEnabled(accept: boolean): void;
- static setCookie(url: string, value: string): void;
- static saveCookieAsync(): Promise;
- static saveCookieAsync(callback: AsyncCallback): void;
- static getCookie(url: string): string;
- static existCookie(): boolean;
- static deleteEntireCookie(): void;
- static deleteSessionCookie(): void;
- ```
-
-**Adaptation Guide**
-
-Instead of importing APIs from the original **WebCookie** class, import APIs from **@ohos.web.webview** as follows:
-
- ```ts
- import web_webview from '@ohos.web.webview';
- ```
-
-## cl.web.9 Moving of API Version 9 APIs Under WebController
-
-Moved APIs of API version 9 in the **WebController** class to **web.webview.webview.WebviewController** and added error throwing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, note that the **d.ts** file storage location and the name of the module to be imported are changed. In addition, be mindful of the error codes now that the APIs in the class support error code processing.
-The **getDefaultUserAgent** API is renamed **getUserAgent**.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- zoomIn(): boolean;
- zoomOut(): boolean;
- createWebMessagePorts(): Array\;
- postMessage(options: { message: WebMessageEvent, uri: string}): void;
- getHitTestValue(): HitTestValue;
- getWebId(): number;
- getDefaultUserAgent(): string;
- getTitle(): string;
- getPageHeight(): number;
- backOrForward(step: number): void;
- searchAllAsync(searchString: string): void;
- clearMatches(): void;
- searchNext(forward: boolean): void;
- clearSslCache(): void;
- clearClientAuthenticationCache(): void;
- getUrl(): string;
-
-- Before change:
-
- ```ts
- zoomIn(): boolean;
- zoomOut(): boolean;
- createWebMessagePorts(): Array;
- postMessage(options: { message: WebMessageEvent, uri: string}): void;
- getHitTestValue(): HitTestValue;
- getWebId(): number;
- getDefaultUserAgent(): string;
- getTitle(): string;
- getPageHeight(): number;
- backOrForward(step: number): void;
- searchAllAsync(searchString: string): void;
- clearMatches(): void;
- searchNext(forward: boolean): void;
- clearSslCache(): void;
- clearClientAuthenticationCache(): void;
- getUrl(): string;
- ```
-
-- After change:
-
- ```ts
- zoomIn(): void;
- zoomOut(): void;
- createWebMessagePorts(): Array;
- postMessage(name: string, ports: Array, uri: string): void;
- getHitTestValue(): HitTestValue;
- getWebId(): number;
- getUserAgent(): string;
- getTitle(): string;
- getPageHeight(): number;
- backOrForward(step: number): void;
- searchAllAsync(searchString: string): void;
- clearMatches(): void;
- searchNext(forward: boolean): void;
- clearSslCache(): void;
- clearClientAuthenticationCache(): void;
- getUrl(): string;
- ```
-
-**Adaptation Guide**
-
-Instead of importing APIs from the original **WebController** class, import APIs from **@ohos.web.webview** as follows:
-
- ```ts
- import web_webview from '@ohos.web.webview';
- ```
-
-## cl.web.10 Moving of the WebAsyncController Class
-
-Moved the APIs in the **WebAsyncController** class to the **web.webview.webview.WebviewController** class and added error throwing.
-
-**Change Impact**
-
-If your application is developed based on earlier versions, pay attention to error code processing.
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- storeWebArchive(baseName: string, autoName: boolean): Promise\;
- storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback\): void;
-
-- Before change:
-
- ```ts
- storeWebArchive(baseName: string, autoName: boolean): Promise;
- storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void;
- ```
-
-- After change:
-
- ```ts
- storeWebArchive(baseName: string, autoName: boolean): Promise;
- storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void;
- ```
-
-**Adaptation Guide**
-
-Example:
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
-
- @Entry
- @Component
- struct WebComponent {
- controller: web_webview.WebviewController = new web_webview.WebviewController();
-
- build() {
- Column() {
- Button('saveWebArchive')
- .onClick(() => {
- try {
- this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => {
- if (error) {
- console.info(`save web archive error: ` + JSON.stringify(error))
- return;
- }
- if (filename != null) {
- console.info(`save web archive success: ${filename}`)
- }
- });
- } catch (error) {
- console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
- }
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-## cl.web.11 Removal of webDebuggingAccess
-
-The definition of the **webDebuggingAccess** API is inappropriate. This API should take effect for all **Web** instances. In light of this, it is removed and replaced by the new API **setWebDebuggingAccess**.
-
-**Change Impacts**
-
-This API must be deprecated and replaced with the **setWebDebuggingAccess** API.
-
-**Key API/Component Changes**
-
-| Class| API Type| Declaration| Change Type|
-| -- | -- | -- | -- |
-|WebAttribute | method | webDebugggingAccess(webDebugggingAccess: boolean): WebAttribute| Deleted|
-
-**Adaptation Guide**
-
-Use the new API **setWebDebuggingAccess**.
-
-## cl.web.12 Adding of setWebDebuggingAccess
-
-Added the static API **setWebDebuggingAccess** to **WebviewController**. It sets whether to enable web debugging works for all **Web** instances.
-
-**Change Impacts**
-
-The original **webDebugggingAccess** API must be replaced with the new API in the application.
-
-**Key API/Component Changes**
-
-| Class| API Type| Declaration| Change Type|
-| -- | -- | -- | -- |
-|webview.WebviewController | method | static setWebDebugggingAccess(webDebugggingAccess: boolean): void| Added|
-
-**Adaptation Guide**
-
-The following exemplifies how to enable web debugging:
-
-```ts
-// xxx.ets
-import web_webview from '@ohos.web.webview';
-
-@Entry
-@Component
-struct WebComponent {
- controller: web_webview.WebviewController = new web_webview.WebviewController();
-
- aboutToAppear():void {
- try {
- web_webview.WebviewController.setWebDebuggingAccess(true);
- } catch(error) {
- console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
- }
- }
-
- build() {
- Column() {
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
-}
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-arkui.md
deleted file mode 100644
index 0a2bf8673fefe00b6736d5cd299e24e5f5acddf2..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-arkui.md
+++ /dev/null
@@ -1,308 +0,0 @@
-# ArkUI Subsystem Changelog
-
-## cl.arkui.1 Return Value Type Change of getInspectorTree
-
-**Change Impact**
-
-The code that uses the **getInspectorTree** API in versions earlier than OpenHarmony 3.2.10.7 must be adapted.
-
-**Key API/Component Changes**
-
-The return value of the **getInspectorTree** API is changed from the string type to the Object type.
-
-**Adaptation Guide**
-
-Adapt the code that takes the return value of **getInspectorTree** as a string.The sample code is as follows:
-
-- Before change:
-
-```typescript
-console.info(getInspectorTree())
-```
-
-- After change:
-
-```typescript
-console.info(JSON.stringify(getInspectorTree()))
-```
-
-## cl.arkui.2 Deprecation the forceRebuild Attribute of \
-
-**Change Impact**
-
-None. The attribute has no effect.
-
-**Key API/Component Changes**
-
-Deprecate the **forceRebuild** attribute of the **\** component.
-
-**Adaptation Guide**
-
-Delete the code that uses the **forceRebuild** attribute. This will not affect the functionality of the **\** component.
-
-## cl.arkui.3 Plugin Module API Changes
-
-
-### 1. API Change in the **PluginComponentTemplate** Module
-
-Renamed the **ability** parameter **bundleName** to more clearly indicate the intended meaning.
-
-You need to adapt your application.
-
-
-
-**Change Impact**
-
-The application developed based on earlier versions must be adapted to the change. Otherwise, build errors will occur.
-
-
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- interface PluginComponentTemplate {
- source: string;
- bundleName: string;
- }
-
- interface PluginComponentInterface {
- (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
-}
-
-- Before change:
-
-```js
- interface PluginComponentTemplate { source: string; ability: string; }
- interface PluginComponentInterface {
- (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
- }
-```
-
-- After change:
-
-```js
- interface PluginComponentTemplate { source: string; bundleName: string; }
- interface PluginComponentInterface {
- (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute;
- }
-```
-
-**Adaptation Guide**
-
-Use the new API. The sample code is as follows:
-
-- Before change:
-```js
-PluginComponent({
- template: { source: 'plugincomponent1', ability: 'com.example.plugin' },
- data: { 'countDownStartValue': 'new countDownStartValue' }
-}).size({ width: 500, height: 100 })
-```
-
-- After change:
-```js
-PluginComponent({
- template: { source: 'plugincomponent1', bundleName: 'com.example.plugin' },
- data: { 'countDownStartValue': 'new countDownStartValue' }
-}).size({ width: 500, height: 100 })
-```
-
-### 2. API Change in the **pluginComponentManager** Module
-
-Renamed the **want** parameter **target** to more clearly indicate the intended meaning.
-
-You need to adapt your application.
-
-
-
-**Change Impact**
-
-The application developed based on earlier versions must be adapted to the change. Otherwise, alarms will arise. Though the build may be successful, the API will not work as intended.
-
-
-
-**Key API/Component Changes**
-
-- Involved APIs:
-
- interface PushParameterForStage {
- owner: Want;
- target: Want;
- name: string;
- data: KVObject;
- extraData: KVObject;
- jsonPath?: string;
- }
-
- function push(param: PushParameterForStage, callback: AsyncCallback\): void;
-
- interface RequestParameterForStage {
- owner: Want;
- target: Want;
- name: string;
- data: KVObject;
- jsonPath?: string;
- }
-
- function request(param: RequestParameterForStage, callback: AsyncCallback\): void;
-
-- Before change:
-
-```js
- interface PushParameterForStage {
- owner: Want;
- want: Want;
- name: string;
- data: KVObject;
- extraData: KVObject;
- jsonPath?: string;
- }
-
- function push(param: PushParameterForStage, callback: AsyncCallback): void;
-
- interface RequestParameterForStage {
- owner: Want;
- want: Want;
- name: string;
- data: KVObject;
- jsonPath?: string;
- }
-
- function request(param: RequestParameterForStage, callback: AsyncCallback): void;
-```
-
-- After change:
-
-```js
- interface PushParameterForStage {
- owner: Want;
- target: Want;
- name: string;
- data: KVObject;
- extraData: KVObject;
- jsonPath?: string;
- }
-
- function push(param: PushParameterForStage, callback: AsyncCallback): void;
-
- interface RequestParameterForStage {
- owner: Want;
- target: Want;
- name: string;
- data: KVObject;
- jsonPath?: string;
- }
-
- function request(param: RequestParameterForStage, callback: AsyncCallback): void;
-```
-
-**Adaptation Guide**
-
-Use the new API. The sample code is as follows:
-
-- Before change:
-```js
-import pluginComponentManager from '@ohos.pluginComponent'
-
-pluginComponentManager.push({
- owner:{
- bundleName:"com.example.provider",
- abilityName:"com.example.provider.MainAbility"
- },
- want: {
- bundleName: "com.example.provider",
- abilityName: "com.example.provider.MainAbility",
- },
- name: "ets/pages/plugin2.js",
- data: {
- "js": "ets/pages/plugin.js",
- "key_1": 1111,
- },
- extraData: {
- "extra_str": "this is push event"
- },
- jsonPath: "",
- },
- (err, data) => {
- console.log("push_callback:err: " ,JSON.stringify(err));
- console.log("push_callback:data: " , JSON.stringify(data));
- console.log("push_callback: push ok!");
- }
-)
-
-pluginComponentManager.request({
- owner:{
- bundleName:"com.example.provider",
- abilityName:"com.example.provider.MainAbility"
- },
- want: {
- bundleName: "com.example.provider",
- abilityName: "ets/pages/plugin2.js",
- },
- name: "plugintemplate",
- data: {
- "key_1": " myapplication plugin component test",
- "key_2": 123456
- },
- jsonPath: "",
-},
- (err, data) => {
- console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability)
- console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source)
- }
-)
-```
-
-- After change:
-```js
-import pluginComponentManager from '@ohos.pluginComponent'
-
-pluginComponentManager.push({
- owner:{
- bundleName:"com.example.provider",
- abilityName:"com.example.provider.MainAbility"
- },
- target: {
- bundleName: "com.example.provider",
- abilityName: "com.example.provider.MainAbility",
- },
- name: "ets/pages/plugin2.js",
- data: {
- "js": "ets/pages/plugin.js",
- "key_1": 1111,
- },
- extraData: {
- "extra_str": "this is push event"
- },
- jsonPath: "",
- },
- (err, data) => {
- console.log("push_callback:err: " ,JSON.stringify(err));
- console.log("push_callback:data: " , JSON.stringify(data));
- console.log("push_callback: push ok!");
- }
-)
-
-pluginComponentManager.request({
- owner:{
- bundleName:"com.example.provider",
- abilityName:"com.example.provider.MainAbility"
- },
- target: {
- bundleName: "com.example.provider",
- abilityName: "ets/pages/plugin2.js",
- },
- name: "plugintemplate",
- data: {
- "key_1": " myapplication plugin component test",
- "key_2": 123456
- },
- jsonPath: "",
-},
- (err, data) => {
- console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability)
- console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source)
- }
-)
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-ability.md b/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-ability.md
deleted file mode 100644
index 5920a7cdf72d6f3b02f7fca84eafea67abbfcc1e..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-ability.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Ability Framework Changelog
-
-Compared with OpenHarmony 3.2 Release, OpenHarmony 3.2.12.2 provides more detailed error code information for the APIs of the ability framework.
-
-## cl.ability.1 Added and Optimized API Error Code Description
-
-The error code description and all error codes that may be returned by the APIs are commented out. This helps developers control the error process more accurately.
-
-**Change Impact**
-
-The external declaration of the JS APIs of API version 9 is affected, but the API functionalities are not affected. You can determine whether to adapt to the JS APIs.
-
-**Key API/Component Changes**
-
-The comments of the following modules are updated. For details, see the corresponding external API declaration and API development guide.
-
-| Module | Description of Major Changes |
-| ----------------------------------- | ------------------------------------------------------------ |
-| @ohos.app.ability.UIAbility | Added the description of error codes 16200001, 16200002, 16200004, 16200005, 16000050.|
-| @ohos.app.ability.abilityManager | Added the description of error codes 201, 202, and 16000050, and adjusted the description of error code 401.|
-| @ohos.app.ability.appManager | Added the description of error codes 201, 202, and 16000050, and adjusted the description of error code 401.|
-| @ohos.app.ability.dataUriUtils | Added the description of error code 401. |
-| @ohos.app.ability.errorManager | Added the description of error code 16000003. |
-| @ohos.app.ability.missionManager | Added the description of error codes 201, 202, 16300001, 16300002, and 16000009, and adjusted the description of error code 401.|
-| @ohos.app.ability.quickFixManager | Added the description of error codes 201, 202, 18500001, 18500002, and 18500008. |
-| @ohos.app.ability.wantAgent | Added the description of error codes 16000007, 16000015, and 16000151. |
-| application/AbilityDelegator | Added the description of error codes 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, 16200001, and 16000100.|
-| application/ApplicationContext | Added the description of error codes 16000011 and 16000050. |
-| application/Context | Added the description of error codes 201, 202, and 401. |
-| application/ServiceExtensionContext | Added the description of error codes 201, 202, 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, and 16200001.|
-| application/UIAbilityContext | Added the description of error codes 201, 16000001, 16000002, 16000004, 16000005, 16000006, 16000008, 16000009, 16000010, 16000011, 16000050, 16000053, 16000055, 16200001, and 16000100.|
-| @ohos.app.form.formHost | Added the description of error codes 201, 202, 16500050, 16500060, 16501000, 16501001, and 16501003, and adjusted the description of error code 401.|
-| @ohos.app.form.formProvider | Added the error codes 202, 16500050, 16500060, 16500100, 16501000, 16501001, 16501002, and 16501003, and adjusted the description of error code 401.|
-| application/FormExtensionContext | Added the description of error codes 202, 401, 16500050, 16500100, 16500101, and 16501000.|
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-notification.md b/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-notification.md
deleted file mode 100644
index 6912ea1b5e419a71e017f54e91202ff5570f2477..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-notification.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Notification Subsystem Changelog
-
-Compared with OpenHarmony 3.2 Release, OpenHarmony 3.2.12.2 provides more detailed error code information for the APIs of the notification subsystem.
-
-## cl.notification.1 Added and Optimized API Error Code Description
-
-The error code description and all error codes that may be returned by the APIs are commented out. This helps developers control the error process more accurately.
-
-**Change Impact**
-
-The external declaration of the JS APIs of API version 9 is affected, but the API functionalities are not affected. You can determine whether to adapt to the JS APIs.
-
-**Key API/Component Changes**
-
-The comments of the following modules are updated. For details, see the corresponding external API declaration and API development guide.
-
-| Module | Major Change |
-| --------------------------- | ------------------------------------------------------------ |
-| @ohos.commonEventManager | Added the description of error codes 801, 1500007, and 1500008. |
-| @ohos.notificationManager | Added the description of error codes 201, 202, 1600001, 1600002, 1600003, 1600004, 1600005, 1600007, 1600008, 1600009, 1600010, and 17700001, and adjusted the description of error code 401.|
-| @ohos.notificationSubscribe | Added the description of error codes 201, 202, 1600001, 1600002, 1600003, 1600007, 1600008, and 17700001, and adjusted the description of error code 401.|
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-account_os_account.md
deleted file mode 100644
index c921c58756ee0d38d61254ae8fe2952aca708b80..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-account_os_account.md
+++ /dev/null
@@ -1,105 +0,0 @@
-# Account Subsystem ChangeLog
-
-## cl.account_os_account.1 Change of Definition and Return Mode of Error Codes
-
-To solve the issues that error code definitions of the account subsystem APIs were inconsistent and that the return mode of the error codes did not comply with relevant specifications of OpenHarmony, the following changes are made and take effect in API version 9 and later:
-
-- Added the following unified error code definitions:
- - [Account Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-account.md)
- - [App Account Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-account.md)
-
-- Returned an error code in either of the following ways, according to the API type:
- - Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception.
- - Synchronous API: An error message is returned via an exception.
-
-**Change Impacts**
-
-The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected.
-
-**Key API/Component Changes**
-
-The mentioned changes involve the following APIs:
- - class AccountManager
- - activateOsAccount(localId: number, callback: AsyncCallback<void>): void;
- - removeOsAccount(localId: number, callback: AsyncCallback<void>): void;
- - setOsAccountConstraints(localId: number, constraints: Array<string>, enable: boolean, callback: AsyncCallback<void>): void;
- - setOsAccountName(localId: number, localName: string, callback: AsyncCallback<void>): void;
- - queryMaxOsAccountNumber(callback: AsyncCallback<number>): void;
- - queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>>): void;
- - createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback<OsAccountInfo>): void;
- - createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback<OsAccountInfo>): void;
- - queryOsAccountById(localId: number, callback: AsyncCallback<OsAccountInfo>): void;
- - getOsAccountProfilePhoto(localId: number, callback: AsyncCallback<string>): void;
- - setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback<void>): void;
- - on(type: 'activate' | 'activating', name: string, callback: Callback<number>): void;
- - off(type: 'activate' | 'activating', name: string, callback?: Callback<number>): void;
- - isMainOsAccount(callback: AsyncCallback<boolean>): void;
- - queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void;
- - class UserAuth
- - constructor();
- - getVersion(): number;
- - getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
- - getProperty(request: GetPropertyRequest, callback: AsyncCallback<ExecutorProperty>): void;
- - setProperty(request: SetPropertyRequest, callback: AsyncCallback<number>): void;
- - auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array;
- - authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array;
- - cancelAuth(contextID: Uint8Array): number;
- - class PINAuth
- - constructor();
- - registerInputer(inputer: IInputer): boolean;
- - unregisterInputer(authType: AuthType): void;
- - class UserIdentityManager
- - constructor();
- - openSession(callback: AsyncCallback<Uint8Array>): void;
- - addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
- - updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
- - closeSession(): void;
- - cancel(challenge: Uint8Array): number;
- - delUser(token: Uint8Array, callback: IIdmCallback): void;
- - delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): void;
- - getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
- - interface IInputData
- - onSetData: (authSubType: AuthSubType, data: Uint8Array) => void;
-
-**Adaptation Guide**
-
-The following uses **activateOsAccount** as an example to illustrate the error information processing logic of an asynchronous API:
-
-```ts
-import account_osAccount from "@ohos.account.osAccount"
-let accountMgr = account_osAccount.getAccountManager()
-let callbackFunc = (err) => {
- if (err != null) { // Handle the business error.
- console.log("account_osAccount failed, error: " + JSON.stringify(err));
- } else {
- console.log("account_osAccount successfully");
- }
-}
-try {
- accountMgr.activateOsAccount("100", callbackFunc);
-} catch (err) { // Process the error that is related to the parameter type.
- console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err));
-}
-try {
- accountMgr.activateOsAccount();
-} catch (err) { // Process the error that is related to the parameter quantity.
- console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err));
-}
-```
-
-The following uses **registerInputer** as an example to illustrate the error information processing logic of a synchronous API:
-
-```ts
-import account_osAccount from "@ohos.account.osAccount"
-let pinAuth = new account_osAccount.PINAuth()
-try {
- pinAuth.registerInputer({})
-} catch (err) { // Process the error that is related to the parameter type.
- console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err));
-}
-try {
- pinAuth.registerInputer()
-} catch (err) { // Process the error that is related to the parameter quantity.
- console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err));
-}
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-filemanagement.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-filemanagement.md
deleted file mode 100644
index d50844ea44b5a523ab4c8cbd4d57ece6d6840abd..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-filemanagement.md
+++ /dev/null
@@ -1,90 +0,0 @@
-# File Management Subsystem ChangeLog
-
-## cl.filemanagement.1 File I/O API Changes
-
-The return value of file I/O APIs of **file_api** does not contain the error code. The original APIs are deprecated, and new APIs are added.
-
-**Change Impacts**
-
-For applications developed based on earlier versions, pay attention to the iterative update of discarded APIs. The specifications of the new APIs are slightly adjusted. Pay attention to the usage of the new APIs.
-
-**Key API/Component Changes**
-
-For the adaptation to the unified API exception handling mode, related file I/O APIs are deprecated, and corresponding new APIs are added. Original APIs are stored in **@ohos.fileio**, and the new ones are stored in **@ohos.file.fs**. The newly added APIs support unified error code handling specifications and function the same as the original APIs. The parameters are slightly adjusted.
-
-| Module | Method/Attribute/Enumeration/Constant | Change Type|
-| ------------- | ------------------------------------------------------------ | -------- |
-| @ohos.fileio | **function** open(path: string, flags?: number, mode?: number, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** openSync(path: string, flags?: number, mode?: number): number; | Deprecated |
-| @ohos.file.fs | **function** open(path: string, mode?: number, callback?: AsyncCallback): void \| Promise; | Added |
-| @ohos.file.fs | **function** openSync(path: string, mode?: number): File; | Added |
-| @ohos.fileio | **function** read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number; | Deprecated |
-| @ohos.file.fs | **function** read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback): void \| Promise; | Added |
-| @ohos.file.fs | **function** readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number; | Added |
-| @ohos.fileio | **function** stat(path: string, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** statSync(path: string): Stat; | Deprecated |
-| @ohos.fileio | **function** fstat(fd: number, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** fstatSync(fd: number): Stat; | Deprecated |
-| @ohos.file.fs | **function** stat(file: string \| number, callback?: AsyncCallback): void \| Promise; | Added |
-| @ohos.file.fs | **function** statSync(file: string \| number): Stat; | Added |
-| @ohos.fileio | **function** truncate(path: string, len?: number, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** truncateSync(path: string, len?: number): void; | Deprecated |
-| @ohos.fileio | **function** ftruncate(fd: number, len?: number, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** ftruncateSync(fd: number, len?: number): void; | Deprecated |
-| @ohos.file.fs | **function** truncate(file: string \| number, len?: number, callback?: AsyncCallback): void \| Promise; | Added |
-| @ohos.file.fs | **function** truncateSync(file: string \| number, len?: number): void; | Added |
-| @ohos.fileio | **function** write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback): void \| Promise; | Deprecated |
-| @ohos.fileio | **function** writeSync(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number; | Deprecated |
-| @ohos.file.fs | **function** write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback): void \| Promise; | Added |
-| @ohos.file.fs | **function** writeSync(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number; | Added |
-
-**Adaptation Guide**
-
-The original APIs use **@ohos.fileio**, which is imported as follows:
-
-```js
-import fileio from '@ohos.fileio';
-```
-
-The new APIs use **@ohos.file.fs**, which is imported as follows:
-
-```js
-import fs from '@ohos.file.fs';
-```
-
-In addition, exception handling needs to be adapted. Sample code for synchronous API exception handling is as follows:
-```js
-import fs from '@ohos.file.fs'
-
-try {
- let file = fs.openSync(path, fs.OpenMode.READ_ONLY);
-} catch (err) {
- console.error("openSync errCode:" + err.code + ", errMessage:" + err.message);
-}
-```
-Sample code for handling exceptions of the **promise** method of an asynchronous API:
-```js
-import fs from '@ohos.file.fs'
-
-try {
- let file = await fs.open(path, fs.OpenMode.READ_ONLY);
-} catch (err) {
- console.error("open promise errCode:" + err.code + ", errMessage:" + err.message);
-}
-```
-
-Sample code for handling exceptions of the **callback** method of an asynchronous API:
-```js
-import fs from '@ohos.file.fs'
-
-try {
- fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ // Asynchronous thread (such as system call) errors are obtained from the callback.
- if (e) {
- console.error("open in async errCode:" + e.code + ", errMessage:" + e.message);
- }
- });
-} catch (err) {// Errors (such as invalid parameters) of the main thread are obtained through try catch.
- console.error("open callback errCode:" + err.code + ", errMessage:" + err.message);
-}
-```
diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-request.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-request.md
deleted file mode 100644
index fcdddaf40cfed2818c196e98da66ecae758b2e16..0000000000000000000000000000000000000000
--- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-request.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# Upload and Download Subsystem ChangeLog
-
-Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2.8.1 has the following changes in its upload and download subsystem:
-
-## cl.request.1 Changes of Error Code Definitions and Some API Names
-
-- The processing of the [upload and download error codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-request.md) is added to the upload and download APIs.
-- An error message is returned via **AsyncCallback** or the **error** object of **Promise**. An error message related to the parameter type or quantity is returned via an exception.
-- Some APIs need to be replaced with new APIs, and the parameters remain unchanged.
-
-**Change Impacts**
-
-The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected.
-
-**Key API/Component Changes**
-
-| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
-| -------------- | -------------------------- | ------------------------------------------------------------ | -------- |
-| ohos.request | request | EXCEPTION_PERMISSION | Added |
-| ohos.request | request | EXCEPTION_PARAMCHECK | Added |
-| ohos.request | request | EXCEPTION_UNSUPPORTED | Added |
-| ohos.request | request | EXCEPTION_FILEIO | Added |
-| ohos.request | request | EXCEPTION_FILEPATH | Added |
-| ohos.request | request | EXCEPTION_SERVICE | Added |
-| ohos.request | request | EXCEPTION_OTHERS | Added |
-| ohos.request | request | ERROR_OFFLINE | Added |
-| ohos.request | request | ERROR_UNSUPPORTED_NETWORK_TYPE | Added |
-| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; | Added |
-| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Added |
-| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Added |
-| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Added |
-| ohos.request | DownloadTask | delete(callback: AsyncCallback): void; | Added |
-| ohos.request | DownloadTask | delete(): Promise; | Added |
-| ohos.request | DownloadTask | suspend(callback: AsyncCallback): void; | Added |
-| ohos.request | DownloadTask | suspend(): Promise; | Added |
-| ohos.request | DownloadTask | restore(callback: AsyncCallback