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 - -![Application details screen](figures/application_details.jpg) - - **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 ![Application details screen](figures/application_details.jpg) - -**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 }) } ``` - ![GIF](figures/GIF.gif) + ![floating_button](figures/floating_button.gif) 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 -![lack-of-linkage](figures /lack-of-linkage.gif) +![lack-of-linkage](figures/lack-of-linkage.gif) 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. -![hdf-driver-model.png]( ../device-dev/driver/figures/hdf-driver-model.png) +![hdf-driver-model.png](../device-dev/driver/figures/hdf-driver-model.png) 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 -![]( figures/cesfwk_architecture_diagram.png "CES Architecture") +![](figures/cesfwk_architecture_diagram.png "CES 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): void; | Added | -| ohos.request | DownloadTask | restore(): Promise; | Added | -| ohos.request | DownloadTask | getTaskInfo(callback: AsyncCallback): void; | Added | -| ohos.request | DownloadTask | getTaskInfo(): Promise; | Added | -| ohos.request | DownloadTask | getTaskMimeType(callback: AsyncCallback): void; | Added | -| ohos.request | DownloadTask | getTaskMimeType(): Promise; | Added | -| ohos.request | UploadTask | delete(callback: AsyncCallback): void; | Added | -| ohos.request | UploadTask | delete(): Promise; | Added | -| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback): void;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;| Deprecated | -| ohos.request | request | function download(config: DownloadConfig): Promise;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Deprecated | -| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; | Deprecated | -| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Deprecated | -| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback): void;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deprecated | -| ohos.request | request | function upload(config: UploadConfig): Promise;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Deprecated | -| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deprecated | -| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Deprecated | -| ohos.request | DownloadTask | remove(callback: AsyncCallback): void;
Substitute API: delete(callback: AsyncCallback): void | Deprecated | -| ohos.request | DownloadTask | remove(): Promise;
Substitute API: delete(): Promise; | Deprecated | -| ohos.request | DownloadTask | pause(callback: AsyncCallback): void;
Substitute API: suspend(callback: AsyncCallback): void; | Deprecated | -| ohos.request | DownloadTask | pause(): Promise;
Substitute API: suspend(): Promise; | Deprecated | -| ohos.request | DownloadTask | resume(callback: AsyncCallback): void;
Substitute API: restore(callback: AsyncCallback): void; | Deprecated | -| ohos.request | DownloadTask | resume(): Promise;
Substitute API: restore(): Promise; | Deprecated | -| ohos.request | DownloadTask | query(callback: AsyncCallback): void;
Substitute API: getTaskInfo(callback: AsyncCallback): void; | Deprecated | -| ohos.request | DownloadTask | query(): Promise;
Substitute API: getTaskInfo(): Promise; | Deprecated | -| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback): void;
Substitute API: getTaskMimeType(callback: AsyncCallback): void; | Deprecated | -| ohos.request | DownloadTask | queryMimeType(): Promise;
Substitute API: getTaskMimeType(): Promise; | Deprecated | -| ohos.request | UploadTask | remove(callback: AsyncCallback): void;
Substitute API: delete(callback: AsyncCallback): void; | Deprecated | -| ohos.request | UploadTask | remove(): Promise;
Substitute API: delete(): Promise; | Deprecated | -| system.request | UploadResponse | code | Deprecated | -| system.request | UploadResponse | data | Deprecated | -| system.request | UploadResponse | headers | Deprecated | -| system.request | DownloadResponse | token | Deprecated | -| system.request | OnDownloadCompleteResponse | uri | Deprecated | -| system.request | RequestFile | filename | Deprecated | -| system.request | RequestFile | name | Deprecated | -| system.request | RequestFile | uri | Deprecated | -| system.request | RequestFile | type | Deprecated | -| system.request | RequestData | name | Deprecated | -| system.request | RequestData | value | Deprecated | -| system.request | UploadRequestOptions | url | Deprecated | -| system.request | UploadRequestOptions | data | Deprecated | -| system.request | UploadRequestOptions | files | Deprecated | -| system.request | UploadRequestOptions | header | Deprecated | -| system.request | UploadRequestOptions | description | Deprecated | -| system.request | UploadRequestOptions | success | Deprecated | -| system.request | UploadRequestOptions | fail | Deprecated | -| system.request | UploadRequestOptions | complete | Deprecated | -| system.request | OnDownloadCompleteOptions | token | Deprecated | -| system.request | OnDownloadCompleteOptions | success | Deprecated | -| system.request | OnDownloadCompleteOptions | fail | Deprecated | -| system.request | OnDownloadCompleteOptions | complete | Deprecated | -| system.request | Request | static upload(options: UploadRequestOptions): void; | Deprecated | -| system.request | Request | static download(options: DownloadRequestOptions): void; | Deprecated | -| system.request | Request | static onDownloadComplete(options: OnDownloadCompleteOptions): void; | Deprecated | - - -**Adaptation Guide** - -The following uses **downloadFile** as an example to show how it is called in the new version: - -```ts -try { - request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap', - filePath: 'xxx/xxxxx.hap'}, (err, data) => { - if (err) { - console.error('Failed to request the download. Cause: ' + JSON.stringify(err)); - return; - } - }); -} catch (err) { - console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message); -} -``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md deleted file mode 100644 index 3ebe7bc6878e2b63bbadc721606866342a506cee..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-bundlemanager.md +++ /dev/null @@ -1,761 +0,0 @@ -# Bundle Manager Subsystem ChangeLog - -## cl.bundlemanager.1 Bundle Manager API Changes -The bundle manager APIs use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. APIs in API version 8 and earlier are deprecated. Replace them with APIs in API version 9 instead. - -**Change Impacts** - -The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs (version 9) and their method for returning API error information. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -The new APIs are classified by module. The original **d.ts** file is divided into multiple ones. You can import the **d.ts** files as required. The newly added APIs support unified error code handling specifications and function the same as the original APIs. APIs whose functions are changed or added are listed separately. - -For adaptation to the unified API exception handling mode, bundle manager APIs (version 8 and earlier) are deprecated (original APIs in the following table) and corresponding new APIs (version 9) in the following table are added. - -| Original API (Deprecated) | New API (Added) | -| ------------------------------------ | ------------------------------------------------------------ | -| @ohos.bundle.d.ts | [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) | -| @ohos.bundle.d.ts | [@ohos.bundle.freeInstall.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.freeInstall.d.ts) | -| @ohos.bundle.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) | -| @ohos.bundle.innerBundleManager.d.ts | [@ohos.bundle.launcherBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.launcherBundleManager.d.ts) | -| @ohos.bundle.innerBundleManager.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) | -| @ohos.bundle.defaultAppManager.d.ts | [@ohos.bundle.defaultAppManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.defaultAppManager.d.ts) | -| @ohos.distributedBundle.d.ts | [@ohos.bundle.distributedBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts) | -| N/A | [@ohos.bundle.appControl.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.appControl.d.ts) | -| @system.package.d.ts | N/A | - -**Adaptation Guide** -1. Call the bundle manager query API. -``` -import bundle form '@ohos.bundle.bundleManager' -``` -2. Call the bundle manager installation and uninstallation API. -``` -import installer form '@ohos.bundle.installer' -``` -3. Call the bundle manager installation-free API. -``` -import freeInstall form '@ohos.bundle.freeInstall' -``` -4. Call the bundle manager launcher APIs. -``` -import launcherBundleManager form '@ohos.bundle.launcherBundleManager' -import bundleMonitor form '@ohos.bundle.bundleMonitor' -``` -6. Call the bundle manager API for the default application. -``` -import defaultAppManager form '@ohos.bundle.defaultAppManager' -``` -7. Call the distributed bundle manager API. -``` -import distributedBundle form '@ohos.bundle.distributedBundle' -``` -In addition, exception handling is needed. For details, see the API reference for the new APIs. - -## cl.bundlemanager.1 Bundle Manager API Structure Changes -The bundle manager APIs use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. The structures of APIs in API version 8 and earlier are deprecated. Use the structures of APIs in API version 9 instead. - -**Change Impacts** - -The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt new structures. Otherwise, the original service logic will be affected. The export function of original level-2 modules will also be deprecated. Instead, the level-2 modules' export function of new APIs will be used, and new level-1 d.ts modules are imported. - -**Key API/Component Changes** - -The structures of APIs in API version 8 and earlier are sorted out and deprecated, and those of new APIs in API version 9 are added. The following table lists the comparison before and after the change. Some structures are combined. For example, replace **moduleInfo.d.ts** with **hapModuleInfo.d.ts** and **customizeData.d.ts** with **metadata.d.ts**. The structures' functions are the same as those of the original ones. Structures whose attributes are changed or added are listed separately. -| Original Structure (Deprecated) | New Structure (Added) | -| -------------------------------- | ------------------------------------------------------------ | -| bundle/abilityInfo.d.ts | [bundleManager/AbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) | -| bundle/applicationInfo.d.ts | [bundleManager/ApplicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) | -| bundle/bundleInfo.d.ts | [bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts) | -| bundle/bundleInstaller.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) | -| bundle/bundleStatusCallback.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) | -| bundle/customizeData.d.ts | [bundleManager/Metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/Metadata.d.ts) | -| bundle/dispatchInfo.d.ts | [bundleManager/DispatchInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/DispatchInfo.d.ts) | -| bundle/elementName.d.ts | [bundleManager/ElementName.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ElementName.d.ts) | -| bundle/extensionAbilityInfo.d.ts | [bundleManager/ExtensionAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) | -| bundle/hapModuleInfo.d.ts | [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) | -| bundle/launcherAbilityInfo.d.ts | [bundleManager/LauncherAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/LauncherAbilityInfo.d.ts) | -| bundle/metadata.d.ts | [bundleManager/Metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/Metadata.d.ts) | -| bundle/moduleInfo.d.ts | [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) | -| bundle/PermissionDef.d.ts | [bundleManager/PermissionDef.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/PermissionDef.d.ts) | -| bundle/remoteAbilityInfo.d.ts | [bundleManager/RemoteAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/RemoteAbilityInfo.d.ts) | -| bundle/shortcutInfo.d.ts | [bundleManager/ShortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ShortcutInfo.d.ts) | - -**Adaptation Guide** -1. Replace the code of original structures with the code of new ones. -2. Deprecate the export function of original level-2 modules. Instead, use the level-2 modules' export function of new APIs, and import new level-1 d.ts modules. - -## cl.bundlemanager.3 Bundle Manager Query API Changes - -Bundle manager query APIs are changed as follows: APIs of version 8 and earlier in **@ohos.bundle** are deprecated, and APIs of version 9 in **@ohos.bundle** are changed to **@ohos.bundle.bundleManager**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer**. Most deprecated APIs are added to **@ohos.bundle.bundleManager** and changed to system APIs, and the exception handling capability is added. - -API call mode: APIs are now used by the **@ohos.bundle.bundleManager**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer** modules, instead of the **@ohos.bundle** module. - -The system capability of the **@ohos.bundle.bundleManager** and **@ohos.bundle.installer** modules is **SystemCapability.BundleManager.BundleFramework.Core**, and that of **@ohos.bundle.freeInstall** is **SystemCapability.BundleManager.BundleFramework.FreeInstall**. - -**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 new modules and APIs. APIs of version 9 in **@ohos.bundle** are moved to the new **@ohos.bundle.bundleManager.d.ts**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer** files. - -**Key API/Component Changes** - -The following table lists the deprecated and changed APIs involved in **@ohos.bundle.d.ts**. The APIs not listed in the table have no change in API names and input parameters, and they have new exception handling and import modules. The APIs can be directly used after being imported to **@ohos.bundle.bundleManager.d.ts**, **@ohos.bundle.freeInstall**, and **@ohos.bundle.installer**. The APIs listed in the table are changed in API version 9, and those marked with "N/A" are deprecated in API version 9. - -| Original API (Deprecated) | New API (Changed or Added) | System API| New File Name | -| ---------------------------- | ---------------------------- | --------- | ------------------------------- | -| BundleFlag | BundleFlag | No | @ohos.bundle.bundleManager.d.ts | -| N/A | ApplicationFlag | Yes | @ohos.bundle.bundleManager.d.ts | -| N/A | AbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts | -| ExtensionFlag | ExtensionAbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts | -| ColorMode | N/A | No | N/A | -| GrantStatus | PermissionGrantState | No | @ohos.bundle.bundleManager.d.ts | -| AbilityType | AbilityType | No | @ohos.bundle.bundleManager.d.ts | -| AbilitySubType | N/A | No | N/A | -| DisplayOrientation | DisplayOrientation | No | @ohos.bundle.bundleManager.d.ts | -| LaunchMode | LaunchType | No | @ohos.bundle.bundleManager.d.ts | -| ExtensionAbilityType | ExtensionAbilityType | Yes | @ohos.bundle.bundleManager.d.ts | -| BundleOptions | N/A | No | N/A | -| InstallErrorCode | N/A | No | N/A | -| UpgradeFlag | UpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts | -| SupportWindowMode | SupportWindowMode | No | @ohos.bundle.bundleManager.d.ts | -| getBundleInfo | getBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getBundleInstaller | getBundleInstaller | Yes | @ohos.bundle.installer.d.ts | -| getAbilityInfo | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getApplicationInfo | getApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| queryAbilityByWant | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getAllBundleInfo | getAllBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getAllApplicationInfo | getAllApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getNameForUid | getBundleNameByUid | Yes | @ohos.bundle.bundleManager.d.ts | -| getBundleArchiveInfo | getBundleArchiveInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getLaunchWantForBundle | getLaunchWantForBundle | Yes | @ohos.bundle.bundleManager.d.ts | -| cleanBundleCacheFiles | cleanBundleCacheFiles | Yes | @ohos.bundle.bundleManager.d.ts | -| setApplicationEnabled | setApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts | -| setAbilityEnabled | setAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts | -| queryExtensionAbilityInfos | queryExtensionAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | -| getPermissionDef | getPermissionDef | Yes | @ohos.bundle.bundleManager.d.ts | -| getAbilityLabel | getAbilityLabel | Yes | @ohos.bundle.bundleManager.d.ts | -| getAbilityIcon | getAbilityIcon | Yes | @ohos.bundle.bundleManager.d.ts | -| isAbilityEnabled | isAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts | -| isApplicationEnabled | isApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts | -| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts | -| isModuleRemovable | isHapModuleRemovable | Yes | @ohos.bundle.freeInstall.d.ts | -| getBundlePackInfo | getBundlePackInfo | Yes | @ohos.bundle.freeInstall.d.ts | -| getDispatcherVersion | getDispatchInfo | Yes | @ohos.bundle.freeInstall.d.ts | -| getProfileByAbility | getProfileByAbility | No | @ohos.bundle.bundleManager.d.ts | -| getProfileByExtensionAbility | getProfileByExtensionAbility | No | @ohos.bundle.bundleManager.d.ts | -| setDisposedStatus | setDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | -| getDisposedStatus | getDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | -| N/A | deleteDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | -| getBundleInfoSync | getBundleInfoSync | Yes | @ohos.bundle.bundleManager.d.ts | -| getApplicationInfoSync | getApplicationInfoSync | Yes | @ohos.bundle.bundleManager.d.ts | -| N/A | getBundleInfoForSelf | No | @ohos.bundle.bundleManager.d.ts | - -**Adaptation Guide** - -Replace the original APIs with new ones of version 9 and import related modules. - -Old import module: -``` -import bundle form '@ohos.bundle' -``` -New import module: -``` -import bundle form '@ohos.bundle.bundleManager' -import freeInstall form '@ohos.bundle.freeInstall' -import installer form '@ohos.bundle.installer' -import appControl form '@ohos.bundle.appControl' -``` - -## cl.bundlemanager.4 BundleInfo Structure Changes - -All **bundle/bundleInfo.d.ts** fields in the bundle manager are deprecated. [bundle/bundleInfo.d.ts]((https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundle/bundleInfo.d.ts)) is changed to [bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts), involving field type changes. - -**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 new modules and APIs. When a level-2 module is used to export **BundleInfo**, the **@ohos.bundle.bundleManager** module needs to be imported. - -**Key API/Component Changes** - -The following table describes the changed fields in the **BundleInfo** structure. After other fields are deprecated in **bundle/bundleInfo.d.ts**, they have corresponding values in the new **[bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts)**. If corresponding fields do not exist, the fields have been deprecated in API version 9. - -| Deprecated | Added or Changed in API Version 9 | Type | -| --------------------- | --------------------- | ------------------------------------------ | -| type | N/A | string | -| appId | N/A | string | -| N/A | signatureInfo | SignatureInfo | -| uid | N/A | number | -| abilityInfos | N/A | Array\ | -| reqPermissions | N/A | Array | -| compatibleVersion | N/A | number | -| isCompressNativeLibs | N/A | boolean | -| entryModuleName | N/A | string | -| cpuAbi | N/A | string | -| isSilentInstallation | N/A | string | -| entryInstallationFree | N/A | boolean | -| reqPermissionStates | permissionGrantStates | Array\ | -| extensionAbilityInfo | N/A | Array\ | -| hapModuleInfos | hapModulesInfo | Array\ | - -The **SignatureInfo** structure is added to API version 9 as follows. - -| Field | Type | -| ----------- | ------ | -| appId | string | -| fingerprint | string | - -**Adaptation Guide** - -Use the **BundleInfo** structure of API version 9 for modules imported for bundle manager query. The following module needs to be imported when a level-2 module is used for export. - -``` -import bundle form '@ohos.bundle.bundleManager' -``` - -## cl.bundlemanager.5 ApplicationInfo Structure Changes -The **ApplicationInfo** structure is changed. The original **bundle/applicationInfo.d.ts** fields in the bundle manager are deprecated, and the file is changed from **bundle/applicationInfo.d.ts** to **bundleManager/ApplicationInfo.d.ts**, involving field type changes. - -**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 new modules and APIs. When a level-2 module is used to export **ApplicationInfo**, the **@ohos.bundle.bundleManager** module needs to be imported. - -**Key API/Component Changes** - -The following table describes the changed fields in the **ApplicationInfo** structure. After other fields are deprecated in **bundle/applicationInfo.d.ts**, they have corresponding values in the new [bundleManager/ApplicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts). If corresponding fields do not exist, the fields have been deprecated in API version 9. - -| Deprecated | Added or Changed in API Version 9| Type | -| ---------------- | -------------- | ---------------------------------- | -| systemApp | N/A | boolean | -| labelId | N/A | string | -| labelIndex | labelId | number | -| iconId | N/A | string | -| iconIndex | iconId | number | -| supportedModes | N/A | number | -| moduleSourceDirs | N/A | Array\ | -| moduleInfos | N/A | Array\ | -| metaData | N/A | Map\> | -| entityType | N/A | string | -| fingerprint | N/A | string | - -**Adaptation Guide** - -Use the **ApplicationInfo** structure of API version 9 for modules imported for bundle manager query. - - -## cl.bundlemanager.6 HapModuleInfo Structure Changes - -The **HapModuleInfo** structure is changed. The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts), involving field type changes. - -**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 new modules and APIs. When a level-2 module is used to export **HapModuleInfo**, the **@ohos.bundle.bundleManager** module needs to be imported. - -**Key API/Component Changes** - -The following table describes the changed fields in the **HapModuleInfo** structure. After other fields are deprecated in **bundle/hapModuleInfo.d.ts**, they have corresponding values in the new **bundleManager/HapModuleInfo.d.ts** file. - -| Deprecated | Added or Changed in API Version 9 | Type | -| -------------------- | ---------------------- | ---------------------------- | -| abilityInfo | abilitiesInfo | Array | -| N/A | moduleSourceDir | string | -| backgroundImg | N/A | string | -| supportedModes | N/A | string | -| reqCapabilities | N/A | Array\ | -| moduleName | N/A | string | -| mainAbilityName | N/A | string | -| extensionAbilityInfo | extensionAbilitiesInfo | Array\ | - -**Adaptation Guide** - -Use the **HapModuleInfo** structure of API version 9 for modules imported for bundle manager query. - -## cl.bundlemanager.7 ModuleInfo Structure Changes - -The original **bundle/hapModuleInfo.d.ts** and **moduleInfo.d.ts** fields in the bundle manager are deprecated, and the files are changed to [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts), involving field changes. - -The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo** in [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts). - -**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 new modules and APIs. The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**. - -**Key API/Component Changes** - -The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**. - -**Adaptation Guide** - -Use the **HapModuleInfo** structure of API version 9. - -## cl.bundlemanager.8 AbilityInfo Structure Changes - -The **AbilityInfo** structure is changed. The original **bundle/abilityInfo.d.ts** file is deprecated and changed to **bundleManager/AbilityInfo.d.ts**, involving field type changes. - -**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 new modules and APIs. - -**Key API/Component Changes** - -The following table lists the field changes in the **AbilityInfo** structure for the bundle manager. Fields that are not listed in the table exist in the new **AbilityInfo** structure after being deprecated. Fields marked with "N/A" have been deprecated in API version 9 and do not exist in the new **AbilityInfo** structure. - -| Deprecated | Added or Changed in API Version 9 | Type | -| ------------------ | ------------------ | --------------------- | -| launchMode | launchType | number | -| supportWindowMode | supportWindowModes | Array\ | -| targetAbility | N/A | string | -| backgroundModes | N/A | number | -| formEnabled | N/A | boolean | -| subType | N/A | AbilitySubType | -| deviceCapabilities | N/A | Array\ | -| metaData | N/A | Array\ | -| maxWindowRatio | N/A | number | -| minWindowRatio | N/A | number | -| maxWindowWidth | N/A | number | -| minWindowWidth | N/A | number | -| maxWindowHeight | N/A | number | -| minWindowHeight | N/A | number | -| N/A | windowSize | WindowSize | - -The fields of the new structure **WindowSize** of API version 9 are as follows. - -| Field | Type | -| :-------------: | :----: | -| maxWindowRatio | number | -| minWindowRatio | number | -| maxWindowWidth | number | -| minWindowWidth | number | -| maxWindowHeight | number | -| minWindowHeight | number | - -**Adaptation Guide** - -Use the **AbilityInfo** structure of API version 9. - -## cl.bundlemanager.9 BundleFlag Changes - -**BundleFlag** is changed to **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in **@ohos.bundle.bundleManager**. Different types of flags are passed based on the input parameters of new APIs. - -**Change Impacts** - -**BundleFlag** is changed to **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in **@ohos.bundle.bundleManager**. Different types of flags are passed based on the input parameters of new APIs. If **BundleFlag** of a version earlier than API version 9 is directly used, the query may fail. - -**Key API/Component Changes** - -**BundleFlag** in the original **@ohos.bundle** is deprecated and replaced by **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in the new **@ohos.bundle.bundleManager**. - -The following table describes **BundleFlag** of API version 9. - -| BundleFlag | Value | Description | -| ----------------------------------------- | ---------- | ------------------------------------------------------------ | -| GET_BUNDLE_INFO_DEFAULT | 0x00000000 | Obtains the default **BundleInfo**. The obtained **BundleInfo** does not contain **signatureInfo**, **hapModuleInfo**, **appInfo**, **reqPermissionDetails**, or **permissionGrantStates**.| -| GET_BUNDLE_INFO_WITH_APPLICATION | 0x00000001 | Obtains **appInfos** with the default **BundleInfo**. | -| GET_BUNDLE_INFO_WITH_HAP_MODULE | 0x00000002 | Obtains **hapModulesInfo** with the default **BundleInfo**. | -| GET_BUNDLE_INFO_WITH_ABILITY | 0x00000004 | Indicates whether **abilitiesInfo** is obtained with **hapModulesInfo**. This flag must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE** and cannot be used independently.| -| GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY | 0x00000008 | Indicates whether **extensionAbilitiesInfo** is obtained with **hapModulesInfo**. This flag must be used together with **GET_BUNDLE_INFO_WITH_HAP_MODULE** and cannot be used independently.| -| GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains **reqPermissionDetails** and **permissionGrantStates** with the default **BundleInfo**. | -| GET_BUNDLE_INFO_WITH_METADATA | 0x00000020 | Indicates whether the returned **ApplicationInfo**, **AbilityInfo**, and **ExtensionAbilityInfo** contain metadata. This flag cannot be used independently.| -| GET_BUNDLE_INFO_WITH_DISABLE | 0x00000040 | Obtains **BundleInfo** of a disabled application and disabled ability information in **abilitiesInfo**.| -| GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | 0x00000080 | Obtains **signatureInfo** with the default **BundleInfo**. | - -The following table describes **ApplicationFlag** of API version 9. - -| ApplicationFlag | Value | Description | -| ------------------------------------ | ---------- | ------------------------------------------------------------ | -| GET_APPLICATION_INFO_DEFAULT | 0x00000000 | Obtains the default **ApplicationInfo**. The obtained **ApplicationInfo** does not contain permission or metadata information.| -| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000001 | Obtains **permissions** with the default **ApplicationInfo**. | -| GET_APPLICATION_INFO_WITH_METADATA | 0x00000002 | Obtains **metadata** with the default **ApplicationInfo**. | -| GET_APPLICATION_INFO_WITH_DISABLE | 0x00000004 | Obtains disabled application information. | - - -The following table describes **AbilityFlag** of API version 9. -| AbilityFlag | Value | Description | -| --------------------------------- | ---------- | ------------------------------------------------------------ | -| GET_ABILITY_INFO_DEFAULT | 0x00000000 | Obtains the default **AbilityInfo**. The obtained **AbilityInfo** does not contain permission, metadata, or disabled ability information.| -| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000001 | Obtains **AbilityInfo** with permission information. | -| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000002 | Obtains **AbilityInfo** with the **ApplicationInfo** structure. | -| GET_ABILITY_INFO_WITH_METADATA | 0x00000004 | Obtains **AbilityInfo** with metadata information. | -| GET_ABILITY_INFO_WITH_DISABLE | 0x00000008 | Obtains all **AbilityInfo**, including disabled abilities. | -| GET_ABILITY_INFO_ONLY_SYSTEM_APP | 0x00000010 | Obtains **AbilityInfo** for system applications. | - -**Adaptation Guide** - -Use various flags according to the called API in **@ohos.bundle.bundleManager.d.ts**. - -## cl.bundlemanager.10 ApplicationType Enumerated Value Changes in the Default Application Module -For the **@ohos.bundle.defaultApp** module, both API functions and usage remain unchanged, but only the enumerated values of **ApplicationType** are changed. - -**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 new enumerated values. - -**Key API/Component Changes** - -The enumerated values of **ApplicationType** are changed as follows. - -| ApplicationType| Added or Changed in API Version 9 | API Version 8 and Earlier| -| :-------------: | :-------------: | :--------: | -| BROWSER | "Web Browser" | "BROWSER" | -| IMAGE | "Image Gallery" | "IMAGE" | -| AUDIO | "Audio Player" | "AUDIO" | -| VIDEO | "Video Player" | "VIDEO" | -| PDF | "PDF Viewer" | "PDF" | -| WORD | "Word Viewer" | "WORD" | -| EXCEL | "Excel Viewer" | "EXCEL" | -| PPT | "PPT Viewer" | "PPT" | - -**Adaptation Guide** - -Import the default application module and call related APIs. - -``` -import defaultApp form '@ohos.bundle.defaultAppManager' -``` - -## cl.bundlemanager.11 Distributed Bundle Manager Changes -API exception handling is rectified. The distributed bundle manager module is changed. The original **@ohos.distributedBundle.d.ts** APIs are deprecated, and the **@ohos.distributedBundle.d.ts** file is changed to [@ohos.bundle.distributedBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts). The **getRemoteAbilityInfos** API is changed to **getRemoteAbilityInfo**. The export function of a level-2 module in the **RemoteAbilityInfo** structure can be used only after a new module is imported. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. The names of the distributed module and the **getRemoteAbilityInfos** API are changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. - -**Key API/Component Changes** - -All APIs in **@ohos.distributedBundle.d.ts** are deprecated. The **@ohos.bundle.distributedBundleManager.d.ts** file is added. The functions of some APIs are the same as those of the original ones. New APIs support exception handling. The API changes are as follows. - -| Deprecated | Added or Changed in API Version 9 | System API| -| --------------------- | -------------------- | --------- | -| getRemoteAbilityInfos | getRemoteAbilityInfo | Yes | - -**Adaptation Guide** - -Import a new distributed module. - -``` -import distributedBundle form '@ohos.bundle.distributedBundle' -``` - -## cl.bundlemanager.12 Installation-Free Module and API Changes -APIs support exception handling rectification. The installation-free module is moved from **@ohos.bundle.d.ts** to **@ohos.bundle.freeInstall.d.ts**, involving module and API changes. The system capability is **SystemCapability.BundleManager.BundleFramework.FreeInstall**. -1. The imported **@ohos.bundle** module needs to be changed to **@ohos.bundle.freeInstall**. -2. The **setModuleUpgradeFlag** API is changed to **setHapModuleUpgradeFlag**. -3. The **isModuleRemovable** API is changed to **isHapModuleRemovable**. -4. The **getDispatcher** API is changed to **getDispatchInfo**. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. Applications using APIs of version 9 will fail to be compiled. - -**Key API/Component Changes** - -The following table lists the installation-free API changes. For APIs not listed in the table, their names and usage are unchanged, but the module name is changed. - -| Deprecated | Added or Changed in API Version 9 | System API| -| -------------------- | ----------------------- | --------- | -| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | -| isModuleRemovable | isHapModuleRemovable | Yes | -| getDispatcher | getDispatchInfo | Yes | - -**Adaptation Guide** - -To use installation-free APIs, import a new module and modify the APIs according to their mappings. - -``` -import freeInstall from '@ohos.bundle.freeInstall' -``` - -## cl.bundlemanager.13 Installation-Free Structure Field Changes -The fields of the **DisPatchInfo**, **AbilityFormInfo**, **ModuleDistroInfo**, and **ModuleConfigInfo** structures are changed as follows: -1. The name of the **dispatchAPI** field in **DispatchInfo** is changed to [dispatchAPIVersion](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/DispatchInfo.d.ts), and the type is string, which is unchanged. The field indicates the version of the installation-free API. The meaning remains unchanged. -2. The type of the **supportDimensions** field in the **AbilityFormInfo** structure is changed from **Array\** to **Array\**. -3. The type of the **defaultDimension** field in the **AbilityFormInfo** structure is changed from **number** to **string**. -4. The **mainAbility** field is deprecated in the **ModuleDistroInfo** structure and moved to the **ModuleConfigInfo** structure. -5. The **mainAbility** field is added to the **ModuleConfigInfo** structure. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. The value type of certain fields in the structures is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. - -**Key API/Component Changes** - -1. DispatchInfo - -| Deprecated | Added or Changed in API Version 9 | Type | -| ----------- | ------------------ | ------ | -| dispatchAPI | dispatchAPIVersion | string | - -2. AbilityFormInfo - -| Field | Type in API Version 9 | Original Type | -| ----------------- | -------------- | -------------- | -| supportDimensions | Array\ | Array\ | -| defaultDimension | string | number | - -3. ModuleDistroInfo - -| Field | Added or Changed in API Version 9| Type | -| ----------- | -------------- | ------ | -| mainAbility | N/A | string | - -4. MooduleConfigInfo - -| Field| Added or Changed in API Version 9| Type | -| ---- | -------------- | ------ | -| N/A | mainAbility | string | - -**Adaptation Guide** - -To use installation-free APIs, import a new module and modify the structures according to their mappings. - -``` -import freeInstall from '@ohos.bundle.freeInstall' -``` - -## cl.bundlemanager.14 Structure Changes -The structure **GrantStatus** is changed to **PermissionGrantState**. The enumeration type and values remain unchanged. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. The structure name is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. - -**Key API/Component Changes** - -The **GrantStatus** structure indicating the authorization status is changed to **PermissionGrantState** in **@ohos.bundle.bundleManager.d.ts**. - -| Name | Value| -| ------------------ | ------ | -| PERMISSION_DENIED | -1 | -| PERMISSION_GRANTED | 0 | - -**Adaptation Guide** - -Import a new module and change the structure name to **PermissionGrantState**. - -``` -import bundle form '@ohos.bundle.bundleManager' -``` -## cl.bundlemanager.15 Bundle Manager ShortcutInfo Structure Field Changes -Fields in the **ShortcutInfo** structure of the bundle manager are changed. The **bundle/shortcutInfo.d.ts** fields are deprecated, and the file is changed to [bundleManager/ShortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ShortcutInfo.d.ts). The **ShortcutInfo** and **ShortWant** structures are changed to system APIs. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. The value type of certain fields in the structures is changed. As a result, applications using APIs of version 9 may fail to be compiled using the new SDK. - -**Key API/Component Changes** - -The **ShortcutInfo** and **ShortcutWant** structures are involved. To use the level-2 module export function, import the new module **@ohos.bundle.launcherBundleManager**. -The following table lists the field changes of the **ShortcutInfo** structure. Fields that are not listed in the table still exist in API version 9. - -| Deprecated | Added or Changed in API Version 9| Type | -| -------------- | -------------- | ------- | -| disableMessage | N/A | string | -| isStatic | N/A | boolean | -| isHomeShortcut | N/A | boolean | -| isEnabled | N/A | boolean | -| disableMessage | N/A | boolean | - -The following table lists the field changes of the **ShortcutWant** structure. Fields that are not listed in the table still exist in API version 9. -| Deprecated | Added or Changed in API Version 9| Type | -| ----------- | -------------- | ------ | -| targetClass | targetAbility | string | - -**Adaptation Guide** - -To use installation-free APIs, import a new module and modify the structures according to their mappings. - -``` -import launcherBundleManager form '@ohos.bundle.launcherBundleManager' -``` - -## cl.bundlemanager.16 getBundleInstaller API Changes -The **getBundleInstaller** API of the bundle manager is moved from **@ohos.bundle.d.ts** to [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts). -The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs. - -**Key API/Component Changes** -1. For **getBundleInstaller**, the import module is changed from **@ohos.bundle** to **@ohos.bundle.installer**. - -**Adaptation Guide** - -Import the new bundle manager installation module and call **getBundleInstaller**. - -``` -import installer form '@ohos.bundle.installer' -``` - -## cl.bundlemanager.17 Bundle Manager Installation API Changes -The bundle manager installation API is moved from **bundle/bundleInstaller.d.ts** to [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts). The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. - -**Change Impacts** - -Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs. - -**Key API/Component Changes** - -1. The exception handling capability is added to the **install**, **uninstall**, and **recover** APIs. The API names and input parameters remain unchanged, and only the module name is changed. -2. Fields are added to the **HashParam** structure as follows. - -| Added in API Version 9 | Type | -| ---------- | ------ | -| moduleName | string | -| hashValue | string | - -3. Fields are added to the **InstallParam** structure as follows. - -| Added in API Version 9 | Type | -| ----------------- | ----------------- | -| userId | number | -| installFlag | number | -| isKeepData | boolean | -| hashParams | Array\ | -| crowdtestDeadline | number | - -4. The **InstallStatus** structure is deprecated. - -**Adaptation Guide** - -Import the new bundle manager installation module and call **getBundleInstaller**. - -``` -import installer form '@ohos.bundle.installer' -``` - -## cl.bundlemanager.18 Bundle Manager Installation Function Changes -The installation specifications of the bundle manager module are changed, in which whether the application **deviceType** setting matches the device type is verified. If they do not match, the installation fails. - -**Change Impacts** - -Applications developed in earlier versions are affected. Applications can be successfully installed in the image of the new version only after adaptation. - -**Key API/Component Changes** - -N/A - -**Adaptation Guide** - -Configure device types in the application configuration file **config.json** or **module.json**. - -``` -{ - "module": { - "name": "entry", - "type": "entry", - // ... - "deviceTypes":[ - // In this example, default and tablet are configured. In this case, the application can be installed on default and tablet. - "default", - "tablet" - ], - // ... - } -``` -## cl.bundlemanager.19 innerBundleManger Module API Changes -**innerBundleManager** API functions are unchanged, but API usage is changed. The [@ohos.bundle.launcherBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.launcherBundleManager.d.ts) module needs to be imported to use **innerBundleManager** APIs. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. - -**Change Impacts** - -There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **innerBundleManager** API capabilities need to adapt the new module and APIs. - -**Key API/Component Changes** - -The functions and input parameters of the following APIs remain unchanged, and API exception handling is added. When a level-2 module is used to export **ShortcutInfo** and **ShortcutWant**, the **@ohos.bundle.launcherBundleManager** module needs to be imported. The **on** and **off** APIs are deprecated from **@ohos.bundle.innerBundleManger.d.ts** and moved to **@ohos.bundle.bundleMonitor.d.ts**. - -1. getLauncherAbilityInfos
-2. getAllLauncherAbilityInfos
-3. getShortcutInfos - -**Adaptation Guide** - -Import the new module **@ohos.bundle.launcherBundleManage**. - -``` -import launcherBundleManager form '@ohos.bundle.launcherBundleManage' -``` - -## cl.bundlemanager.20 innerBundleManagr Module Changes -**innerBundleManager** API functions are unchanged, but API usage is changed. The [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) module needs to be imported to use **innerBundleManager** APIs, which are system APIs. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. - -**Change Impacts** - -There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **innerBundleManager** API capabilities need to adapt the new module and APIs. - -**Key API/Component Changes** - -The **on** and **off** APIs are changed to **@ohos.bundle.bundleMonitor.d.ts**. The input parameters are different from those of the original APIs. The function prototype of the APIs of version 9 is as follows: - -``` -function on(type: BundleChangedEvent, callback: Callback): void; -function off(type: BundleChangedEvent, callback?: Callback): void; -``` -**BundleChangedEvent**: - -``` -type BundleChangedEvent = 'add' | 'update' | 'remove'; -``` -Callback function of **BundleChangedInfo**: -``` - interface BundleChangedInfo { - readonly bundleName: string; - readonly userId: number; - } -``` -After obtaining **BundleChangedInfo**, perform related operations (that is, the **add**, **update**, and **remove** functions in **BundleStatusCallback** of the original API). - -**Adaptation Guide** - -Import the **bundleMonitor** module and call related APIs. - -``` -import bundleMonitor form '@ohos.bundle.bundleMonitor' -``` - -## cl.bundlemanager.21 bundleStatusCallback.d.ts API Changes -The **bundleStatusCallback.d.ts** APIs of the bundle manager are deprecated and moved to [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts). The **add**, **update**, and **remove** functions in **BundleStatusCallback** are deprecated and changed to **BundleChangedEvent**, which is a system API. The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. - -**Change Impacts** - -There is no impact on applications that use the APIs of versions earlier than 9. Applications that use the **BundleStatusCallback** API capabilities need to adapt the new module and APIs. - -**Key API/Component Changes** - -All the following functions are deprecated. The **BundleChangedEvent** API is added to **@ohos.bundle.bundleMonitor.d.ts**. - -1. add -2. update -3. remove - -**Adaptation Guide** - -Import the **bundleMonitor** module and call related APIs. Different from the previous **BundleStatusCallback**, **BundleStatusCallback** passes the **add**, **update**, and **remove** functions to the **on** and **off** APIs. The **BundleMonitor** uses the **on** or **off** API of version 9 to return **BundleChangedInfo** to the caller through the callback. - -``` -import bundleMonitor form '@ohos.bundle.bundleMonitor' -``` - -## cl.bundlemanager.22 Zlib Module API Changes -The **Zlib** module APIs of the bundle manager are changed. Certain APIs in [@ohos.zlib.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.zlib.d.ts) are deprecated and changed. The system capability is **SystemCapability.BundleManager.Zlib**. - -**Change Impacts** - -There is no impact on applications that use the APIs of versions earlier than 9. Applications that use APIs of version 9 need to adapt the new module and APIs. - -**Key API/Component Changes** - -The following table lists the changed APIs in **@ohos.zlib.d.ts**. The usage of the new APIs of version 9 is the same, and API exception handling is supported. - -| Deprecated | Added or Changed in API Version 9| System API| -| --------- | -------------- | --------- | -| zipFile | compressFile | Yes | -| unzipFile | decompressFile | Yes | -| ErrorCode | N/A | Yes | - -**Adaptation Guide** - -The import module does not change. The new API is directly used to adapt exception handling. - -``` -import zlib form '@ohos.zlib' -``` \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-wifi.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-wifi.md deleted file mode 100644 index 7fd3843f2cedaf7f4d8d56d05c99ff7068a9bf16..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-wifi.md +++ /dev/null @@ -1,115 +0,0 @@ -# Wi-Fi Subsystem ChangeLog - - -## cl.wifi.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.wifiManager.d.ts -**@ohos.wifi.d.ts** does not allow for throwing error codes, which is required by API version 9 and the system APIs. Therefore, all system APIs and APIs in API version 9 of **@ohos.wifi.d.ts** are migrated to the newly added **@ohos.wifiManager.d.ts**, and error code description is also added. - -Import **@ohos.wifiManager.d.ts**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used. - -import wifiManager from '@ohos.wifiManager'; - - -**Change Impacts** - -System APIs and APIs in API version 9 are affected. Import **@ohos.wifiManager** to make sure that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used. - -import wifiManager from '@ohos.wifiManager'; - -Other APIs are not affected. - - -**Key API/Component Changes** - -| Class| Type | Declaration | Change Type | -| ---- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| wifi | namespace | declare namespace wifi | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function enableWifi(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. | -| wifi | method | function disableWifi(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. | -| wifi | method | function scan(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value type to void. | -| wifi | method | function getScanResults(): Promise<Array<WifiScanInfo>> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed **getScanInfos** to **getScanResults**.| -| wifi | method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed **getScanInfos** to **getScanResults**.| -| wifi | method | function getScanResultsSync():  Array<[WifiScanInfo]> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function addCandidateConfig(config: WifiDeviceConfig): Promise<number> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function removeCandidateConfig(networkId: number): Promise<void> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function removeCandidateConfig(networkId: number, callback: AsyncCallback<void>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> | Deleted this API in API version 9. | -| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void | Deleted this API in API version 9. | -| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> | Deleted this API in API version 9. | -| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void | Deleted this API in API version 9. | -| wifi | method | function getCandidateConfigs():  Array<[WifiDeviceConfig]> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function connectToCandidateConfig(networkId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function connectToNetwork(networkId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function connectToDevice(config: WifiDeviceConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function disconnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function reassociate(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function reconnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function disableNetwork(netId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function removeAllNetwork(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function removeDevice(id: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function enableHotspot(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function disableHotspot(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function setHotspotConfig(config: HotspotConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function getP2pLocalDevice(): Promise<WifiP2pDevice> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function getP2pLocalDevice(callback: AsyncCallback<WifiP2pDevice>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>> | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | method | function createGroup(config: WifiP2PConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function removeGroup(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function p2pConnect(config: WifiP2PConfig): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function p2pCancelConnect(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function startDiscoverDevices(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function stopDiscoverDevices(): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function deletePersistentGroup(netId: number): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | method | function setDeviceName(devName: string): void | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and changed the return value to **void**.| -| wifi | interface | export interface WifiEapConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | enum | export enum EapMethod | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | enum | export enum Phase2Method | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | interface | export interface WifiDeviceConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **eapConfig** parameter.| -| wifi | interface | export interface IpConfig | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **prefixLength** parameter.| -| wifi | interface | export interface WifiInfoElem | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | enum | export enum WifiChannelWidth | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**. | -| wifi | interface | export interface WifiScanInfo | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the following three parameters: **centerFrequency0**, **centerFrequency1**, and **infoElems**.| -| wifi | enum | export enum WifiSecurityType | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added four encryption types. | -| wifi | interface | export interface WifiLinkedInfo | Migrated this API in API version 9 to **@ohos.wifiManager.d.ts**, and added the **MacType** parameter. | - - -**(Optional) Adaptation Guide** - -The following uses **getLinkedInfo** as an example to show how it is called in the new version: - -``` -import wifiManager from '@ohos.wifiManager' - -wifiManager.getLinkedInfo((err, data) => { - if (err) { - console.error("get linked info error"); - return; - } - console.info("get linked info: " + JSON.stringify(data)); -}); - -wifiManager.getLinkedInfo().then(data => { - console.info("get linked info: " + JSON.stringify(data)); -}).catch(error => { - console.info("get linked info error"); -}); - -``` - -## cl.wifiext.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.wifiManagerExt.d.ts - -**@ohos.wifiext.d.ts** does not allow for throwing error codes, which is required by API version 9 and the system API. Therefore, all system APIs and APIs in API version 9 of **@ohos.wifiext.d.ts** are migrated to the newly added **@ohos.wifiManagerExt.d.ts**, and error code description is also added. - -Import **@ohos.wifiManagerExt.d.ts**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used. - -import wifiManagerExt from '@ohos.wifiManagerExt'; - - -**Change Impacts** - -System APIs and APIs in API version 9 are affected. Import **@ohos.wifiManagerExt**, so that system APIs and APIs in API version 9 of the Wi-Fi subsystem can be used together with the Wi-Fi manager. - -import wifiManagerExt from '@ohos.wifiManagerExt'; - -Other APIs are not affected. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-account_os_account.md deleted file mode 100644 index df7cbf93cd13a7cc4dfc04fb9aec4b112633035a..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-account_os_account.md +++ /dev/null @@ -1,124 +0,0 @@ -# Account Subsystem ChangeLog - -## cl.account_os_account.1 Change in Error Information Return Method of Account System APIs - -Certain system APIs of the account subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: - -Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. - -Synchronous API: An error message is returned via an exception. - -**Change Impacts** - -The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -Before change: - - class UserAuth - - setProperty(request: SetPropertyRequest, callback: AsyncCallback<number>): void; - - setProperty(request: SetPropertyRequest): Promise<number>; - - cancelAuth(contextID: Uint8Array): number; - - class PINAuth - - registerInputer(inputer: Inputer): boolean; - - UserIdentityManager - - cancel(challenge: Uint8Array): number; - -After change: - - class UserAuth - - setProperty(request: SetPropertyRequest, callback: AsyncCallback<void>): void; - - setProperty(request: SetPropertyRequest): Promise<void>; - - cancelAuth(contextID: Uint8Array): void; - - class PINAuth - - registerInputer(inputer: Inputer): void; - - UserIdentityManager - - cancel(challenge: Uint8Array): void; - -**Adaptation Guide** - -The following uses **setProperty** as an example for asynchronous APIs: - -``` -import account_osAccount from "@ohos.account.osAccount" -userAuth.setProperty({ - authType: account_osAccount.AuthType.PIN, - key: account_osAccount.SetPropertyType.INIT_ALGORITHM, - setInfo: new Uint8Array([0]) -}, (err) => { - if (err) { - console.log("setProperty failed, error: " + JSON.stringify(err)); - } else { - console.log("setProperty successfully"); - } -}); - -userAuth.setProperty({ - authType: account_osAccount.AuthType.PIN, - key: account_osAccount.SetPropertyType.INIT_ALGORITHM, - setInfo: new Uint8Array([0]) -}).catch((err) => { - if (err) { - console.log("setProperty failed, error: " + JSON.stringify(err)); - } else { - console.log("setProperty successfully"); - } -}); -``` - -The following uses **registerInputer** as an example for synchronous APIs: - -``` -import account_osAccount from "@ohos.account.osAccount" -let pinAuth = new account_osAccount.PINAuth() -let inputer = { - onGetData: (authType, passwordRecipient) => { - let password = new Uint8Array([0]); - passwordRecipient.onSetData(authType, password); - } -} -try { - pinAuth.registerInputer(inputer); -} catch (err) { - console.log("registerInputer failed, error: " + JSON.stringify(err)); -} -``` - -## cl.account_os_account.2 ACTION Definition Change for the Application Account Authentication Service - -**Change Impacts** - -For the application developed based on an earlier version, you need to modify **ACTION** in the application configuration file (**config.json** for the FA model and **module.json5** for the Stage model) to normally provide the application authentication service. - -**Key API/Component Changes** - -Involved constant: - -@ohos.ability.wantConstant.ACTION_APP_ACCOUNT_AUTH - -Before change: - -ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth" - -After change: - -ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth" - -**Adaptation Guide** - -For a third-party application providing the account authentication service, adapt the changed application account authentication **ACTION** in the **ServiceAbility** configuration file (**config.json** for the FA module or **module.json5** for the Stage module). -``` -"abilities": [ - { - "name": "ServiceAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - ... - "visible": true, - "skills": { - { - "actions": [ - "ohos.appAccount.action.auth" - ] - } - } - }] -} diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md deleted file mode 100644 index 311b1a90b716a22e151625ab990e73dbf3249f02..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md +++ /dev/null @@ -1,21 +0,0 @@ -# Distributed Scheduler Subsystem ChangeLog - -## cl.DistributedManagerService.1 Adding DATASYNC Permission Verification on the continuationManager API - -In earlier versions, the **continuationManager** API does not verify the caller, which does not comply with the OpenHarmony API specifications. -Now, before using **continuationManager**, the caller must apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission. - -**Change Impacts** - -The application developed based on earlier versions needs to apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission in advance. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -Involved APIs: - - - continuationManager.registerContinuation; - - continuationManager.on; - - continuationManager.off; - - continuationManager.unregisterContinuation; - - continuationManager.updateContinuationState; - - continuationManager.startContinuationDeviceManager; diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-x-x.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-x-x.md deleted file mode 100644 index 3ac3e83268d2ac247676cd313d5b5e45d195ea2b..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-x-x.md +++ /dev/null @@ -1,33 +0,0 @@ -# *Example* Subsystem ChangeLog - -Changes that affect contract compatibility of the last version should be described in the ChangeLog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. - -## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) - -Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of ChangeLog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). - -Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. - -If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. - -**Change Impacts** - -Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. - -Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. - -**Key API/Component Changes** - -List the API/component changes involved in the function change. - -**Adaptation Guide (Optional)** - -Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. - -Example: - -Change parameter *n* to *m* in the *a* file. - -``` -sample code -``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelogs-useriam.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelogs-useriam.md deleted file mode 100644 index b1011149ce89079e6e45212f0d1631794c406742..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelogs-useriam.md +++ /dev/null @@ -1,35 +0,0 @@ -# User IAM Subsystem Changelog - -## cl.useriam.1 Deletion of API9 GetVesion - -Deleted the **GetVersion()** API. - -**Change Impact** - -The **GetVersion()** API cannot be used from this version. - -**Key API/Component Changes** - -| Module | Class | Method/Attribute/Enum/Constant | Change Type | -| ---------------------- | ------------------- | ------------------------- | ------------------------ | -| ohos.userIAM.userAuth | function | getVersion() : number | Deleted| - -**Adaptation Guide** - -Delete the use of **GetVersion()**. - -## cl.useriam.2 Change of the API8 GetVesion() Return Value - -Changed the return value of **GetVersion()** (in API version 8) from **0** to **1**. - -**Change Impact** - -If the application verifies the return value of **GetVersion()** (API version 8), the verification fails. - -**Key API/Component Changes** - -The return value of **GetVersion()** (in API version 8) is changed from **0** to **1**. - -**Adaptation Guide** - -Delete the use of **GetVersion()** (API version 8) because this API has been deprecated. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-account_os_account.md deleted file mode 100644 index 22a1dad1ce6387f0a05697738e9dc688cc8c869c..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.1.1/changelogs-account_os_account.md +++ /dev/null @@ -1,19 +0,0 @@ -# Account Subsystem ChangeLog - -## cl.account_os_account.1 Expansion of Distributed Account Nickname and Profile Picture Specifications - -The existing distributed account nickname and profile picture specifications cannot meet requirements in scenarios where the nickname is long and profile picture is large. - -Therefore, the distributed account nickname and profile picture specifications are expanded. - -**Change Impacts** - -The API change is forward compatible. Applications developed based on earlier versions can use the APIs in accordance with the new specifications, without affecting the original logic. - -**Key API/Component Changes** - -Before change: - - The nickname cannot exceed 20 characters, and the profile picture size cannot exceed 3 MB. - -After change: - - The nickname cannot exceed 1024 characters, and the profile picture size cannot exceed 10 MB. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.1.5/changelogs-geoLocationManager.md b/en/release-notes/changelogs/OpenHarmony_4.0.1.5/changelogs-geoLocationManager.md deleted file mode 100644 index f5a4b46a2b9632aa012cb38fe3555efd80b82b92..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.1.5/changelogs-geoLocationManager.md +++ /dev/null @@ -1,18 +0,0 @@ -# Location Subsystem ChangeLog - -## cl.location.1 Deletion of the geoLocationManager.requestEnableLocation API in API Version 9 - -When the location function is disabled, your application can call the **geoLocationManager.requestEnableLocation** API to request the user to enable the location function. However, this API is seldom used because the user is not notified of the scenario in which your application uses the location information. - -Therefore, your application shows a popup, asking the user to go to the settings page and enable the location function. In addition, the popup clearly states the scenarios in which the location information will be used, improving user experience. - -**Change Impacts** - -Your application cannot use the **geoLocationManager.requestEnableLocation** API in API version 9 to request the user to enable the location function. Instead, you need to implement a popup asking the user to enable the location function for your application. - -**Key API/Component Changes** - -| Class | API Type| Declaration | Change Type | -| ------------------ | -------- | ------------------------------------------------------------ | ------------------ | -| geoLocationManager | method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | Deleted from API version 9| -| geoLocationManager | method | function requestEnableLocation(): Promise<boolean>; | Deleted from API version 9| diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.1.5/changelogs-wifiManager.md b/en/release-notes/changelogs/OpenHarmony_4.0.1.5/changelogs-wifiManager.md deleted file mode 100644 index f424d69976a74e00b8aab625c5d24b8dfc72c99a..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.1.5/changelogs-wifiManager.md +++ /dev/null @@ -1,62 +0,0 @@ -# Wi-Fi Subsystem ChangeLog - -## cl.location.1 Location Service Permission Change - -From API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is added for obtaining the approximate location. - -If you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail. - -**Change Impacts** - -Applications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows: - -Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user as described below. - -The system provides the following location permissions: - -- ohos.permission.LOCATION - -- ohos.permission.APPROXIMATELY_LOCATION - -- ohos.permission.LOCATION_IN_BACKGROUND - -If your application needs to access the device location information, it must first apply for required permissions. Specifically speaking: - -API versions earlier than 9: Apply for **ohos.permission.LOCATION**. - -API version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, or apply for **ohos.permission.APPROXIMATELY_LOCATION** and **ohos.permission.LOCATION**. Note that **ohos.permission.LOCATION** cannot be applied for separately. - -| API Version| Location Permission | Permission Application Result| Location Accuracy | -| ------------- | ------------------------------------------------------------ | -------- | -------------------------------- | -| Earlier than 9 | ohos.permission.LOCATION | Success | Location accurate to meters| -| 9 and later | ohos.permission.LOCATION | Failure | No location obtained | -| 9 and later | ohos.permission.APPROXIMATELY_LOCATION | Success | Location accurate to 5 kilometers | -| 9 and later | ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success | Location accurate to meters| - -If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background. - -You can declare the required permissions in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md). - -**Key API/Component Changes** - -| Class | API Type| Declaration | Change Type | -| ----------- | -------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| wifiManager | method | function scan(): void; | The permission is changed to **ohos.permission.SET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getScanResults(): Promise<Array<WifiScanInfo>>; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getScanResultsSync(): Array<WifiScanInfo>; | The permission is changed to **ohos.permission.GET_WIFI_INFO** and **ohos.permission.GET_WIFI_PEERS_MAC** or **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getCandidateConfigs(): Array<WifiDeviceConfig>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getDeviceConfigs(): Array<WifiDeviceConfig>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, **ohos.permission.APPROXIMATELY_LOCATION**, and **ohos.permission.GET_WIFI_CONFIG**.| -| wifiManager | method | function getStations(): Array<StationInfo>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, **ohos.permission.APPROXIMATELY_LOCATION**, and **ohos.permission.MANAGE_WIFI_HOTSPOT**.| -| wifiManager | method | function getCurrentGroup(): Promise<WifiP2pGroupInfo>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getP2pPeerDevices(): Promise<WifiP2pDevice[]>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function p2pConnect(config: WifiP2PConfig): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function startDiscoverDevices(): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function on(type: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function off(type: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): void; | The permission is changed to **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void; | The permission is changed to **ohos.permission.GET_WIFI_INFO**, **ohos.permission.LOCATION**, and **ohos.permission.APPROXIMATELY_LOCATION**.| -| wifiManager | method | function off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): void; | The permission is changed to **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION**.| diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelog-web.md deleted file mode 100644 index 254050b5104e769b4b4e44d6bbee8d13876d37db..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelog-web.md +++ /dev/null @@ -1,65 +0,0 @@ -# Web Subsystem ChangeLog - -Compared with earlier versions, OpenHarmony 4.0.2.1 has the following API changes in its Web subsystem: - -## cl.web.1 Parameter Type Change of postMessageEvent - -The **postMessageEvent** API supported only the string type. In OpenHarmony 4.0.2.1 and later versions, it also supports the ArrayBuffer type. - -**Change Impacts** - -The API change is forward compatible. Applications developed based on earlier versions can still use the API, and the original functions are not affected. - -**Key API/Component Changes** - -- Involved APIs - - postMessageEvent(message: string): void - -- Before change - - ```ts - postMessageEvent(message: string): void - ``` - -- After change - - ```ts - type WebMessage = ArrayBuffer | string - postMessageEvent(message: WebMessage): void - ``` - -**Adaptation Guide** - -The API change is forward compatible. Applications developed based on earlier versions can still use the API, and the original functions are not affected. - -## cl.web.2 Parameter Type Change of onMessageEvent - -The **onMessageEvent** API supported only the string type. In OpenHarmony 4.0.2.1 and later versions, it also supports the ArrayBuffer type. - -**Change Impacts** - -The API change is forward compatible. Applications developed based on earlier versions can still use the API. With the corresponding logic handling added, the original functions are not affected. - -**Key API/Component Changes** - -- Involved APIs - - onMessageEvent(callback: (result: string) => void): void - -- Before change - - ```ts - onMessageEvent(callback: (result: string) => void): void - ``` - -- After change - - ```ts - type WebMessage = ArrayBuffer | string - onMessageEvent(callback: (result: WebMessage) => void): void - ``` - -**Adaptation Guide** - -The API change is forward compatible. Applications developed based on earlier versions can still use the API. With the corresponding logic handling added, the original functions are not affected. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md deleted file mode 100644 index 773d4439728d3c25369d47e384120d7beb543618..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-ability.md +++ /dev/null @@ -1,140 +0,0 @@ -# Ability Subsystem ChangeLog - -## cl.ability.1 System API Usage Rule Change - -System application verification is not performed for system APIs provided by the ability when they are called. The APIs can be used by a third-party application using the full SDK, which brings security risks. Therefore, application identity verification is added to OpenHarmony 4.0.2.1 and later versions. - -**Change Impacts** - -System APIs are available to only system applications. When a third-party application tries to use a system API, the **202** error will be returned via either an exception or asynchronous callback. - -**Key API/Component Changes** - -Below are the system APIs. - -| Module | API | Error Code Return Mode| -| -------------------------------------- | ------------------------------------------------------------ | -------------- | -| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration): Promise | Asynchronous callback | -| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(): Promise> | Asynchronous callback | -| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number): Promise> | Asynchronous callback | -| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.ability.abilityManager.d.ts | getTopAbility(): Promise | Exception | -| @ohos.app.ability.abilityManager.d.ts | getTopAbility(callback: AsyncCallback): void | Exception | -| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver): number | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array): number | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number): Promise | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | getForegroundApplications(callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | getForegroundApplications(): Promise> | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number): Promise | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string): Promise | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string, callback: AsyncCallback) | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string): Promise | Asynchronous callback | -| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string, callback: AsyncCallback) | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | on(type: "mission", listener: MissionListener): number | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number): Promise> | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | clearAllMissions(callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | clearAllMissions(): Promise | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options?: StartOptions): Promise | Asynchronous callback | -| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array): Promise | Asynchronous callback | -| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string): Promise | Asynchronous callback | -| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | deleteForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | deleteForm(formId: string): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache?: boolean): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | requestForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | requestForm(formId: string): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | isSystemReady(callback: AsyncCallback): void | Exception | -| @ohos.app.form.formHost.d.ts | isSystemReady(): Promise | Exception | -| @ohos.app.form.formHost.d.ts | getAllFormsInfo(callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | getAllFormsInfo(): Promise> | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName?: string): Promise> | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | on(type: "formUninstall", callback: Callback): void | Exception | -| @ohos.app.form.formHost.d.ts | off(type: "formUninstall", callback?: Callback): void | Exception | -| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array, isVisible: boolean): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string): Promise | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise | Asynchronous callback | -| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise | Asynchronous callback | -| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(callback: AsyncCallback): void | Exception | -| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(): Promise | Exception | -| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | Asynchronous callback | -| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Exception | -| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | Exception | -| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | Exception | -| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want): Promise | Asynchronous callback | -| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | -| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want): Promise | Asynchronous callback | -| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | -| UIAbilityContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | Asynchronous callback | -| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void | Asynchronous callback | -| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap): Promise | Asynchronous callback | -| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | Asynchronous callback | -| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | Asynchronous callback | -| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want): Promise | Asynchronous callback | -| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | -| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want): Promise | Asynchronous callback | -| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | Asynchronous callback | -| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | Asynchronous callback | -| ServiceExtensionContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | Asynchronous callback | -| Context.d.ts | createBundleContext(bundleName: string): Context | Exception | -| Context.d.ts | createModuleContext(bundleName: string, moduleName: string): Context | Exception | -| FormExtensionContext.d.ts | startAbility(want: Want, callback: AsyncCallback): void | Asynchronous callback | -| FormExtensionContext.d.ts | startAbility(want: Want): Promise | Asynchronous callback | diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-bluetooth.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-bluetooth.md deleted file mode 100644 index 46cabda38dd35234da3b29b6e3a891fcee63dd56..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-bluetooth.md +++ /dev/null @@ -1,173 +0,0 @@ -# Bluetooth Subsystem ChangeLog - -## cl.bluetooth.1 API Migration to @ohos.bluetoothManager.d.ts - -**@ohos.bluetooth.d.ts** does not allow for throwing error codes, which is required by API version 9 and system APIs. Therefore, all APIs of **@ohos.bluetooth.d.ts** are migrated to the newly added **@ohos.bluetoothManager.d.ts**, and error code description is also added. - -To use Bluetooth APIs, import **@ohos.bluetoothManager**. - - ```ts - import bluetoothManager from '@ohos.bluetoothManager'; - ``` - - -**Change Impacts** - -System APIs and APIs in API version 9 are affected. Import **@ohos.bluetoothManager** to use APIs that can throw error codes. - - ```ts - import bluetoothManager from '@ohos.bluetoothManager'; - ``` - -**Key API/Component Changes** - -| Class | Original API | New API | Change Type | -| ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| bluetooth | function getState(): BluetoothState | function getState(): BluetoothState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | method | function getBtConnectionState(): ProfileConnectionState; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function pairDevice(deviceId: string): boolean | function pairDevice(deviceId: string): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function cancelPairedDevice(deviceId: string): boolean | function cancelPairedDevice(deviceId: string): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function getRemoteDeviceName(deviceId: string): string | function getRemoteDeviceName(deviceId: string): string | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function getRemoteDeviceClass(deviceId: string): DeviceClass | function getRemoteDeviceClass(deviceId: string): DeviceClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function enableBluetooth(): boolean | function enableBluetooth(): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function disableBluetooth(): boolean | function disableBluetooth(): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function getLocalName(): string | function getLocalName(): string | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function getPairedDevices(): Array<string>; | function getPairedDevices(): Array<string>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function getProfileConnState(profileId: ProfileId): ProfileConnectionState | function getProfileConnectionState(profileId: ProfileId): ProfileConnectionState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the API name to **getProfileConnectionState**.| -| bluetooth | function setDevicePairingConfirmation(device: string, accept: boolean): boolean | function setDevicePairingConfirmation(device: string, accept: boolean): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function setLocalName(name: string): boolean; | function setLocalName(name: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function setBluetoothScanMode(mode: ScanMode, duration: number): boolean | function setBluetoothScanMode(mode: ScanMode, duration: number): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function getBluetoothScanMode(): ScanMod | function getBluetoothScanMode(): ScanMode | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function startBluetoothDiscovery(): boolean | function startBluetoothDiscovery(): void | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**, added the **ohos.permission.APPROXIMATELY_LOCATION** permission, and changed the return value to **void**.| -| bluetooth | function stopBluetoothDiscovery(): boolean; | function stopBluetoothDiscovery(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function on(type: "bondStateChange", callback: Callback<BondStateParam>): void; | function on(type: "bondStateChange", callback: Callbackk<BondStateParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; | function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; | function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function sppCloseServerSocket(socket: number): void; | function sppCloseServerSocket(socket: number): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function sppCloseClientSocket(socket: number): void; | function sppCloseClientSocket(socket: number): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | function sppWrite(clientSocket: number, data: ArrayBuffer): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| bluetooth | function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void; | function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void; | function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | -| bluetooth | function getProfileInst(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | -| BaseProfile | getConnectionDevices(): Array<string>; | getConnectionDevices(): Array<string>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BaseProfile | getDeviceState(device: string): ProfileConnectionState; | getDeviceState(device: string): ProfileConnectionState; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| A2dpSourceProfile | connect(device: string): boolean; | connect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| A2dpSourceProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| A2dpSourceProfile | getPlayingState(device: string): PlayingState; | getPlayingState(device: string): PlayingState; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| HandsFreeAudioGatewayProfile | connect(device: string): boolean; | connect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| HandsFreeAudioGatewayProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| HidHostProfile | connect(device: string): boolean; | connect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| HidHostProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| HidHostProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| HidHostProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| PanProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| PanProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| PanProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| PanProfile | setTethering(enable: boolean): void; | setTethering(enable: boolean): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| PanProfile | isTetheringOn(): boolean; | isTetheringOn(): boolean; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BLE | function createGattServer(): GattServer; | function createGattServer(): GattServer; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BLE | function createGattClientDevice(deviceId: string): GattClientDevice; | function createGattClientDevice(deviceId: string): GattClientDevice; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BLE | function getConnectedBLEDevices(): Array<string>; | function getConnectedBLEDevices(): Array<string>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BLE | function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; | function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and added the **ohos.permission.APPROXIMATELY_LOCATION** permission.| -| BLE | function stopBLEScan(): void; | function stopBLEScan(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BLE | mefunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;thod | function on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| BLE | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | stopAdvertising(): void; | stopAdvertising(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | addService(service: GattService): boolean; | addService(service: GattService): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| GattServer | removeService(serviceUuid: string): boolean; | removeService(serviceUuid: string): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**.| -| GattServer | close(): void; | close(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. -| GattServer | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattServer | sendResponse(serverResponse: ServerResponse): boolean; | sendResponse(serverResponse: ServerResponse): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattServer | on(type: "characteristicRead", callback: Callback<CharacteristicReadReq>): void; | on(type: "characteristicRead", callback: Callback<CharacteristicReadRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | off(type: "characteristicRead", callback?: Callback<CharacteristicReadReq>): void; | off(type: "characteristicRead", callback?: Callback<CharacteristicReadRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteReq>): void; | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteReq>): void; | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | on(type: "descriptorRead", callback: Callback<DescriptorReadReq>): void; | on(type: "descriptorRead", callback: Callback<DescriptorReadRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | off(type: "descriptorRead", callback?: Callback<DescriptorReadReq>): void; | off(type: "descriptorRead", callback?: Callback<DescriptorReadRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | on(type: "descriptorWrite", callback: Callback<DescriptorWriteReq>): void; | on(type: "descriptorWrite", callback: Callback<DescriptorWriteRequest>): void;| Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteReq>): void; | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteRequest>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;| Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattServer | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | connect(): boolean; | connect(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | disconnect(): boolean; | disconnect(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | close(): boolean; | close(): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | getDeviceName(callback: AsyncCallback<string>): void; | getDeviceName(callback: AsyncCallback<string>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | getDeviceName(): Promise<string>; | getDeviceName(): Promise<string>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | getServices(callback: AsyncCallback<Array<GattService>>): void; | getServices(callback: AsyncCallback<Array<GattService>>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | getServices(): Promise<Array<GattService>>; | getServices(): Promise<Array<GattService>>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | writeCharacteristicValue(characteristic: BLECharacteristic): boolean; | writeCharacteristicValue(characteristic: BLECharacteristic): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | writeDescriptorValue(descriptor: BLEDescriptor): boolean; | writeDescriptorValue(descriptor: BLEDescriptor): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | getRssiValue(callback: AsyncCallback<number>): void; | getRssiValue(callback: AsyncCallback<number>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | getRssiValue(): Promise<number>; | getRssiValue(): Promise<number>; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | setBLEMtuSize(mtu: number): boolean; | setBLEMtuSize(mtu: number): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts** and changed the return value to **void**. | -| GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | GattService | GattService | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | BLECharacteristic | BLECharacteristic | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | BLEDescriptor | BLEDescriptor | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | NotifyCharacteristic | NotifyCharacteristic | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | CharacteristicReadReq | CharacteristicReadRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | CharacteristicWriteReq | CharacteristicWriteRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | DescriptorReadRe | DescriptorReadRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | DescriptorWriteReq | DescriptorWriteRequest | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ServerResponse | ServerResponse | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | BLEConnectChangedState | BLEConnectChangedState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ScanResult | ScanResult | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | AdvertiseSetting | AdvertiseSetting | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | AdvertiseData | AdvertiseData | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ManufactureData | ManufactureData | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ServiceData | ServiceData | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ScanFilter | ScanFilter | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ScanOptions | ScanOptions | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | SppOption | SppOption | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | PinRequiredParam | PinRequiredParam | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | DeviceClass | DeviceClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | BondStateParam | BondStateParam | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | StateChangeParam | StateChangeParam | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ScanDuty | ScanDuty | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | MatchMode | MatchMode | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ProfileConnectionState | ProfileConnectionState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | BluetoothState | BluetoothState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | SppType | SppType | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ScanMode | ScanMode | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | BondState | BondState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | MajorClass | MajorClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | MajorMinorClass | MajorMinorClass | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | PlayingState | PlayingState | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | -| bluetooth | ProfileId | ProfileId | Migrated this API in API version 9 to **@ohos.bluetoothManager.d.ts**. | - - - -**(Optional) Adaptation Guide** - -The following uses **enableLocation** as an example to show how it is called in the new version: - - ```ts - import bluetoothManager from '@ohos.bluetoothManager'; - try { - var state = bluetoothManager.getState(); - } catch (err) { - console.error("errCode:" + err.code + ",errMessage:" + err.message); - } - ``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-distributeddatamgr.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-distributeddatamgr.md deleted file mode 100644 index 91eff5aaba224372581f5e3a8165f7382216c7c2..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-distributeddatamgr.md +++ /dev/null @@ -1,48 +0,0 @@ -# Distributed Data Management Subsystem JS API Changelog - -## cl.distributeddatamgr.1 API Change -Changed the **relationalStore** APIs of the distributed data management (distributeddatamgr) subsystem. - -Before change: -After **getRdbStore()** is called, the application determines whether the RDB store is newly created based on the **openStatus** attribute (openStatus == ON_CREATE) of the returned **rdbStore** object. -After change: -After **getRdbStore()** is called, the application determines whether the RDB store is newly created based on the **version** attribute (version == 0) of the returned **rdbStore** object. - -You need to adapt your application. - - **Change Impact** - -The JS APIs of API version 10 are affected and need to be changed accordingly. Otherwise, certain functions cannot be properly implemented in the SDK of the new version. - -**Key API/Component Changes** - -| Module | Class | Method/Attribute/Enum/Constant| Change Type| -| ------------------------------ | --------------- | ---------------- | ------- | -| @ohos.data.relationalStore | RdbStore | **openStatus: number;** is changed to **version: number;**.| Changed | - - -**Adaptation Guide** - -Refer to the following code to set or obtain the RDB store version for an application: - -```ts -const STORE_CONFIG = { - name: "rdbstore.db", - securityLevel: data_rdb.SecurityLevel.S1 -} -data_rdb.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) { - // Before: - // if (rdbStore.openStatus == ON_CREATE) { - // rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx - // } - - // Now: - if (rdbStore.version == 0) { - rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx - // Set the RDB store version, which is a positive integer greater than 0. - rdbStore.version == 3 - } - // Obtain the RDB store version. - console.info("Get RdbStore version is " + rdbStore.version) -}) -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-filemanagement.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-filemanagement.md deleted file mode 100644 index 2e4e9981788e07f1f41bef6c579898fe649c7368..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-filemanagement.md +++ /dev/null @@ -1,145 +0,0 @@ -# File Management Subsystem ChangeLog - -## cl.filemanagement.1 Changed environment - -The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **environment** module supports error code processing. - -**Change Impacts** - -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. The **environment** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. - -**Key API/Component Changes** - -Before the change, **environment** was imported using **@ohos.environment**: - -```js -import environment from '@ohos.environment'; -``` - -But now, **environment** is imported using **@ohos.file.environment**: - -```js -import environment from '@ohos.file.environment'; -``` - -## cl.filemanagement.2 Changed securityLabel - -The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **securityLabel** module supports error code processing. - -**Change Impacts** - -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. The **securityLabel** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. - -**Key API/Component Changes** - -Before the change, **securityLabel** was imported using **@ohos.securityLabel**: - -```js -import securityLabel from '@ohos.securityLabel'; -``` - -But now, **securityLabel** is imported using **@ohos.file.securityLabel**: - -```js -import securityLabel from '@ohos.file.securityLabel'; -``` - -## cl.filemanagement.3 Changed fs - -The **ino** attribute type of the **Stat** API under the **fs** module is changed. - -**Change Impacts** - -The **ino** attribute type is changed from number to BigInt, to adapt the inode range of all types of files in the file system. - -**Key API/Component Changes** - -The type of the **ino** attribute of the **Stat** API is changed from number to BigInt. - -## cl.filemanagement.4 Changed fileAccess - -The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **fileAccess** module supports error code processing. - -**Change Impacts** - -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. The **fileAccess** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. - -**Key API/Component Changes** - -Before the change, **fileAccess** was imported using **@ohos.data.fileAccess**: - -```js -import fileAccess from '@ohos.data.fileAccess'; -``` - -But now, **fileAccess** is imported using **@ohos.file.fileAccess**: - -```js -import fileAccess from '@ohos.file.fileAccess'; -``` - -## cl.filemanagement.5 Changed fileExtensionInfo - -The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **fileExtensionInfo** module supports error code processing. - -**Change Impacts** - -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. The **fileExtensionInfo** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. - -**Key API/Component Changes** - -Before the change, **fileExtensionInfo** was imported using **@ohos.fileExtensionInfo**: - -```js -import fileExtensionInfo from '@ohos.fileExtensionInfo'; -``` - -But now, **fileExtensionInfo** is imported using **@ohos.file.fileExtensionInfo**: - -```js -import fileExtensionInfo from '@ohos.file.fileExtensionInfo'; -``` - -## cl.filemanagement.6 Changed storageStatistics - -The file management subsystem **d.ts** file has been archived and moved to the **file** directory. The **fileExtensionInfo** module supports error code processing. - -**Change Impacts** - -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. The **storageStatistics** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. - -**Key API/Component Changes** - -Before the change, **storageStatistics** was imported using **@ohos.storageStatistics**: - -```js -import storageStatistics from '@ohos.storageStatistics'; -``` - -But now, **storageStatistics** is imported using **@ohos.file.storageStatistics**: - -```js -import storageStatistics from '@ohos.file.storageStatistics'; -``` - -## cl.filemanagement.7 Changed volumeManager - -The file management subsystem **d.ts** file has been archived moved to the **file** directory. The **volumeManager** module supports error code processing. - -**Change Impacts** - -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. The **volumeManager** module supports error code processing. See [adaptation instructions](../OpenHarmony_3.2.8.1/changelogs-filemanagement.md) for more details. - -**Key API/Component Changes** - -Before the change, **volumeManager** was imported using **@ohos.volumeManager**: - -```js -import volumeManager from '@ohos.volumeManager'; -``` - -But now, **volumeManager** is imported using **@ohos.file.volumeManager**: - -```js -import volumeManager from '@ohos.file.volumeManager'; -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-global.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-global.md deleted file mode 100644 index 7192f94cba5682b78cd477953ed521bc42434609..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-global.md +++ /dev/null @@ -1,41 +0,0 @@ -# Globalization Subsystem ChangeLog - -## cl.global.1 Runtime Authentication Added for System APIs - -The internationalization component of the globalization subsystem adds runtime authentication for system APIs in certain scenarios. The following changes are made in API version 9 and later: - - Setting the system language, country or region, and area - - Setting the 24-hour format of the system - - Adding and removing the preferred language - - Setting localized numbers - -You need to adapt your application based on the following information. - -**Change Impacts** - -APIs involved in the preceding scenarios can be properly called only by system applications that have the **UPDATE_CONFIGURATION** permission. - -**Key API/Component Changes** - - - Involved APIs: - - setSystemLanguage(language: string): void; - - setSystemRegion(region: string): void; - - setSystemLocale(locale: string): void; - - set24HourClock(option: boolean): void; - - addPreferredLanguage(language: string, index?: number): void; - - removePreferredLanguage(index: number): void; - - setUsingLocalDigit(flag: boolean): void; - -**Adaptation Guide** - -Make sure the application trying to call any of the above APIs is a system application. Non-system applications are not allowed to call the APIs. -An exception will be thrown upon lack of a necessary permission or a call request from a non-system application. The exception can be captured via **try-catch**. - -```js -import I18n from '@ohos.i18n' - -try { - I18n.System.setSystemLanguage('zh'); -} catch(error) { - console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`) -} -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md deleted file mode 100644 index 01455e8774555943174a21a80f343b607a4a0069..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-media.md +++ /dev/null @@ -1,314 +0,0 @@ -# Media Subsystem ChangeLog - -## cl.media.1 API Change of the Playback Function - -Added the [AVPlayer](../../../application-dev/reference/apis/js-apis-media.md#avplayer9)9+ API for audio and video playback, with the updated state machine and error codes, which is recommended. The following APIs for audio playback and video playback are no longer maintained: [AudioPlayer](../../../application-dev/reference/apis/js-apis-media.md#audioplayer)6+ and [VideoPlayer](../../../application-dev/reference/apis/js-apis-media.md#videoplayer)8+. - -**Change Impacts** - -The original APIs can still be used but are no longer maintained. You are advised to use the new API instead. - -**Key API/Component Changes** - -Added APIs - -| Class | Declaration | -| -------------- | ------------------------------------------------------------ | -| media | createAVPlayer(callback: AsyncCallback\): void | -| media | createAVPlayer() : Promise\ | -| media.AVPlayer | interface AVPlayer | -| media.AVPlayer | videoScaleType ?: VideoScaleType | -| media.AVPlayer | url ?: string | -| media.AVPlayer | surfaceId ?: string | -| media.AVPlayer | stop(callback: AsyncCallback\): void | -| media.AVPlayer | stop(): Promise\ | -| media.AVPlayer | setVolume(volume: number): void | -| media.AVPlayer | setSpeed(speed: PlaybackSpeed): void | -| media.AVPlayer | setBitrate(bitrate: number): void | -| media.AVPlayer | seek(timeMs: number, mode?:SeekMode): void | -| media.AVPlayer | reset(callback: AsyncCallback\): void | -| media.AVPlayer | reset(): Promise\ | -| media.AVPlayer | release(callback: AsyncCallback\): void | -| media.AVPlayer | release(): Promise\ | -| media.AVPlayer | readonly width: number | -| media.AVPlayer | readonly state: AVPlayerState | -| media.AVPlayer | readonly height: number | -| media.AVPlayer | readonly duration: number | -| media.AVPlayer | readonly currentTime: number | -| media.AVPlayer | prepare(callback: AsyncCallback\): void | -| media.AVPlayer | prepare(): Promise\ | -| media.AVPlayer | play(callback: AsyncCallback\): void | -| media.AVPlayer | play(): Promise\ | -| media.AVPlayer | pause(callback: AsyncCallback\): void | -| media.AVPlayer | pause(): Promise\ | -| media.AVPlayer | on(type: 'volumeChange', callback: Callback\): void | -| media.AVPlayer | on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void | -| media.AVPlayer | on(type: 'timeUpdate', callback: Callback\): void | -| media.AVPlayer | on(type: 'stateChange', callback: (state: AVPlayerState, reason: StateChangeReason) => void): void | -| media.AVPlayer | on(type: 'startRenderFrame', callback: Callback\): void | -| media.AVPlayer | on(type: 'speedDone', callback: Callback\): void | -| media.AVPlayer | on(type: 'seekDone', callback: Callback\): void | -| media.AVPlayer | on(type: 'error', callback: ErrorCallback): void | -| media.AVPlayer | on(type: 'endOfStream', callback: Callback\): void | -| media.AVPlayer | on(type: 'durationUpdate', callback: Callback\): void | -| media.AVPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | -| media.AVPlayer | on(type: 'bitrateDone', callback: Callback\): void | -| media.AVPlayer | on(type: 'availableBitrates', callback: (bitrates: Array\) => void): void | -| media.AVPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | -| media.AVPlayer | off(type: 'volumeChange'): void | -| media.AVPlayer | off(type: 'videoSizeChange'): void | -| media.AVPlayer | off(type: 'timeUpdate'): void | -| media.AVPlayer | off(type: 'stateChange'): void | -| media.AVPlayer | off(type: 'startRenderFrame'): void | -| media.AVPlayer | off(type: 'speedDone'): void | -| media.AVPlayer | off(type: 'seekDone'): void | -| media.AVPlayer | off(type: 'error'): void | -| media.AVPlayer | off(type: 'endOfStream'): void | -| media.AVPlayer | off(type: 'durationUpdate'): void | -| media.AVPlayer | off(type: 'bufferingUpdate'): void | -| media.AVPlayer | off(type: 'bitrateDone'): void | -| media.AVPlayer | off(type: 'availableBitrates'): void | -| media.AVPlayer | off(type: 'audioInterrupt'): void | -| media.AVPlayer | loop: boolean | -| media.AVPlayer | getTrackDescription(callback: AsyncCallback\>): void | -| media.AVPlayer | getTrackDescription() : Promise\> | -| media.AVPlayer | fdSrc ?: AVFileDescriptor | -| media.AVPlayer | audioInterruptMode ?: audio.InterruptMode | -| unnamed | type AVPlayerState = 'idle' \| 'initialized' \| 'prepared' \| 'playing' \| 'paused' \| 'completed' \| 'stopped' \| 'released' \| 'error' | - -APIs no longer maintained - -| Class | Declaration | -| ----------------- | ------------------------------------------------------------ | -| media | createVideoPlayer(callback: AsyncCallback\): void | -| media | createVideoPlayer() : Promise\ | -| media | createAudioPlayer(): AudioPlayer | -| media.AudioPlayer | interface AudioPlayer | -| media.AudioPlayer | play(): void | -| media.AudioPlayer | release(): void | -| media.AudioPlayer | audioInterruptMode ?: audio.InterruptMode | -| media.AudioPlayer | fdSrc: AVFileDescriptor | -| media.AudioPlayer | seek(timeMs: number): void | -| media.AudioPlayer | readonly duration: number | -| media.AudioPlayer | loop: boolean | -| media.AudioPlayer | readonly state: AudioState | -| media.AudioPlayer | getTrackDescription(callback: AsyncCallback\>): void | -| media.AudioPlayer | getTrackDescription() : Promise\> | -| media.AudioPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | -| media.AudioPlayer | on(type: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange', callback: () => void): void | -| media.AudioPlayer | on(type: 'timeUpdate', callback: Callback\): void | -| media.AudioPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | -| media.AudioPlayer | on(type: 'error', callback: ErrorCallback): void | -| media.AudioPlayer | setVolume(vol: number): void | -| media.AudioPlayer | pause(): void | -| media.AudioPlayer | readonly currentTime: number | -| media.AudioPlayer | stop(): void | -| media.AudioPlayer | reset(): void | -| media.AudioPlayer | src: string | -| media.VideoPlayer | interface VideoPlayer | -| media.VideoPlayer | play(callback: AsyncCallback\): void | -| media.VideoPlayer | play(): Promise\ | -| media.VideoPlayer | prepare(callback: AsyncCallback\): void | -| media.VideoPlayer | prepare(): Promise\ | -| media.VideoPlayer | release(callback: AsyncCallback\): void | -| media.VideoPlayer | release(): Promise\ | -| media.VideoPlayer | audioInterruptMode ?: audio.InterruptMode | -| media.VideoPlayer | fdSrc: AVFileDescriptor | -| media.VideoPlayer | seek(timeMs: number, callback: AsyncCallback\): void | -| media.VideoPlayer | seek(timeMs: number, mode:SeekMode, callback: AsyncCallback\): void | -| media.VideoPlayer | seek(timeMs: number, mode?:SeekMode): Promise\ | -| media.VideoPlayer | readonly duration: number | -| media.VideoPlayer | loop: boolean | -| media.VideoPlayer | videoScaleType ?: VideoScaleType | -| media.VideoPlayer | readonly state: VideoPlayState | -| media.VideoPlayer | getTrackDescription(callback: AsyncCallback\>): void | -| media.VideoPlayer | getTrackDescription() : Promise\> | -| media.VideoPlayer | readonly height: number | -| media.VideoPlayer | on(type: 'playbackCompleted', callback: Callback\): void | -| media.VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | -| media.VideoPlayer | on(type: 'startRenderFrame', callback: Callback\): void | -| media.VideoPlayer | on(type: 'videoSizeChanged', callback: (width: number, height: number) => void): void | -| media.VideoPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | -| media.VideoPlayer | on(type: 'error', callback: ErrorCallback): void | -| media.VideoPlayer | setDisplaySurface(surfaceId: string, callback: AsyncCallback\): void | -| media.VideoPlayer | setDisplaySurface(surfaceId: string): Promise\ | -| media.VideoPlayer | setVolume(vol: number, callback: AsyncCallback\): void | -| media.VideoPlayer | setVolume(vol: number): Promise\ | -| media.VideoPlayer | url: string | -| media.VideoPlayer | pause(callback: AsyncCallback\): void | -| media.VideoPlayer | pause(): Promise\ | -| media.VideoPlayer | readonly currentTime: number | -| media.VideoPlayer | setSpeed(speed:number, callback: AsyncCallback\): void | -| media.VideoPlayer | setSpeed(speed:number): Promise\ | -| media.VideoPlayer | stop(callback: AsyncCallback\): void | -| media.VideoPlayer | stop(): Promise\ | -| media.VideoPlayer | readonly width: number | -| media.VideoPlayer | reset(callback: AsyncCallback\): void | -| media.VideoPlayer | reset(): Promise\ | -| unnamed | type AudioState = 'idle' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | -| unnamed | type VideoPlayState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | - -**Adaptation Guide** - -For details, see the [reference](../../../application-dev/reference/apis/js-apis-media.md) for each API. - -## cl.media.2 API Change of the Recording Function - -Added the [AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)9+ API for audio and video recording, with the updated state machine and error codes, which is recommended. The following APIs for audio recording and video recording are no longer maintained: [AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)6+ and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)9+. - -The [AudioSourceType](../../../application-dev/reference/apis/js-apis-media.md#audiosourcetype9) and [VideoSourceType](../../../application-dev/reference/apis/js-apis-media.md#videosourcetype9) APIs shared by the old and new recording APIs are changed to non-system APIs. - -**Change Impacts** - -The [AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)6+ and [VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)9+ APIs can still be used but are no longer maintained. You are advised to use the [AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)9+ API instead. - -**Key API/Component Changes** - -Added APIs - -| Class | Declaration | -| ----------------------- | ------------------------------------------------------------ | -| media | createAVRecorder(callback: AsyncCallback\): void | -| media | createAVRecorder() : Promise\ | -| media.AVRecorder | interface AVRecorder | -| media.AVRecorder | prepare(config: AVRecorderConfig, callback: AsyncCallback\): void | -| media.AVRecorder | prepare(config: AVRecorderConfig): Promise\ | -| media.AVRecorder | release(callback: AsyncCallback\): void | -| media.AVRecorder | release(): Promise\ | -| media.AVRecorder | readonly state: AVRecorderState | -| media.AVRecorder | on(type: 'stateChange', callback: (state: AVRecorderState, reason: StateChangeReason) => void): void | -| media.AVRecorder | on(type: 'error', callback: ErrorCallback): void | -| media.AVRecorder | resume(callback: AsyncCallback\): void | -| media.AVRecorder | resume(): Promise\ | -| media.AVRecorder | start(callback: AsyncCallback\): void | -| media.AVRecorder | start(): Promise\ | -| media.AVRecorder | off(type: 'stateChange'): void | -| media.AVRecorder | off(type: 'error'): void | -| media.AVRecorder | pause(callback: AsyncCallback\): void | -| media.AVRecorder | pause(): Promise\ | -| media.AVRecorder | stop(callback: AsyncCallback\): void | -| media.AVRecorder | stop(): Promise\ | -| media.AVRecorder | reset(callback: AsyncCallback\): void | -| media.AVRecorder | reset(): Promise\ | -| media.AVRecorder | getInputSurface(callback: AsyncCallback\): void | -| media.AVRecorder | getInputSurface(): Promise\ | -| media.AVRecorderConfig | videoSourceType?: VideoSourceType | -| media.AVRecorderConfig | audioSourceType?: AudioSourceType | -| media.AVRecorderConfig | profile: AVRecorderProfile | -| media.AVRecorderConfig | rotation?: number | -| media.AVRecorderConfig | url: string | -| media.AVRecorderConfig | location?: Location | -| media.AVRecorderConfig | interface AVRecorderConfig | -| media.AVRecorderProfile | videoBitrate?: number | -| media.AVRecorderProfile | videoCodec?: CodecMimeType | -| media.AVRecorderProfile | audioCodec?: CodecMimeType | -| media.AVRecorderProfile | videoFrameRate?: number | -| media.AVRecorderProfile | videoFrameHeight?: number | -| media.AVRecorderProfile | audioSampleRate?: number | -| media.AVRecorderProfile | audioBitrate?: number | -| media.AVRecorderProfile | videoFrameWidth?: number | -| media.AVRecorderProfile | audioChannels?: number | -| media.AVRecorderProfile | fileFormat: ContainerFormatType | -| media.AVRecorderProfile | interface AVRecorderProfile | -| unnamed | type AVRecorderState = 'idle' \| 'prepared' \| 'started' \| 'paused' \| 'stopped' \| 'released' \| 'error' | - -APIs no longer maintained - -| Class | Declaration | -| -------------------------- | ------------------------------------------------------------ | -| media | createVideoRecorder(callback: AsyncCallback\): void | -| media | createVideoRecorder(): Promise\ | -| media | createAudioRecorder(): AudioRecorder | -| media.AudioRecorder | interface AudioRecorder | -| media.AudioRecorder | prepare(config: AudioRecorderConfig): void | -| media.AudioRecorder | release(): void | -| media.AudioRecorder | on(type: 'prepare' \| 'start' \| 'pause' \| 'resume' \| 'stop' \| 'release' \| 'reset', callback: () => void): void | -| media.AudioRecorder | on(type: 'error', callback: ErrorCallback): void | -| media.AudioRecorder | resume(): void | -| media.AudioRecorder | start(): void | -| media.AudioRecorder | pause(): void | -| media.AudioRecorder | stop(): void | -| media.AudioRecorder | reset(): void | -| media.AudioRecorderConfig | audioSampleRate?: number | -| media.AudioRecorderConfig | location?: Location | -| media.AudioRecorderConfig | fileFormat?: ContainerFormatType | -| media.AudioRecorderConfig | interface AudioRecorderConfig | -| media.AudioRecorderConfig | audioEncoder?: AudioEncoder | -| media.AudioRecorderConfig | audioEncodeBitRate?: number | -| media.AudioRecorderConfig | numberOfChannels?: number | -| media.AudioRecorderConfig | format?: AudioOutputFormat | -| media.AudioRecorderConfig | uri: string | -| media.AudioRecorderConfig | audioEncoderMime?: CodecMimeType | -| media.VideoRecorder | interface VideoRecorder | -| media.VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback\): void | -| media.VideoRecorder | prepare(config: VideoRecorderConfig): Promise\ | -| media.VideoRecorder | release(callback: AsyncCallback\): void | -| media.VideoRecorder | release(): Promise\ | -| media.VideoRecorder | readonly state: VideoRecordState | -| media.VideoRecorder | on(type: 'error', callback: ErrorCallback): void | -| media.VideoRecorder | resume(callback: AsyncCallback\): void | -| media.VideoRecorder | resume(): Promise\ | -| media.VideoRecorder | start(callback: AsyncCallback\): void | -| media.VideoRecorder | start(): Promise\ | -| media.VideoRecorder | pause(callback: AsyncCallback\): void | -| media.VideoRecorder | pause(): Promise\ | -| media.VideoRecorder | stop(callback: AsyncCallback\): void | -| media.VideoRecorder | stop(): Promise\ | -| media.VideoRecorder | reset(callback: AsyncCallback\): void | -| media.VideoRecorder | reset(): Promise\ | -| media.VideoRecorder | getInputSurface(callback: AsyncCallback\): void | -| media.VideoRecorder | getInputSurface(): Promise\ | -| media.VideoRecorderConfig | videoSourceType: VideoSourceType | -| media.VideoRecorderConfig | audioSourceType?: AudioSourceType | -| media.VideoRecorderConfig | profile: VideoRecorderProfile | -| media.VideoRecorderConfig | rotation?: number | -| media.VideoRecorderConfig | url: string | -| media.VideoRecorderConfig | location?: Location | -| media.VideoRecorderConfig | interface VideoRecorderConfig | -| media.VideoRecorderProfile | readonly videoBitrate: number | -| media.VideoRecorderProfile | readonly videoCodec: CodecMimeType | -| media.VideoRecorderProfile | readonly audioCodec: CodecMimeType | -| media.VideoRecorderProfile | readonly videoFrameRate: number | -| media.VideoRecorderProfile | readonly videoFrameHeight: number | -| media.VideoRecorderProfile | readonly audioSampleRate: number | -| media.VideoRecorderProfile | readonly audioBitrate: number | -| media.VideoRecorderProfile | readonly videoFrameWidth: number | -| media.VideoRecorderProfile | readonly audioChannels: number | -| media.VideoRecorderProfile | readonly fileFormat: ContainerFormatType | -| media.VideoRecorderProfile | interface VideoRecorderProfile | -| unnamed | type VideoRecordState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | - -Changed APIs - -| Class | Declaration | Capability Before Change | Capability After Change | Whether a System API Before Change| Whether a System API After Change| -| --------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------------------------------------------- | -------------------- | -------------------- | -| media.AudioSourceType | enum AudioSourceType { /** * default audio source type. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_DEFAULT = 0, /** * source type mic. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_MIC = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | Yes | No | -| media.VideoSourceType | enum VideoSourceType { /** * surface raw data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, /** * surface ES data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_ES = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | Yes | No | - -**Adaptation Guide** - -For details, see the [reference](../../../application-dev/reference/apis/js-apis-media.md) for each API. - -## cl.media.3 Error Code Change - -Added the standard error code enumeration type [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)9+ that replaces the original error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)8+. - -**Change Impacts** - -The error code enumeration type [MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)8+ is still used for original APIs. [AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)9+ is used for newly added APIs. - -**Key API/Component Changes** - -Added API - -| Class | Declaration | -| ----------------- | ------------------------------------------------------------ | -| media.AVErrorCode | enum AVErrorCode { /** * operation success. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OK = 0, /** * permission denied. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_PERMISSION = 201, /** * invalid parameter. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_INVALID_PARAMETER = 401, /** * the api is not supported in the current version * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_CAPABILITY = 801, /** * the system memory is insufficient or the number of services reaches the upper limit * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_MEMORY = 5400101, /** * current status does not allow or do not have permission to perform this operation * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OPERATE_NOT_PERMIT = 5400102, /** * data flow exception information * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_IO = 5400103, /** * system or network response timeout. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_TIMEOUT = 5400104, /** * service process died. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_SERVICE_DIED = 5400105, /** * unsupported media format * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_FORMAT = 5400106, } | - -API no longer maintained - -| Class | Declaration | -| -------------------- | ------------------------------------------------------------ | -| media.MediaErrorCode | enum MediaErrorCode { /** * operation success. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OK = 0, /** * malloc or new memory failed. maybe system have no memory. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_NO_MEMORY = 1, /** * no permission for the operation. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OPERATION_NOT_PERMIT = 2, /** * invalid argument. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_VAL = 3, /** * an I/O error occurred. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_IO = 4, /** * operation time out. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_TIMEOUT = 5, /** * unknown error. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNKNOWN = 6, /** * media service died. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_SERVICE_DIED = 7, /** * operation is not permit in current state. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_STATE = 8, /** * operation is not supported in current version. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNSUPPORTED = 9, } | - - \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-testfwk_arkxtest.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-testfwk_arkxtest.md deleted file mode 100644 index 1206d659402df80e9892ca3e7b4eba1e729c9357..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-testfwk_arkxtest.md +++ /dev/null @@ -1,42 +0,0 @@ -# Test Subsystem ChangeLog - -## cl.testfwk_arkxtest.1 API Name Change of Rect - -The definition of **Rect**, an enumeration type that indicates the component bound information, is changed since version 4.0.2.1. - -## Change Impacts - -This change affects the **Rect** API provided by **@ohos.uitest**. If you have used the **Rect** API of **@ohos.uitest-api9** during test case development, adaptation is required so that the compilation can be successful in the SDK environment of the new version. - -## Key API/Component Changes - -### Rect9+ - -Before change - -| Name | Value | Description | -| ------- | ---- | ------------------------- | -| leftX | 1 | X-coordinate of the upper left corner of the component bounds.| -| topY | 2 | Y-coordinate of the upper left corner of the component bounds.| -| rightX | 3 | X-coordinate of the lower right corner of the component bounds.| -| bottomY | 4 | Y-coordinate of the lower right corner of the component bounds.| - -After change - -| Name | Value | Description | -| ------ | ---- | ------------------------- | -| left | 1 | X-coordinate of the upper left corner of the component bounds.| -| top | 2 | Y-coordinate of the upper left corner of the component bounds.| -| right | 3 | X-coordinate of the lower right corner of the component bounds.| -| bottom | 4 | Y-coordinate of the lower right corner of the component bounds.| - -## Adaptation Guide - -### Adaptation to the API Name Change - -You can replace the class name according to the following rules: - -- `leftX-->left` -- `topY-->top` -- `rightX-->right` -- `bottomY-->bottom` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-usb.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-usb.md deleted file mode 100644 index 4802e2b0ab8c74e9fabe42238cf13e95a8657599..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.1/changelogs-usb.md +++ /dev/null @@ -1,28 +0,0 @@ -# USB Subsystem API Changelog - -## cl.usb_manager.1 System API Change - -Runtime authentication is performed for system APIs of the USB manager. An asynchronous API throws an error code via **Promise.reject**. - -If your application is developed based on earlier versions, modify the return values of functions. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -| Bundle Name | Original API | New API | -| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| ohos.usbV9.d.ts | function setCurrentFunctions(funcs: FunctionType): Promise; | function setCurrentFunctions(funcs: FunctionType): Promise; | -| ohos.usbV9.d.ts | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; | - -## cl.usb_manager.2 SDK API Deletion - -The **@ohos.usbV9.d.ts** file was deleted in OpenHarmony 4.0.5.5. - -You need to import **@ohos.usbManager** to use USB service APIs. - - ```ts - import usbManager from '@ohos.usbManager'; - ``` - -**Adaptation Guide** - -For details about usage of each API, see the [API Reference](../../../application-dev/reference/apis/js-apis-usbManager.md). diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md deleted file mode 100644 index 26713e17d3561260b45b3b0da193693610e245c7..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md +++ /dev/null @@ -1,63 +0,0 @@ -# Web Subsystem Changelog - -Compared with earlier versions, OpenHarmony 4.0.2.2 has the following API changes in its web subsystem: - -## cl.web.1 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.2 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_4.0.2.2/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelogs-bundlemanager.md deleted file mode 100644 index f41df5b62252f03508110ed8931d47e6198b8b61..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelogs-bundlemanager.md +++ /dev/null @@ -1,14 +0,0 @@ -# Bundle Management Subsystem Changelog - -## cl.bundlemanager.1 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) diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelogs-global.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelogs-global.md deleted file mode 100644 index e6e84330a176fb8e06a5a7a4dc626aba84b362ef..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelogs-global.md +++ /dev/null @@ -1,57 +0,0 @@ -# Globalization Subsystem Changelog - -## cl.resourceManager.1 Change in the Meaning of the Return Value for the API Used to Obtain the rawfile Descriptor - -Changed the meaning of the return value for the API used to obtain the rawfile descriptor after the non-decompression feature is added in this version. The change in the meaning of the return value, namely, **descriptor: RawFileDescriptor {fd, offset, length}**, is described as follows: - -**Before change:** - -**fd**: file descriptor for accessing the rawfile. - -**offset**: offset for accessing the rawfile. In this case, the value is **0**. - -**length**: size of the rawfile to access. - -**After change:** - -**fd**: file descriptor for accessing the HAP where the rawfile is located. - -**offset**: offset of the accessed rawfile relative to the HAP. - -**length**: size of the rawfile to access. - -**Change Impact** - -In versions earlier than 4.0.2.2, the rawfile can be accessed only through **fd**. In version 4.0.2.2 or later, the rawfile can be accessed only through **{fd, offset, and length}**. - -**Key API/Component Changes** - -| **Original API** | -| ---------------- | -| getRawFd(path: string, callback: AsyncCallback\): void | -| getRawFd(path: string): Promise\ | -| getRawFileDescriptor(path: string, callback: AsyncCallback\): void| -| getRawFileDescriptor(path: string): Promise\| -|| - -**Sample Code** - -The following is an example of calling the **getRawFd** API: -``` -try { - this.context.resourceManager.getRawFd("test.ogg", (error, value) => { - if (error != null) { - console.log(`callback getRawFd failed error code: ${error.code}, message: ${error.message}.`); - } else { - let fileDescriptor = { - fd = value.fd, - offset = value.offset, - length = value.length - } - this.avPlayer.fdSrc(fileDescriptor); // Take the audio player as an example. When calling fdSrc, pass fileDescriptor in addition to fd. - } - }); - } catch (error) { - console.error(`callback getRawFd failed, error code: ${error.code}, message: ${error.message}.`) - }; -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ability.md deleted file mode 100644 index 8558a1379ee2f6749b413e91d1af242b7e5577e5..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/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 4.0.2.3, its behavior will change after an upgrade to 4.0.2.3. - -**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_4.0.2.3/changelogs-ans.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ans.md deleted file mode 100644 index e33e0729c2726f145a754888b6e3b97911f9b2ae..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ans.md +++ /dev/null @@ -1,20 +0,0 @@ -# ANS Subsystem Changelog - -## cl.notificationManager.1 API Renaming - -Renamed certain APIs to meet the naming conventions. - -**Change Impact** - -The underlying layer still supports the functions of the original APIs, and therefore these APIs can be called in OpenHarmony 4.0.2.3. - -**Key API/Component Changes** - -| Bundle Name | Original API | New API | -| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(callback: AsyncCallback\): **void**; | **function** isSupportDoNotDisturbMode(callback: AsyncCallback\): **void**; | -| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(): Promise\; | **function** isSupportDoNotDisturbMode(): Promise\; | - -**Adaptation Guide** - -Call the new API **isSupportDoNotDisturbMode**. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md deleted file mode 100644 index cb91d8c6854e5a39c552f2cb3016d671aa0664c5..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-arkui.md +++ /dev/null @@ -1,356 +0,0 @@ -# ArkUI Subsystem ChangeLog - -## cl.arkui.1 Restrictions on Data Type Declarations of State Variables - -1. The data types of state variables decorated by state decorators must be explicitly declared. They cannot be declared as **any** or **Date**. - - Example: - - ```ts - // xxx.ets - @Entry - @Component - struct DatePickerExample { - // Incorrect: @State isLunar: any = false - @State isLunar: boolean = false - // Incorrect: @State selectedDate: Date = new Date('2021-08-08') - private selectedDate: Date = new Date('2021-08-08') - - build() { - Column() { - Button('Switch Calendar') - .margin({ top: 30 }) - .onClick(() => { - this.isLunar = !this.isLunar - }) - DatePicker({ - start: new Date('1970-1-1'), - end: new Date('2100-1-1'), - selected: this.selectedDate - }) - .lunar(this.isLunar) - .onChange((value: DatePickerResult) => { - this.selectedDate.setFullYear(value.year, value.month, value.day) - console.info('select current date is: ' + JSON.stringify(value)) - }) - - }.width('100%') - } - } - ``` - - ![datePicker](../../../application-dev/reference/arkui-ts/figures/datePicker.gif) - -2. The data type declaration of the **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variables can consist of only one of the primitive data types or reference data types. - - The **Length**, **ResourceStr**, and **ResourceColor** types are combinations of primitive data types or reference data types. Therefore, they cannot be used by the aforementioned types of state variables. - For details about the definitions of **Length**, **ResourceStr**, and **ResourceColor**, see [Types](../../../application-dev/reference/arkui-ts/ts-types.md). - - Example: - - ```ts - // xxx.ets - @Entry - @Component - struct IndexPage { - // Incorrect: @State message: string | Resource = 'Hello World' - @State message: string = 'Hello World' - // Incorrect: @State message: ResourceStr = $r('app.string.hello') - @State resourceStr: Resource = $r('app.string.hello') - - build() { - Row() { - Column() { - Text(`${this.message}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } - } - ``` - - ![hello](../../../application-dev/quick-start/figures/hello.PNG) - -**Change Impacts** - -1. If the data type of a state variable decorated by a state decorator is declared as **any**, a build error will occur. - ```ts - // ArkTS:ERROR Please define an explicit type, not any. - @State isLunar: any = false - ``` -2. If the data type of a state variable decorated by a state decorator is declared as **Date**, a build error will occur. - ```ts - // ArkTS:ERROR The @State property 'selectedDate' cannot be a 'Date' object. - @State selectedDate: Date = new Date('2021-08-08') - ``` -3. If the data type of a **@State**, **@Provide**, **@Link**, and or **@Consume** decorated state variable is Length, **ResourceStr**, or **ResourceColor**, a build error will occur. - ```ts - /* ArkTS:ERROR The state variable type here is 'ResourceStr', it contains both a simple type and an object type, - which are not allowed to be defined for state variable of a struct.*/ - @State message: ResourceStr = $r('app.string.hello') - ``` - -**Key API/Component Changes** - -N/A - -**Adaptation Guide** - -1. Explicitly declare the data type for state variables decorated by state decorators. -2. If a state variable decorated by a state decorator uses the **Date** object, change it to a regular variable – a variable not decorated by any decorator. -3. - Adapt the **@State**, **@Provide**, **@Link**, and **@Consume** decorated variables based on the following code snippet so that they do not use the **Length(string|number|Resource)**, **ResourceStr(string|Resource)**, and **ResourceColor(string|number|Color|Resource)** types: - ```ts - // Incorrect: - @State message: ResourceStr = $r('app.string.hello') - // Corrected: - @State resourceStr: Resource = $r('app.string.hello') - ``` - -## cl.arkui.2 Initialization Rules and Restrictions of Custom Components' Member Variables - -Comply with the following rules when using constructors to initialize member variables: - -| **From the Variable in the Parent Component (Right) to the Variable in the Child Component (Below)**| **regular** | **@State** | **@Link** | **@Prop** | **@Provide** | **@Consume** | **@ObjectLink** | -|---------------------------------|----------------------------|------------|-----------|-----------|--------------|--------------|------------------| -| **regular** | Supported | Supported | Supported | Supported | Not supported | Not supported | Supported | -| **@State** | Supported | Supported | Supported | Supported | Supported | Supported | Supported | -| **@Link** | Not supported | Supported (1) | Supported (1) | Supported (1) | Supported (1) | Supported (1) | Supported (1) | -| **@Prop** | Supported | Supported | Supported | Supported | Supported | Supported | Supported | -| **@Provide** | Supported | Supported | Supported | Supported | Supported | Supported | Supported | -| **@Consume** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| **@ObjectLink** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | - -| **From the Variable in the Parent Component (Right) to the Variable in the Child Component (Below)**| **@StorageLink** | **@StorageProp** | **@LocalStorageLink** | **@LocalStorageProp** | -|------------------|------------------|------------------|-----------------------|------------------------| -| **regular** | Supported | Not supported | Not supported | Not supported | -| **@State** | Supported | Supported | Supported | Supported | -| **@Link** | Supported (1) | Supported (1) | Supported (1) | Supported (1) | -| **@Prop** | Supported | Supported | Supported | Supported | -| **@Provide** | Supported | Supported | Supported | Supported | -| **@Consume** | Not supported | Not supported | Not supported | Not supported | -| **@ObjectLink** | Not supported | Not supported | Not supported | Not supported | - -> **NOTE** -> -> **Supported (1)**: The dollar sign ($) must be used, for example, **this.$varA**. -> -> **regular**: refers to a regular variable that is not decorated by any decorator. - -**@StorageLink**, **@StorageProp**, **@LocalStorageLink**, and **@LocalStorageProp** variables cannot be initialized from the parent component. - -**Change Impacts** - -1. Variables decorated by **@LocalStorageLink** and **@LocalStorageProp** cannot be initialized from the parent component. - ```ts - @Entry - @Component - struct LocalStorageComponent { - build() { - Column() { - Child({ - /* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot - initialize here (forbidden to specify). */ - simpleVarName: 1, - /* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot - initialize here (forbidden to specify). */ - objectName: new ClassA("x") - }) - } - } - } - @Component - struct Child { - @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0; - @LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x"); - build() {} - } - ``` -2. The **@ObjectLink** decorated variable cannot be directly initialized from a decorated variable in the parent component. The source of the parent component must be an array item or object attribute decorated by **@State**, **@Link**, **@Provide**, **@Consume**, or **@ObjectLink**. - ```ts - let NextID : number = 0; - - @Observed class ClassA { - public id : number; - public c: number; - constructor(c: number) { - this.id = NextID++; - this.c = c; - } - } - - @Component - struct Child { - @ObjectLink varA : ClassA; - build() { - Row() { - Text('ViewA-' + this.varA.id) - } - } - } - - @Component - struct Parent { - @Link linkValue: ClassA - build() { - Column() { - /* ArkTS:ERROR The @Link property 'linkValue' cannot be assigned to - the @ObjectLink property 'varA'.*/ - Child({ varA: this.linkValue }) - } - } - } - ``` - -**Key API/Component Changes** - -N/A - -**Adaptation Guide** -1. When building a child component, do not perform the build on the variables decorated by **@LocalStorageLink** and **@LocalStorageProp** in the child component. - - To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them. - -2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-observed-and-objectlink.md). - -## cl.arkui.3 Change of the onScrollBegin Event of the \ and \ Components - -The **onScrollBegin** event of the **\** and **\** components is renamed **onScrollFrameBegin**. In the **onScrollBegin** event, the amount to scroll by is indicated by the **dx** and **dy** parameters. In the **onScrollFrameBegin** event, it is indicated by the **offset** parameter. The **onScrollFrameBegin** event adds the **ScrollState** parameter to indicate whether the component is in the finger dragging or inertial scrolling state. - -**Change Impacts** - -The **onScrollBegin** event is deprecated and must be replaced with the **onScrollFrameBegin** event. - -**Key API/Component Changes** - -| Old Event | New Event | -|------------------ | ------------------- | -| onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }) | onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }) | - -For details about the **onScrollFrameBegin** event, see the following: -- [Scroll](../../../application-dev/reference/arkui-ts/ts-container-scroll.md#events) -- [List](../../../application-dev/reference/arkui-ts/ts-container-list.md#events) - -**Adaptation Guide** - -Switch the event from **onScrollBegin** to **onScrollFrameBegin**, and use the **offset** parameter in **onScrollFrameBegin**, rather than the **dx** and **dy** parameters in **onScrollBegin**, to indicate the amount to scroll by. - -Example of using the **onScrollBegin** event: -```ts -@Entry -@Component -struct NestedScroll { - @State listPosition: number = 0; // 0 indicates scrolling to the top of the list, 1 indicates scrolling to the middle of the list, and 2 indicates scrolling to the bottom of the list. - private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - private scrollerForScroll: Scroller = new Scroller() - private scrollerForList: Scroller = new Scroller() - - build() { - Flex() { - Scroll(this.scrollerForScroll) { - Column() { - Text("Scroll Area") - .width("100%").height("40%").backgroundColor(0X330000FF) - .fontSize(16).textAlign(TextAlign.Center) - .onClick(() => { - this.scrollerForList.scrollToIndex(5) - }) - - List({ space: 20, scroller: this.scrollerForList }) { - ForEach(this.arr, (item) => { - ListItem() { - Text("ListItem" + item) - .width("100%").height("100%").borderRadius(15) - .fontSize(16).textAlign(TextAlign.Center).backgroundColor(Color.White) - }.width("100%").height(100) - }, item => item) - } - .width("100%") - .height("50%") - .edgeEffect(EdgeEffect.None) - .onReachStart(() => { - this.listPosition = 0 - }) - .onReachEnd(() => { - this.listPosition = 2 - }) - .onScrollBegin((dx: number, dy: number) => { - if ((this.listPosition == 0 && dy >= 0) || (this.listPosition == 2 && dy <= 0)) { - this.scrollerForScroll.scrollBy(0, -dy) - return { dxRemain: dx, dyRemain: 0 } - } - this.listPosition = 1 - return { dxRemain: dx, dyRemain: dy }; - }) - - Text("Scroll Area") - .width("100%").height("40%").backgroundColor(0X330000FF) - .fontSize(16).textAlign(TextAlign.Center) - } - } - .width("100%").height("100%") - }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) - } -} -``` -Example of using the **onScrollFrameBegin** event: -```ts -@Entry -@Component -struct NestedScroll { - @State listPosition: number = 0; // 0 indicates scrolling to the top of the list, 1 indicates scrolling to the middle of the list, and 2 indicates scrolling to the bottom of the list. - private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - private scrollerForScroll: Scroller = new Scroller() - private scrollerForList: Scroller = new Scroller() - - build() { - Flex() { - Scroll(this.scrollerForScroll) { - Column() { - Text("Scroll Area") - .width("100%").height("40%").backgroundColor(0X330000FF) - .fontSize(16).textAlign(TextAlign.Center) - .onClick(() => { - this.scrollerForList.scrollToIndex(5) - }) - - List({ space: 20, scroller: this.scrollerForList }) { - ForEach(this.arr, (item) => { - ListItem() { - Text("ListItem" + item) - .width("100%").height("100%").borderRadius(15) - .fontSize(16).textAlign(TextAlign.Center).backgroundColor(Color.White) - }.width("100%").height(100) - }, item => item) - } - .width("100%") - .height("50%") - .edgeEffect(EdgeEffect.None) - .onReachStart(() => { - this.listPosition = 0 - }) - .onReachEnd(() => { - this.listPosition = 2 - }) - .onScrollFrameBegin((offset: number, state: ScrollState) => { - if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) { - this.scrollerForScroll.scrollBy(0, -offset) - return { offsetRemain: 0 } - } - this.listPosition = 1 - return { offsetRemain: offset }; - }) - - Text("Scroll Area") - .width("100%").height("40%").backgroundColor(0X330000FF) - .fontSize(16).textAlign(TextAlign.Center) - } - } - .width("100%").height("100%") - }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) - } -} -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-usb.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-usb.md deleted file mode 100644 index 909d8f69d6c116ced05232af8f3801de89282cfd..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-usb.md +++ /dev/null @@ -1,37 +0,0 @@ -# USB Subsystem API Changelog - -## cl.usb_manager.1 Bundle Name Change - -For applications developed based on earlier versions, you need to change the name of the imported bundle. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -| Original Bundle Name | New Bundle Name | -|------------------ | ------------------- | -| ohos.usbV9.d.ts | ohos.usbManager.d.ts | - -**Adaptation Guide** - -Change **@ohos.usbV9** to **@ohos.usbManager** when importing the bundle. - -## cl.usb_manager.2 API Parameter Type Change - -For applications developed based on earlier versions, you need to modify the parameter type. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -| Original Class Name | New Class Name | -|---------------| ------------- | -| interface USBConfig | interface USBConfiguration | - -| Original Namespace | New Namespace | -|---------------| ------------- | -| @namespace usbV9 | @namespace usbManager | - -| Bundle Name | Original API | New API | -| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| ohos.usbManager.d.ts | function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; | - -**Adaptation Guide** - -When calling **setConfiguration**, change the parameter type from **USBConfig** to **USBConfiguration**. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-accesstoken.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-accesstoken.md deleted file mode 100644 index 832acd65c2ad41b5b824d9f29a046130e9217c89..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-accesstoken.md +++ /dev/null @@ -1,33 +0,0 @@ -# App Access Control Subsystem ChangeLog - -OpenHarmony 4.0.3.2 has the following changes in the APIs of the app access control subsystem: - -## cl.access_token.1 getPermissionUsedRecords Name Change - -Changed **getPermissionUsedRecords** to **getPermissionUsedRecord**. - -**Change Impact** - -The **getPermissionUsedRecords()** API cannot be used in OpenHarmony 4.0.3.3 and later versions. - -**Key API/Component Changes** - -- Involved APIs: - - function getPermissionUsedRecords - -- Before change: - - ```ts - function getPermissionUsedRecords - ``` - -- After change: - - ```ts - function getPermissionUsedRecord - ``` - -**Adaptation Guide** - -Use **getPermissionUsedRecord()**. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-security.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-security.md deleted file mode 100644 index caf1866f3a5caec4bb78d7f7991208f8c9da46e9..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-security.md +++ /dev/null @@ -1,86 +0,0 @@ -# Security Subsystem Changelog - -## cl.security.1 ParamsSpec Attribute Name Change -Changed **algoName** of the **ParamsSpec** structure to **algName**. - -**Change Impact** - -For the released JavaScript APIs that use **ParamsSpec** and its child classes **IvParamsSpec**, **GcmParamsSpec**, and **CcmParamsSpec** as parameters or return values, **algoName** must be changed to **algName**. -The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. - -**Key API/Component Changes** - -API prototype before the change: - - ```ts -interface ParamsSpec { - /** - * Indicates the algorithm name. Should be set before initialization of a cipher object. - * @type { string } - * @syscap SystemCapability.Security.CryptoFramework - * @since 9 - */ - algoName : string; -} - ``` -API prototype after the change: - - ```ts -interface ParamsSpec { - /** - * Indicates the algorithm name. Should be set before initialization of a cipher object. - * @type { string } - * @syscap SystemCapability.Security.CryptoFramework - * @since 9 - */ - algName : string; -} - ``` - -**Adaptation Guide** - -Change **algoName** to **algName** in **ParamsSpec** and its child classes **IvParamsSpec**, **GcmParamsSpec**, and **CcmParamsSpec**. - ```ts -function genGcmParamsSpec() { - let arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0 , 0, 0]; // 12 bytes - let dataIv = new Uint8Array(arr); - let ivBlob = {data : dataIv}; - - arr = [0, 0, 0, 0 , 0, 0, 0, 0]; // 8 bytes - let dataAad = new Uint8Array(arr); - let aadBlob = {data : dataAad}; - - arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0]; // 16 bytes - let dataTag = new Uint8Array(arr); - let tagBlob = {data : dataTag}; - let gcmParamsSpec = {iv : ivBlob, aad : aadBlob, authTag : tagBlob, algName : "GcmParamsSpec"}; - return gcmParamsSpec; -} - ``` -For details, see the APIs of **ParamsSpec** in [Crypto Framework](../../../application-dev/reference/apis/js-apis-cryptoFramework.md#paramsspec). - -## Change of cl.security.2 ECC Algorithm Parameter Name from ECC512 to ECC521 - -**Change Impact** - -Behavior of released JavaScript APIs will be changed. -The application needs to be adapted to obtain the correct result in the SDK of the new version. - -**Key API/Component Changes** -The parameter passed in the APIs is changed from **ECC512** to **ECC521**. The related APIs remain unchanged. For details, see [Key Generation Specifications](../../../application-dev/security/cryptoFramework-overview.md#key-generation-specifications). The following APIs are involved: - -cryptoFramework.createAsyKeyGenerator - -cryptoFramework.createSign - -cryptoFramework.createVerify - -cryptoFramework.createKeyAgreement - -**Adaptation Guide** - -```js -import cryptoFramework from "@ohos.security.cryptoFramework" - -let asyKeyGenerator = cryptoFramework.createAsyKeyGenerator("ECC521"); -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-web.md deleted file mode 100644 index 44380d11950e3f018b719776edf08964d6b4c0af..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelog-web.md +++ /dev/null @@ -1,467 +0,0 @@ -# Web Subsystem Changelog - -Compared with earlier versions, OpenHarmony 4.0.3.2 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 4.0.3.2 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 4.0.3.2 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 4.0.3.2 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 4.0.3.2 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 4.0.3.2 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 }) - } - } - } - ``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-account_os_account.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-account_os_account.md deleted file mode 100644 index 8678507b6c8d8449e8cac47e6b8669611865bec2..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-account_os_account.md +++ /dev/null @@ -1,391 +0,0 @@ -# Account Subsystem Changelog - -OpenHarmony 4.0.3.2 has the following changes in account module APIs: - -## cl.account_os_account.1 App Account API isAccountRemovable Renamed - -Changed **isAccountRemovable** in the **Authenticator** class to **checkAccountRemovable**. - -**Change Impact** - -The **isAccountRemovable** API in the **Authenticator** class cannot be used from 4.0.3.2. Use **checkAccountRemovable** instead. - -**Key API/Component Changes** - -- Involved APIs: - ```ts - class Authenticator { - ... - isAccountRemovable - ... - } - ``` -- Before change: - - ```ts - class Authenticator { - ... - /** - * Checks whether the specified account can be removed. - * @param name Indicates the account name. - * @param callback Indicates the authenticator callback. - * @returns void. - * @since 9 - */ - isAccountRemovable(name: string, callback: AuthCallback): void; - ... - } - ``` - -- After change: - - ```ts - class Authenticator { - ... - /** - * Checks whether the specified account can be removed. - * @param name Indicates the account name. - * @param callback Indicates the authenticator callback. - * @returns void. - * @since 9 - */ - checkAccountRemovable(name: string, callback: AuthCallback): void; - ... - } - ``` - -## cl.account_os_account.2 OS Account API checkConstraintEnabled Renamed - -Changed **checkConstraintEnabled** to **checkOsAccountConstraintEnabled**. - -**Change Impact** - -The **checkConstraintEnabled** API cannot be used from 4.0.3.2. Use **checkOsAccountConstraintEnabled** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - checkConstraintEnabled - ... -} -``` - -- Before change: - - ```ts - checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; - checkConstraintEnabled(localId: number, constraint: string): Promise; - ``` - -- After change: - - ```ts - checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; - checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; - ``` - -## cl.account_os_account.3 OS Account API **checkOsAccountConstraintEnabled** Permission Scenario Change - -Added an optional permission **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** to the **checkOsAccountConstraintEnabled** API. - -**Change Impact** - -In 4.0.3.2 and later versions, an app with the **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission can also call **checkOsAccountConstraintEnabled**. -The use of **ohos.permission.MANAGE_LOCAL_ACCOUNTS** is not affected. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - checkOsAccountConstraintEnabled - ... -} -``` - -- Before change: - - ```ts - ... - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS - ... - checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; - checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; - ``` - -- After change: - - ```ts - ... - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - ... - checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; - checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; - ``` - -## cl.account_os_account.4 OS Account API queryOsAccountLocalIdFromProcessd Renamed - -Changed **queryOsAccountLocalIdFromProcess** to **getOsAccountLocalId**. - -**Change Impact** - -The **queryOsAccountLocalIdFromProcess** API cannot be used from 4.0.3.2. Use **getOsAccountLocalId** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - queryOsAccountLocalIdFromProcess - ... -} -``` -- Before change: - - ```ts - queryOsAccountLocalIdFromProcess(callback: AsyncCallback): void; - queryOsAccountLocalIdFromProcess(): Promise; - ``` - -- After change: - - ```ts - getOsAccountLocalId(callback: AsyncCallback): void; - getOsAccountLocalId(): Promise; - ``` - -## cl.account_os_account.5 OS Account API queryOsAccountLocalIdFromUid Renamed - -Changed **queryOsAccountLocalIdFromUid** to **getOsAccountLocalIdForUid**. - -**Change Impact** - -The **queryOsAccountLocalIdFromUid** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForUid** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - queryOsAccountLocalIdFromUid - ... -} -``` - -- Before change: - - ```ts - queryOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback): void; - queryOsAccountLocalIdFromUid(uid: number): Promise; - ``` - -- After change: - - ```ts - getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback): void; - getOsAccountLocalIdForUid(uid: number): Promise; - ``` - -## cl.account_os_account.6 OS Account API queryOsAccountLocalIdFromDomain Renamed - -Changed **queryOsAccountLocalIdFromDomain** to **getOsAccountLocalIdForDomain**. - -**Change Impact** - -The **queryOsAccountLocalIdFromDomain** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForDomain** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - queryOsAccountLocalIdFromDomain - ... -} -``` - -- Before change: - - ```ts - queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; - queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise; - ``` - -- After change: - - ```ts - getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; - getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise; - ``` - -## cl.account_os_account.7 OS Account API getActivatedOsAccountIds Renamed - -Changed **getActivatedOsAccountIds** to **getActivatedOsAccountLocalIds**. - -**Change Impact** - -The **getActivatedOsAccountIds** API cannot be used from 4.0.3.2. Use **getActivatedOsAccountLocalIds** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - getActivatedOsAccountIds - ... -} -``` - -- Before change: - - ```ts - getActivatedOsAccountIds(callback: AsyncCallback>): void; - getActivatedOsAccountIds(): Promise>; - ``` - -- After change: - - ```ts - getActivatedOsAccountLocalIds(callback: AsyncCallback>): void; - getActivatedOsAccountLocalIds(): Promise>; - ``` - -## cl.account_os_account.8 OS Account API queryOsAccountLocalIdBySerialNumber Renamed - -Changed **queryOsAccountLocalIdBySerialNumber** to **getOsAccountLocalIdForSerialNumber**. - -**Change Impact** - -The **queryOsAccountLocalIdBySerialNumber** API cannot be used from 4.0.3.2. Use **getOsAccountLocalIdForSerialNumber** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - queryOsAccountLocalIdBySerialNumber - ... -} -``` - -- Before change: - - ```ts - queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void; - queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise; - ``` - -- After change: - - ```ts - getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback): void; - getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise; - ``` - -## cl.account_os_account.9 OS Account API querySerialNumberByOsAccountLocalId Renamed - -Changed **querySerialNumberByOsAccountLocalId** to **getSerialNumberForOsAccountLocalId**. - -**Change Impact** - -The **querySerialNumberByOsAccountLocalId** API cannot be used from 4.0.3.2. Use **getSerialNumberForOsAccountLocalId** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - querySerialNumberByOsAccountLocalId - ... -} -``` - -- Before change: - - ```ts - querySerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback): void; - querySerialNumberByOsAccountLocalId(localId: number): Promise; - ``` - -- After change: - - ```ts - getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback): void; - getSerialNumberForOsAccountLocalId(localId: number): Promise; - ``` - -## cl.account_os_account.10 OS Account API getBundleIdFromUid Renamed - -Changed **getBundleIdFromUid** to **getBundleIdForUid**. - -**Change Impact** - -The **getBundleIdFromUid** API cannot be used from 4.0.3.2. Use **getBundleIdForUid** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - getBundleIdFromUid - ... -} -``` - -- Before change: - - ```ts - getBundleIdFromUid(uid: number, callback: AsyncCallback): void; - getBundleIdFromUid(uid: number): Promise; - ``` - -- After change: - - ```ts - getBundleIdForUid(uid: number, callback: AsyncCallback): void; - getBundleIdForUid(uid: number): Promise; - ``` - -## cl.account_os_account.11 OS Account API queryOsAccountConstraintSourceTypes Renamed - -Changed **queryOsAccountConstraintSourceTypes** to **getOsAccountConstraintSourceTypes**. - -**Change Impact** - -The **queryOsAccountConstraintSourceTypes** API cannot be used from 4.0.3.2. Use **getOsAccountConstraintSourceTypes** instead. - -**Key API/Component Changes** - -- Involved APIs: -``` -interface AccountManager { - ... - queryOsAccountConstraintSourceTypes - ... -} -``` - -- Before change: - - ```ts - queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; - queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; - ``` - -- After change: - - ```ts - getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; - getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; - ``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-arkui.md deleted file mode 100644 index 2429518bb6a952b89a0f3c1a77bc16043b463bb5..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-arkui.md +++ /dev/null @@ -1,87 +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 4.0.3.2 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.1 API Changes of the Router Module in API Version 9 - -Replaced the **enableAlertBeforeBackPage**, **enableBackPageAlert**, **disableAlertBeforeBackPage** APIs in **ohos.router** to **showAlertBeforeBackPage** and **hideAlertBeforeBackPage** to facilitate development. - -**Change Impact** - -The **enableAlertBeforeBackPage** and **enableBackPageAlert** APIs must be replaced with **showAlertBeforeBackPage**. - -The **disableAlertBeforeBackPage** API must be replaced with **hideAlertBeforeBackPage**. - -**Key API/Component Changes** - -**router.enableAlertBeforeBackPage**, **router.enableBackPageAlert**, and **router.disableAlertBeforeBackPage** - -* Before change: - -```ts -router.enableAlertBeforeBackPage(); -router.enableBackPageAlert() -``` - -* After change: - -```ts -router.showAlertBeforeBackPage() -``` - -* Before change: - -```ts -router.disableAlertBeforeBackPage() -``` - -* After change: - -```ts -router.hideAlertBeforeBackPage() -``` - -**Adaptation Guide** - -Replace **enableAlertBeforeBackPage** and **enableBackPageAlert** with **showAlertBeforeBackPage**. - -Replace **disableAlertBeforeBackPage** with **hideAlertBeforeBackPage**. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-bundlemanager.md deleted file mode 100644 index 7edc40101a4bd5098765e78d56e7da7508cfd70e..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-bundlemanager.md +++ /dev/null @@ -1,27 +0,0 @@ -# Bundle Manager Subsystem Changelog - -## cl.bundlemanager.1 Deleted getAbilityIcon - -The **getAbilityIcon** API in [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is deleted. The **getMediaContent** API in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) can be used instead. - -**Change Impact**
-The **getAbilityIcon** API does not take effect. - -**Key API/Component Changes**
-The **getAbilityIcon** API is deleted from **@ohos.bundle.bundleManager.d.ts**. - -**Adaptation Guide**
-If your application uses **getAbilityIcon** in **@ohos.bundle.bundleManager.d.ts**, replace it with **getMediaContent** in **@ohos.resourceManager.d.ts**. You need to obtain the icon ID in advance. For details, see [Usage Guide](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9). - -## cl.bundlemanager.2 Added Error Code 202 - -Error code 202 is added to the bundle manager subsystem. If a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem, error code 202 is returned. - -**Change Impact**
-Error code 202 is returned when a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem. - -**Key API/Component Changes**
-If a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem, error code 202 is returned. - -**Adaptation Guide**
-No adaptation is required. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-ces.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-ces.md deleted file mode 100644 index 452f10ca4a14709640ad529022287dd3d5aa452d..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-ces.md +++ /dev/null @@ -1,57 +0,0 @@ -# Common Event Subsystem Changelog - -## cl.ces.1 Event Enum Change of ohos.commonEvent - -**Change Impact** - -For applications developed based on earlier versions, the following common events of the **.ohos.commonEvent** module must be adapted. - -| Common Event | -| ----------------------------------- | -| COMMON_EVENT_PACKAGE_CACHE_CLEARED | -| COMMON_EVENT_USB_STATE | -| COMMON_EVENT_USB_PORT_CHANGED | -| COMMON_EVENT_VOLUME_REMOVED | -| COMMON_EVENT_VOLUME_UNMOUNTED | -| COMMON_EVENT_VOLUME_MOUNTED | -| COMMON_EVENT_VOLUME_BAD_REMOVAL | -| COMMON_EVENT_VOLUME_EJECT | -| COMMON_EVENT_SLOT_CHANGE | -| COMMON_EVENT_SPN_INFO_CHANGED | -| COMMON_EVENT_QUICK_FIX_APPLY_RESULT | - -**Key API/Component Changes** - -Replace the common events in **ohos.commonEvent** with those in **ohos.commonEventManager**. - -| Common Event in ohos.commonEvent | Common Event in ohos.commonEventManager | -| ----------------------------------- | ----------------------------------- | -| COMMON_EVENT_PACKAGE_CACHE_CLEARED | COMMON_EVENT_PACKAGE_CACHE_CLEARED | -| COMMON_EVENT_USB_STATE | COMMON_EVENT_USB_STATE | -| COMMON_EVENT_USB_PORT_CHANGED | COMMON_EVENT_USB_PORT_CHANGED | -| COMMON_EVENT_VOLUME_REMOVED | COMMON_EVENT_VOLUME_REMOVED | -| COMMON_EVENT_VOLUME_UNMOUNTED | COMMON_EVENT_VOLUME_UNMOUNTED | -| COMMON_EVENT_VOLUME_MOUNTED | COMMON_EVENT_VOLUME_MOUNTED | -| COMMON_EVENT_VOLUME_BAD_REMOVAL | COMMON_EVENT_VOLUME_BAD_REMOVAL | -| COMMON_EVENT_VOLUME_EJECT | COMMON_EVENT_VOLUME_EJECT | -| COMMON_EVENT_SLOT_CHANGE | COMMON_EVENT_SLOT_CHANGE | -| COMMON_EVENT_SPN_INFO_CHANGED | COMMON_EVENT_SPN_INFO_CHANGED | -| COMMON_EVENT_QUICK_FIX_APPLY_RESULT | COMMON_EVENT_QUICK_FIX_APPLY_RESULT | - -**Adaptation Guide** - -Replace the events in **ohos.commonEvent** with those in **ohos.commonEventManager**. - -Before change: - -```typescript -import commonEvent from '@ohos.commonEvent'; -let event: string = commonEvent.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED; -``` - -After change: - -```typescript -import commonEventManager from '@ohos.commonEventManager'; -let event: string = commonEventManager.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED; -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-filemanagement.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-filemanagement.md deleted file mode 100644 index 41cb99ecf701967d1ebe28a7e35de35896455fa6..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-filemanagement.md +++ /dev/null @@ -1,25 +0,0 @@ -# File Management Subsystem Changelog - -## cl.filemanagement.1 Filter Module Change - -Moved **Filter** from **@ohos.fileio** to **@ohos.file.fs**. The attributes of **Filter** remain unchanged. - -**Change Impact** - -If your application is developed using the APIs of earlier versions, note that the position of **Filter** in the **d.ts** file and the module name are changed. The **Filter** type is moved to **@ohos.file.fs**. - -**Key API/Component Changes** - -Before the change, **Filter** is in the **@ohos.fileio** module and imported as follows: - -```js -import Filter from '@ohos.fileio'; -``` - -**Adaptation Guide** - -Now, **Filter** is in the **@ohos.file.fs** module and imported as follows: - -```js -import Filter from '@ohos.file.fs'; -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-pasteboard.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-pasteboard.md deleted file mode 100644 index 8d8b439cc3a7461162c51abc2f84d09f00412e3d..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-pasteboard.md +++ /dev/null @@ -1,66 +0,0 @@ -# Pasteboard Subsystem Changelog - -OpenHarmony 4.0.3.2 has the following changes in the APIs of the pasteboard subsystem: - -## cl.pasteboard.1 convertToTextV9 API Change - -Renamed **convertToTextV9** **toPlainText()** and changed the API from asynchronous to synchronous. - -**Change Impact** - -Applications developed using the **convertToTextV9** API in versions earlier than OpenHarmony 4.0.3.3 cannot be used in OpenHarmony 4.0.3.3 and later versions. - -**Key API/Component Changes** - -- Involved APIs: - - function convertToTextV9 - -- Before change: - - ```ts - convertToTextV9(callback: AsyncCallback): void; - convertToTextV9(): Promise; - ``` - -- After change: - - ```ts - toPlainText(): string; - ``` - - -**Adaptation Guide** - -Replace **convertToTextV9**, an asynchronous API, with **toPlainText**, a synchronous API. - -## cl.pasteboard.2 ShareOption Enum Name Change - -Changed the enum names of **ShareOption** from UpperCamelCase to all caps. - -**Change Impact** - -Applications developed using the **InApp/LocalDevice/CrossDevice** attributes in versions earlier than OpenHarmony 4.0.3.3 cannot be used in OpenHarmony 4.0.3.3 and later versions. - -**Key API/Component Changes** - -ShareOption9+ - -Before change: -| Name| Value| Description | -| ---- |---|-------------------| -| InApp | 0 | Only intra-application pasting is allowed. | -| LocalDevice | 1 | Paste is allowed in any application on the local device.| -| CrossDevice | 2 | Paste is allowed in any application across devices. | - - -After change: -| Name| Value| Description | -| ---- |---|-------------------| -| INAPP | 0 | Only intra-application pasting is allowed. | -| LOCALDEVICE | 1 | Paste is allowed in any application on the local device.| -| CROSSDEVICE | 2 | Paste is allowed in any application across devices. | - -**Adaptation Guide** - -Perform adaptation based on the new semantics. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-power.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-power.md deleted file mode 100644 index c4506242ea6b189ec9a403e0b5ce85d2490f1b34..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-power.md +++ /dev/null @@ -1,82 +0,0 @@ -# Power Subsystem Changelog - -## cl.powermgr.1 CommonEventBatteryChangedCode API Change - -Changed the **CommonEventBatteryChangedCode** enum class in [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) as follows: - -- Changed the class name to **CommonEventBatteryChangedKey**. -- Deleted **EXTRA_MAX_CURRENT**, **EXTRA_MAX_VOLTAGE**, and **EXTRA_CHARGE_COUNTER**. -- Changed the enum value type from numeric to string. - -#### Change Impact - -The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. - -#### Key API/Component Changes - -Before change: - -| Name | Value | Description | -| -------------------- | ---- | -------------------------------------------------- | -| EXTRA_SOC | 0 | Remaining battery level in percentage. | -| EXTRA_VOLTAGE | 1 | Battery voltage of the device. | -| EXTRA_TEMPERATURE | 2 | Battery temperature of the device. | -| EXTRA_HEALTH_STATE | 3 | Battery health status of the device. | -| EXTRA_PLUGGED_TYPE | 4 | Type of the charger connected to the device. | -| EXTRA_MAX_CURRENT | 5 | Maximum battery current of the device. | -| EXTRA_MAX_VOLTAGE | 6 | Maximum battery voltage of the device. | -| EXTRA_CHARGE_STATE | 7 | Battery charging status of the device. | -| EXTRA_CHARGE_COUNTER | 8 | Number of battery charging times of the device. | -| EXTRA_PRESENT | 9 | Whether the battery is supported by the device or installed.| -| EXTRA_TECHNOLOGY | 10 | Battery technology of the device. | -| EXTRA_CAPACITY_LEVEL | 11 | Battery level of the device. | - -After change: - -| Name | Value | Description | -| -------------------- | --------------- | -------------------------------------------------- | -| EXTRA_SOC | "soc" | Remaining battery level in percentage. | -| EXTRA_CHARGE_STATE | "chargeState" | Battery charging status of the device. | -| EXTRA_HEALTH_STATE | "healthState" | Battery health status of the device. | -| EXTRA_PLUGGED_TYPE | "pluggedType" | Type of the charger connected to the device. | -| EXTRA_VOLTAGE | "voltage" | Battery voltage of the device. | -| EXTRA_TECHNOLOGY | "technology" | Battery technology of the device. | -| EXTRA_TEMPERATURE | "temperature" | Battery temperature of the device. | -| EXTRA_PRESENT | "present" | Whether the battery is supported by the device or installed.| -| EXTRA_CAPACITY_LEVEL | "capacityLevel" | Battery level of the device. | - -#### Adaptation Guide - -For details, see the API reference of the [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) API. -## cl.powermgr.2 estimatedRemainingChargeTime API Change - -Changed the **estimatedRemainingChargeTime** API in [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) to a system API. - -#### Change Impact - -The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. - -#### Adaptation Guide - -For details, see the API reference of the [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) API. - -## cl.powermgr.3 System Common Event Behavior Change - -The following common events are provided in the battery information through [@ohos.commonEventManager (common event module)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-commonEventManager.md): - -- COMMON_EVENT_BATTERY_LOW: common event for low battery level. It includes the remaining battery in percentage. -- COMMON_EVENT_BATTERY_OKAY: common event for normal battery level. It includes the remaining battery in percentage. -- COMMON_EVENT_POWER_CONNECTED: common event for connection to an external power supply. It includes the type of the power supply to which the device is connected. -- COMMON_EVENT_POWER_DISCONNECTED: common event for disconnection from an external power supply. It includes the type of the power supply from which the device is disconnected. -- COMMON_EVENT_CHARGING: common event for starting of battery charging. It includes the battery charging status. -- COMMON_EVENT_DISCHARGING: common event for ending of battery charging. It includes the battery charging status. - -Changed the method of obtaining data from common events from **CommonEventData.data** to **CommonEventData.code**. - -#### Change Impact - -The application developed based on earlier versions needs to adapt the method for obtaining common events in the battery information. Otherwise, the original service logic will be affected. - -#### Adaptation Guide - -For details, see the API reference of the [@ohos.commonEventManager (Common Event Manager)](../../../application-dev/reference/apis/js-apis-commonEventManager.md) API. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-sensor.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-sensor.md deleted file mode 100644 index 7a2e2946d69a0f116616152cd82eb8a2bae96c58..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-sensor.md +++ /dev/null @@ -1,49 +0,0 @@ -# Pan-sensor Subsystem Changelog - -## cl.ability.1 Attribute Name Changed from venderName to vendorName in the Sensor API - -**venderName** is changed to **vendorName**. - -**Change Impact** - -The **venderName** attribute cannot be used anymore. Use **vendorName** instead. - -**Key API/Component Changes** - -- Before change: - -```js - interface Sensor { - sensorName:string; /**< Sensor name */ - venderName:string; /**< Sensor vendor version */ - firmwareVersion:string; /**< Sensor firmware version */ - hardwareVersion:string; /**< Sensor hardware version */ - sensorId:number; /**< Sensor type ID, {@code SensorType} */ - maxRange:number; /**< Maximum measurement range of the sensor */ - minSamplePeriod:number; /**< Minimum sample period allowed, in ns */ - maxSamplePeriod:number; /**< maximum sample period allowed, in ns */ - precision:number; /**< Sensor accuracy */ - power:number; /**< Sensor power */ - } -``` - -- After change: - -```js - interface Sensor { - sensorName:string; /**< Sensor name */ - vendorName:string; /**< Sensor vendor version */ - firmwareVersion:string; /**< Sensor firmware version */ - hardwareVersion:string; /**< Sensor hardware version */ - sensorId:number; /**< Sensor type ID, {@code SensorType} */ - maxRange:number; /**< Maximum measurement range of the sensor */ - minSamplePeriod:number; /**< Minimum sample period allowed, in ns */ - maxSamplePeriod:number; /**< maximum sample period allowed, in ns */ - precision:number; /**< Sensor accuracy */ - power:number; /**< Sensor power */ - } -``` - -**Adaptation Guide** - -Replace **venderName** with **vendorName**. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-startup.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-startup.md deleted file mode 100644 index 506d8dccccf8f89a173b036c1bff4750af34b59d..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.2/changelogs-startup.md +++ /dev/null @@ -1,15 +0,0 @@ -# Startup Subsystem JS API Changelog - -## cl.startup.1 Bundle Name Change - -**Change Impact** - -The original bundle name **@ohos.systemParameterV9** will be deleted and cannot be used anymore. Use the new bundle name **@ohos.systemParameterEnhance** instead. - -**Adaptation Guide** - -Change the bundle name from **@ohos.systemParameterV9** to **@ohos.systemParameterEnhance**. The APIs remain unchanged. The following is the sample code: - -```js -import @ohos.systemParameterEnhance -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.3.3/changelogs-bundlemanager.md b/en/release-notes/changelogs/OpenHarmony_4.0.3.3/changelogs-bundlemanager.md deleted file mode 100644 index 867fa9fafd4e6edad6eb857250ab0cc6826df4ba..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.3.3/changelogs-bundlemanager.md +++ /dev/null @@ -1,111 +0,0 @@ -# Bundle Manager Subsystem Changelog -## cl.bundlemanager.1 Bottom-Layer Capability Changed So That Only the System Resource HAP Supports Custom Permissions - -Only the system resource HAP supports custom permissions. During HAP parsing, the bundle manager module parses the **definePermissions** field only in the configuration file of the resource HAP (bundle name: **ohos.global.systemres**), but not this field in other HAPs. This field is used to define permissions. -If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute). - - -**Change Impact**
-After an upgrade to the new version image, the custom permission of the application does not take effect, and the authorization fails. - -**Key API/Component Changes**
-The bottom-layer capability of the bundle manager module is changed. Only the system resource HAP supports custom permissions. - -**Adaptation Guide**
-If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute). - -## cl.bundlemanager.2 Level-2 Module File Names Changed - -The level-2 module file names of the bundle manager module are changed to their respective API names in the file, as listed below. - -| Original File Name|New File Name| -|----|----| -| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts | -| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts | -| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts | -| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts | -| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts | -| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts | -| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts | -| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts | -| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts | -| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts | -| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts | -| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts | -| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts | - -To sum up, except **packInfo**, which is changed to **BundlePackInfo**, the other file names are changed to start with uppercase letters. - -**Change Impact**
-The change of the level-2 module file names does not affect the use of the level-1 module. If a level-2 module interface under **bundleManager** is directly imported to the .ts file and an error is reported during compilation on DevEco Studio, you must change the name of the imported file. - -**Key API/Component Changes**
-The .d.ts file names in the **bundleManager** folder are changed to their respective API names in the file. - -**Adaptation Guide**
-Generally, no adaptation is required. If a file in the **bundleManager** folder is directly imported to the application, you must change the imported file name as follows: - -**Before change:** -```ts -import {AbilityInfo} from 'bundleManger/abilityInfo'; -import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo'; -import {BundlePackInfo} from 'bundleManger/packInfo'; -``` -**After change:** -```ts -import {AbilityInfo} from 'bundleManger/AbilityInfo'; -import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo'; -import {BundlePackInfo} from 'bundleManger/BundlePackInfo'; -``` - -## cl.bundlemanager.3 LaunchType Enum Type Name Changed from STANDARD to MULTITON - -The enum type name of [LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is changed from **STANDARD** to **MULTITON**. The enum value remains unchanged, indicating the multi-instance type. - -**Change Impact**
-The **LaunchType.STANDARD** type does not take effect. - -**Key API/Component Changes**
-The enum type name of **LaunchType** is changed from **STANDARD** to **MULTITON**. - -**Adaptation Guide**
-Change **LaunchType.STANDARD** to **LaunchType.MULTITON** for your application. - -## cl.bundlemanager.4 Changed the isVisible Field in the AbilityInfo Struct to exported - -The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities. - -**Change Impact**
-The **isVisible** field does not take effect. - -**Key API/Component Changes**
-The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged. - -**Adaptation Guide**
-Change **isVisible** to **exported** for your application. - -## cl.bundlemanager.5 Changed the isVisible Field in the ExtensionAbilityInfo Struct to exported - -The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities. - -**Change Impact**
-The **isVisible** field does not take effect. - -**Key API/Component Changes**
-The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged. - -**Adaptation Guide**
-Change **isVisible** to **exported** for your application. - -## cl.bundlemanager.6 Changed the visible Field in the ModuleAbilityInfo Struct to exported - -The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities. - -**Change Impact**
-The **visible** field does not take effect. - -**Key API/Component Changes**
-The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**, and the type remains unchanged. - -**Adaptation Guide**
-Change **visible** to **exported** for your application. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.5.1/changelog-resourceschedule.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.1/changelog-resourceschedule.md deleted file mode 100644 index 225ac70d1f4e080f5d83f0bcb768a9afbbc03e1f..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.1/changelog-resourceschedule.md +++ /dev/null @@ -1,32 +0,0 @@ -# Resource Scheduler Subsystem Changelog - -## cl.resourceschedule.workScheduler - -The WorkSchedulerExtensionAbility provides a default WorkSchedulerExtensionContext. - -**Change Impact** - -Applications developed based on OpenHarmony4.0.5.1 and later SDK versions can use the default context attribute as the context environment of a WorkSchedulerExtension. - -**Key API/Component Changes** - -The context attribute is added to **@ohos.WorkSchedulerExtensionAbility.d.ts**. The **application/WorkSchedulerExtensionContext.d.ts** file is added, which is inherited from ExtensionContext. - -| Module| Class| Method/Attribute/Enum/Constant| Change Type| -| -- | -- | -- | -- | -| @ohos.WorkSchedulerExtensionAbility.d.ts | WorkSchedulerExtensionAbility | context: WorkSchedulerExtensionContext; | Added| -| application/WorkSchedulerExtensionContext.d.ts | WorkSchedulerExtensionContext | - | Added| - -**Adaptation Guide** - -The context is obtained through a WorkSchedulerExtensionAbility child class instance. - -```ts -import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility'; - -class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { - onWorkStart(workInfo) { - let WorkSchedulerExtensionContext = this.context; // Obtain the WorkSchedulerExtensionContext. - } -} -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.5.2/changelogs-ability.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.2/changelogs-ability.md deleted file mode 100644 index 229a965c8cff75c6e3a95c415b5f2449e2b10535..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.2/changelogs-ability.md +++ /dev/null @@ -1,64 +0,0 @@ -# Ability Framework Changelog - -## Added the saveAppState API to cl.ability.appRecovery - -The API **saveAppState (context?: UIAbilityContext): boolean;** is added. - -**Change Impact** - -When developing an application based on OpenHarmony 4.0.5.2 or a later SDK version, you can use **saveAppState** with the ability context specified to save the state of the specified ability. - -**Key API/Component Changes** - -The **saveAppState** API is added to the **@ohos.app.ability.appRecovery.d.ts** file. - -| Module| Class| Method/Attribute/Enum/Constant| Change Type| -| -- | -- | -- | -- | -| @ohos.app.ability.appRecovery.d.ts | appRecovery | saveAppState(context?: UIAbilityContext): boolean; | Added| - -**Adaptation Guide** - -Call **saveAppState** with the UIAbility context specified to save the ability state. - -```ts -import appRecovery from '@ohos.app.ability.appRecovery'; -onBackground() { - hilog.info(0x0000, '[demo]', '%{public}s', 'EntryAbility onBackground'); - appRecovery.saveAppState(this.context) -} -``` -## Added the setRestartWant API to cl.ability.appRecovery. - -The API **setRestartWant (want: Want): void;** is added. - -**Change Impact** - -To develop an application based on OpenHarmony 4.0.5.2 or a later SDK version, you can use **setRestartWant** to set the ability to recover. - -**Key API/Component Changes** - -The **setRestartWant** API is added to the **@ohos.app.ability.appRecovery.d.ts** file. - -| Module| Class| Method/Attribute/Enum/Constant| Change Type| -| -- | -- | -- | -- | -| @ohos.app.ability.appRecovery.d.ts | appRecovery | setRestartWant(want: Want): void; | Added| - -**Adaptation Guide** - -Call **setRestartWant** to set the ability to recover. - -```ts -import appRecovery from '@ohos.app.ability.appRecovery'; -Button ("Start to Recover Ability") - .fontSize(40) - .fontWeight(FontWeight.Bold) - .onClick(()=> { - // set restart want - let want = { - bundleName: "ohos.samples.recovery", - abilityName: "RecoveryAbility" - }; - - appRecovery.setRestartWant(want); - }) -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.5.2/changelogs-miscdevice.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.2/changelogs-miscdevice.md deleted file mode 100644 index 100975f0aec6f581d517b3b2d0ee0e598de4388e..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.2/changelogs-miscdevice.md +++ /dev/null @@ -1,94 +0,0 @@ -# Pan-sensor Subsystem Changelog - -## cl.vibrator Added isSupportEffect - -The **isSupportEffect** API is added. - -**Change Impact** - -Applications developed based on OpenHarmony4.0.5.2 or a later SDK version can use **isSupportEffect** to check whether the passed effect ID is supported. - -**Key API/Component Changes** - -The **isSupportEffect** API is added in **@ohos.vibrator.d.ts**. - -| Module| Class| Method/Attribute/Enum/Constant| Change Type| -| -- | -- | -- | -- | -| @ohos.vibrator.d.ts | vibrator | isSupportEffect(effectId: string, callback: AsyncCallback<boolean>): void | Added| -| @ohos.vibrator.d.ts | vibrator | isSupportEffect(effectId: string): Promise<boolean> | Added| - -**Adaptation Guide** - -Call **isSupportEffect** to check whether the passed effect ID is supported. - -```ts -import vibrator from '@ohos.vibrator'; -try { - // Check whether 'haptic.clock.timer' is supported. - vibrator.isSupportEffect('haptic.clock.timer', function (err, state) { - if (err) { - console.error('isSupportEffect failed, error:' + JSON.stringify(err)); - return; - } - console.log('The effectId is ' + (state ? 'supported' : 'unsupported')); - if (state) { - try { - vibrator.startVibration({ // To use startVibration, you must configure the ohos.permission.VIBRATE permission. - type: 'preset', - effectId: 'haptic.clock.timer', - count: 1, - }, { - usage: 'unknown' - }, (error) => { - if(error) { - console.error('haptic.clock.timer vibrator error:' + JSON.stringify(error)); - } else { - console.log('haptic.clock.timer vibrator success'); - } - }); - } catch (error) { - console.error('Exception in, error:' + JSON.stringify(error)); - } - } - }) -} catch (error) { - console.error('Exception in, error:' + JSON.stringify(error)); -} -``` - -## cl.vibrator Added stopVibration - -The **stopVibration** API is added. - -**Change Impact** - -Applications developed based on OpenHarmony4.0.5.2 or a later SDK version can use **stopVibration** to stop vibration in all modes. - -**Key API/Component Changes** - -The **stopVibration** API is added in **@ohos.vibrator.d.ts**. - -| Module | Class | Method/Attribute/Enum/Constant | Change Type| -| ------------------- | -------- | -------------------------------------------------------- | -------- | -| @ohos.vibrator.d.ts | vibrator | stopVibration(callback: AsyncCallback<void>): void | Added | -| @ohos.vibrator.d.ts | vibrator | stopVibration(): Promise<void> | Added | - -**Adaptation Guide** - -Call **stopVibration** to stop vibration in all modes. - -```ts -import vibrator from '@ohos.vibrator'; -try { - // Stop vibration in all modes. - vibrator.stopVibration(function (error) { - if (error) { - console.log('error.code' + error.code + 'error.message' + error.message); - return; - } - console.log('Callback returned to indicate successful.'); - }) -} catch (error) { - console.info('errCode: ' + error.code + ' ,msg: ' + error.message); -} -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-imf.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-imf.md deleted file mode 100644 index f158d99d9a0023c67ad982fc6b687563121f4dac..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.3/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_4.0.5.3/changelog-screenlock.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-screenlock.md deleted file mode 100644 index deeaac319aecfd4ba2824b8f23370d6fe2601adc..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.3/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_4.0.5.3/changelog-wallpaper.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-wallpaper.md deleted file mode 100644 index 18fff418c0723c7508f6c7eacdb318b95758402b..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.3/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_4.0.5.5/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.5.5/changelogs-arkui.md deleted file mode 100644 index eaeba8adecf79591f6f27c06a4d8ba394d2fd42a..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.5.5/changelogs-arkui.md +++ /dev/null @@ -1,53 +0,0 @@ -# ArkUI Subsystem Changelog - -## cl.arkui.1 Change in the Default Scrollbar State of \ and \ Components - -Changed the default state of the scrollbar in the **\** and **\** components from **BarState.Off** to **BarState.Auto**. - -**Change Impact** - -In the scenario where the scrollbar status is not set in the **\** and **\** components: - -- Before change: - - The scrollbar is not displayed. - -- After change: - - The scrollbar is displayed during scrolling and is hidden 2 seconds after the scrolling stops. - -**Key API/Component Changes** - -**scrollBar** attribute of the **\** and **\** components: -- [List](../../../application-dev/reference/arkui-ts/ts-container-list.md#attributes) -- [Grid](../../../application-dev/reference/arkui-ts/ts-container-grid.md#attributes) - -**Adaptation Guide** - -In scenarios where the scrollbar is not required, set the **scrollBar** attribute of the **\** and **\** components to **BarState.Off**. - -The code snippet is as follows: -```ts -// xxx.ets -@Entry -@Component -struct ListItemExample { - private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - - build() { - Column() { - List({ space: 20, initialIndex: 0 }) { - ForEach(this.arr, (item) => { - ListItem() { - Text('' + item) - .width('100%').height(100).fontSize(16) - .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) - } - }, item => item) - } - .width('90%') - .scrollBar(BarState.Off) - }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) - } -} -``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelog-huks.md b/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelog-huks.md deleted file mode 100644 index 6541a61954eff4cfc1e55863c9ba2f7b5c5c13a3..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelog-huks.md +++ /dev/null @@ -1,30 +0,0 @@ -# HUKS Changelog - -## cl.huks.1 Change of the Permission for Using attestKeyItem - -The **attestKeyItem** interface attests a key using a public key encapsulated based on the device certificate chain. Any arbitrary export of the device certificate increases the risks on user privacy. Therefore, certain permissions are required for using this interface. - -**Change Impact** - -Applications without the **ohos.permission.ACCESS_IDS** permission or the system_basic or system_core permission cannot call **attestKeyItem()**. - -**Key API/Component Changes** - -- Involved APIs: - - attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\): void; - attestKeyItem(keyAlias: string, options: HuksOptions): Promise\; - -- Before change: - - The AccessToken permission is verified only for the applications that pass in a tag related to **ATTESTATION_ID**. - - -- After change: - - **attestKeyItem()** can be called only by a system application with the system_basic or system_core permission or an application with the **ohos.permission.ACCESS_IDS** permission. - -**Adaptation Guide** - -Applications with the system_basic or system_core permission can call **attestKeyItem()**. If an application with the normal permission needs to call **attestKeyItem()**, it must have the **ohos.permission.ACCESS_IDS** permission. For details about how to apply for the permission, see [ACL](../../../application-dev/security/accesstoken-overview.md#acl). - diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelog-web.md deleted file mode 100644 index a9ad760a1c58f12e013d2a7a9feeee6240cd37d2..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelog-web.md +++ /dev/null @@ -1,33 +0,0 @@ -# Web Subsystem Changelog - -Compared with earlier versions, OpenHarmony 4.0.6.1 has the following API changes in its web subsystem: - -## cl.web.1 Parameters in createWebMessagePorts - -Added an optional parameter to the **WebMessagePort** API to accommodate more data types. - -**Change Impact** - -None (The added parameter is optional, and the API is forward compatible.) - -**Key API/Component Changes** - -- Involved APIs: - - createWebMessagePorts(): Array\; - -- Before change: - - ```ts - createWebMessagePorts(): Array; - ``` - -- After change: - - ```ts - createWebMessagePorts(isExtentionType?: boolean): Array; - ``` - -**Adaptation Guide** - -N/A diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelogs-usb.md b/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelogs-usb.md deleted file mode 100644 index b8218c69f1ccde8d6f8e283f410e1dee64bb4364..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.6.1/changelogs-usb.md +++ /dev/null @@ -1,23 +0,0 @@ -# USB Subsystem API Changelog - -## cl.usb_manager.1 SDK API Deletion - -For applications developed based on earlier versions, you need to change the name of the imported bundle. Otherwise, the original service logic will be affected. - -**Key API/Component Changes** - -The **@ohos.usbV9.d.ts** file is replaced by the **@ohos.usbManager.d.ts** file. - -| New Bundle | Original Bundle | Deleted Bundle | -| -------------------- | ------------- | --------------- | -| ohos.usbManager.d.ts | ohos.usb.d.ts | ohos.usbV9.d.ts | - -You need to import **@ohos.usbManager** to use USB service APIs. - - ```ts - import usbManager from '@ohos.usbManager'; - ``` - -**Adaptation Guide** - -For details about usage of each API, see the [API Reference](../../../application-dev/reference/apis/js-apis-usbManager.md). diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.6.3/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.6.3/changelogs-arkui.md deleted file mode 100644 index 344aa3f1f64081b00755ac6b622dee3d0bbc5ad2..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.6.3/changelogs-arkui.md +++ /dev/null @@ -1,33 +0,0 @@ -# ArkUI Subsystem Changelog -Fixed the issue where the layout of child components in the [\](../../../application-dev/reference/arkui-ts/ts-container-stack.md) container does not follow the **alignContent** settings when the child components do not fit in the container. - -Example: - -```ts -@Entry -@Component -struct StackExample { - build() { - Stack({alignContent:Alignment.TopEnd}){ - Text('First child, show in bottom') - .width(200).height(200).backgroundColor(0xd2cab3).margin(10) - }.width(150).height(150).backgroundColor(Color.Pink).margin(100) - } -} -``` -Before: Child components are not arranged based on **alignContent:Alignment.TopEnd**. - -![stack](figures/stack_before.jpg) - -After: Child components are arranged based on **alignContent:Alignment.TopEnd**. - -![stack](figures/stack_after.jpg) - - -**Change Impact** - -The previous workaround – setting the **Offset** or **translate** attribute – needs to be removed. - -**Adaptation Guide** - -Remove the **Offset** and **translate** settings for the child components and use **alignContent** for layout. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.6.3/figures/stack_after.jpg b/en/release-notes/changelogs/OpenHarmony_4.0.6.3/figures/stack_after.jpg deleted file mode 100644 index eacfe82a9b1175a8a944be8a793ec940a4a80e0d..0000000000000000000000000000000000000000 Binary files a/en/release-notes/changelogs/OpenHarmony_4.0.6.3/figures/stack_after.jpg and /dev/null differ diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.6.3/figures/stack_before.jpg b/en/release-notes/changelogs/OpenHarmony_4.0.6.3/figures/stack_before.jpg deleted file mode 100644 index b7b26a73935e28ce34d9895ac3e0cf519bbb41b5..0000000000000000000000000000000000000000 Binary files a/en/release-notes/changelogs/OpenHarmony_4.0.6.3/figures/stack_before.jpg and /dev/null differ diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.7.1/changelog-huks.md b/en/release-notes/changelogs/OpenHarmony_4.0.7.1/changelog-huks.md deleted file mode 100644 index 7399cead068359b4b99337704f1dc42f7e77172a..0000000000000000000000000000000000000000 --- a/en/release-notes/changelogs/OpenHarmony_4.0.7.1/changelog-huks.md +++ /dev/null @@ -1,98 +0,0 @@ -# HUKS Changelog - -## cl.huks.1 HUKS Supports RsaPssSaltLengthType - -Before the change, the HUKS uses **RSA_PSS_SALT_LEN_MAX** for signing or signature verification by default. - -After the change, the type defined by **HuksRsaPssSaltLenType** is passed in for signature or signature verification. If **HuksRsaPssSaltLenType** is not passed in, **RSA_PSS_SALT_LEN_MAX** is used by default. - -**Change Impact** - -Behaviors of released JavaScript APIs have been changed. - -**Key API/Component Changes** - -Released JavaScript APIs remain unchanged, but the parameter set passed to the APIs are changed. - -**Adaptation Guide** - -The following uses RSA signing as an example. - -```js -import huks from '@ohos.security.huks'; - -let keyAlias = 'rsa_Key'; -let inData = new Uint8Array( - 0x4B, 0x1E, 0x22, 0x64, 0xA9, 0x89, 0x60, 0x1D, 0xEC, 0x78, 0xC0, 0x5D, 0xBE, 0x46, 0xAD, 0xCF, - 0x1C, 0x35, 0x16, 0x11, 0x34, 0x01, 0x4E, 0x9B, 0x7C, 0x00, 0x66, 0x0E, 0xCA, 0x09, 0xC0, 0xF3, -); -/* Parameters for signing */ -let signProperties = new Array(); -signProperties[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_RSA, -} -signProperties[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: - huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN -} -signProperties[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048, -} -signProperties[3] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_PSS, -} -signProperties[4] = { - tag: huks.HuksTag.HUKS_TAG_DIGEST, - value: huks.HuksKeyDigest.HUKS_DIGEST_SHA1, -} -signProperties[5] = { - tag: huks.HuksTag.HUKS_TAG_RSA_PSS_SALT_LEN_TYPE, - value: huks.HuksRsaPssSaltLenType.HUKS_RSA_PSS_SALT_LEN_MAX, -} -let signOptions = { - properties: signProperties, - inData: inData -} - -huks.initSession(keyAlias, signOptions); -``` - -For more information, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md). - -## cl.huks.2 Resolved the Issues in Storage or Export of Derived or Agreed Keys - -Before the change, the HUKS supports storage and export of derived keys and agreed keys, which poses security risks. - -After the change, the application needs to pass in **HuksKeyStorageType** for key derivation or key agreement. Only storage or export is allowed at a time. If this parameter is not passed in, both storage and export are supported by default, which poses security risks and is not recommended. - -**Change Impact** - -Behaviors of released JavaScript APIs have been changed. - -**Key API/Component Changes** - -Released JavaScript APIs remain unchanged, but the parameter set passed to the APIs are changed. - -**Adaptation Guide** - -For more information, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md). - -## cl.huks.3 Adding Tags for Fine-grained User Identity Access Control - -Added **HUKS_TAG_KEY_AUTH_PURPOSE** to **HuksTag** for fine-grained user identity access control. This tag specifies the user identity authentication used for specific algorithm. - -**Change Impact** - -The new HuksTag does not affect existing APIs. - -**Key API/Component Changes** - -**HuksTag** is added with **HUKS_TAG_KEY_AUTH_PURPOSE** to support fine-grained user identity access control. - -**Adaptation Guide** - -For more information, see [Fine-grained User Identity Authentication](../../../application-dev/security/huks-guidelines.md#fine-grained-user-identity-authentication) and [HuksTag](../../../application-dev/reference/apis/js-apis-huks.md#hukstag). diff --git a/en/release-notes/changelogs/v3.2-Release/Readme-EN.md b/en/release-notes/changelogs/v3.2-Release/Readme-EN.md new file mode 100644 index 0000000000000000000000000000000000000000..340e3f1e7826670138645e5e658b8aa387ac270e --- /dev/null +++ b/en/release-notes/changelogs/v3.2-Release/Readme-EN.md @@ -0,0 +1,8 @@ +# Readme + +- [Ability framework](changelogs-ability.md) +- [Bundle manager subsystem](changelogs-bundlemanager.md) +- [Resource scheduler subsystem](changelogs-resourceschedule.md) +- [Telephony subsystem](changelogs-telephony.md) +- [Util subsystem](changelogs-util.md) + diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md b/en/release-notes/changelogs/v3.2-Release/changelogs-ability.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md rename to en/release-notes/changelogs/v3.2-Release/changelogs-ability.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-bundlemanager.md b/en/release-notes/changelogs/v3.2-Release/changelogs-bundlemanager.md similarity index 69% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-bundlemanager.md rename to en/release-notes/changelogs/v3.2-Release/changelogs-bundlemanager.md index e90a0e21db43a89b2bad7e03ce388c7fdc35c2f7..2aa79ad27454a6277da0bb106de84c3529593d58 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-bundlemanager.md +++ b/en/release-notes/changelogs/v3.2-Release/changelogs-bundlemanager.md @@ -124,8 +124,8 @@ The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/i **Adaptation Guide**
Change **visible** to **exported** for your application. -## cl.bundlemanager.8 Deleted the distributedNotificationEnabled Tag from the app.json File -The [distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. +## cl.bundlemanager.8 Deleted the distributedNotificationEnabled Tag from the app.json Configuration File +The [distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -133,8 +133,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.9 Deleted the entityType Tag from the app.json File -The [entityType](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. +## cl.bundlemanager.9 Deleted the entityType Tag from the app.json Configuration File +The [entityType](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -142,8 +142,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.10 Deleted the keepAlive Tag from the app.json File -The [keepAlive](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. +## cl.bundlemanager.10 Deleted the keepAlive Tag from the app.json Configuration File +The [keepAlive](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -151,8 +151,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.11 Deleted the removable Tag from the app.json File -The [removable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. +## cl.bundlemanager.11 Deleted the removable Tag from the app.json Configuration File +The [removable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -160,8 +160,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.12 Deleted the singleton Tag from the app.json File -The [singleton](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. +## cl.bundlemanager.12 Deleted the singleton Tag from the app.json Configuration File +The [singleton](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -169,8 +169,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.13 Deleted the userDataClearable Tag from the app.json File -The [userDataClearable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** file. +## cl.bundlemanager.13 Deleted the userDataClearable Tag from the app.json Configuration File +The [userDataClearable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -178,8 +178,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.14 No Longer Chinese Characters for the name Tag under module in the module.json File -The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **module** in the **module.json** file does not support Chinese characters. +## cl.bundlemanager.14 No Longer Chinese Characters for the name Tag under module in the module.json Configuration File +The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **module** in the **module.json** configuration file does not support Chinese characters. **Change Impact**
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio. @@ -187,8 +187,8 @@ If the tag is set to Chinese, an error is reported during compilation on DevEco **Adaptation Guide**
Set this tag to English. -## cl.bundlemanager.15 No Longer Chinese Characters for the name Tag under ability in the module.json File -The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **ability** in the **module.json** file does not support Chinese characters. +## cl.bundlemanager.15 No Longer Chinese Characters for the name Tag under ability in the module.json Configuration File +The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **ability** in the **module.json** configuration file does not support Chinese characters. **Change Impact**
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio. @@ -196,8 +196,8 @@ If the tag is set to Chinese, an error is reported during compilation on DevEco **Adaptation Guide**
Set this tag to English. -## cl.bundlemanager.16 Deleted the uiSyntax Tag from the module.json File -The [uiSyntax](../../../application-dev/quick-start/module-configuration-file.md) tag is deleted from the **module.json** file. +## cl.bundlemanager.16 Deleted the uiSyntax Tag from the module.json Configuration File +The [uiSyntax](../../../application-dev/quick-start/module-configuration-file.md) tag is deleted from the **module.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -205,8 +205,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.17 Changed srcEntrance to srcEntry in the module.json File -The [srcEntrance](../../../application-dev/quick-start/module-configuration-file.md) tag under **module** and **ability** in the **module.json** file is changed to **srcEntry**. +## cl.bundlemanager.17 Changed srcEntrance to srcEntry in the module.json Configuration File +The [srcEntrance](../../../application-dev/quick-start/module-configuration-file.md) tag under **module** and **ability** in the **module.json** configuration file is changed to **srcEntry**. **Change Impact**
If the **srcEntrance** tag is used, an error is reported during compilation on DevEco Studio. @@ -214,8 +214,8 @@ If the **srcEntrance** tag is used, an error is reported during compilation on D **Adaptation Guide**
Replace the **srcEntrance** tag with **srcEntry** in the configuration file. -## cl.bundlemanager.18 Deleted the apiVersion Tag Under distroFilter from the module.json File -The **apiVersion** tag under [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) is deleted from the **module.json** file. +## cl.bundlemanager.18 Deleted the apiVersion Tag Under distroFilter from the module.json Configuration File +The **apiVersion** tag under [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) is deleted from the **module.json** configuration file. **Change Impact**
If this tag is used, an error is reported during compilation on DevEco Studio. @@ -223,8 +223,8 @@ If this tag is used, an error is reported during compilation on DevEco Studio. **Adaptation Guide**
Delete this tag from the configuration file. -## cl.bundlemanager.19 Changed distroFilter to distributionFilter in the module.json File -The [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** file is changed to **distributionFilter**. +## cl.bundlemanager.19 Changed distroFilter to distributionFilter in the module.json Configuration File +The [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** configuration file is changed to **distributionFilter**. **Change Impact**
If the **distroFilter** tag is used, an error is reported during compilation on DevEco Studio. @@ -232,14 +232,67 @@ If the **distroFilter** tag is used, an error is reported during compilation on **Adaptation Guide**
Replace **distroFilter** with **distributionFilter** in the configuration file. -## cl.bundlemanager.20 Changed standard of launchType to multiton in the module.json File +## cl.bundlemanager.20 Changed standard of launchType to multiton in the module.json Configuration File The **standard** mode of the [launchType](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** file is changed to **multiton**. **Adaptation Guide**
-Replace **standard** of **launchType** with **multiton** in the configuration file. +Replace **standard** of **launchType** to **multiton** in the configuration file. -## cl.bundlemanager.20 Changed visible of abilities to exported in the module.json File -The **visible** tag under [abilities](../../../application-dev/quick-start/module-configuration-file.md) in the [module.json] file is changed to **exported**, indicating whether the ability supports export and can be used by other ability. +## cl.bundlemanager.21 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.22 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.23 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.24 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.25 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**
-Replace **visible** under **abilities** with **exported** in the configuration file. +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.7/changelog-resourceschedule.md b/en/release-notes/changelogs/v3.2-Release/changelogs-resourceschedule.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-resourceschedule.md rename to en/release-notes/changelogs/v3.2-Release/changelogs-resourceschedule.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-telephony.md b/en/release-notes/changelogs/v3.2-Release/changelogs-telephony.md similarity index 86% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-telephony.md rename to en/release-notes/changelogs/v3.2-Release/changelogs-telephony.md index e2e631e1f4cdeecd88ba792956e8becc0e0bccab..b39b2012c1a52d6bce9bf7f3f2955fd6e49e4ce7 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-telephony.md +++ b/en/release-notes/changelogs/v3.2-Release/changelogs-telephony.md @@ -5,11 +5,11 @@ ## cl.telephony.1 Call Module reject API Change Changed the `reject` API to the `rejectCall` API in the call module of the telephony subsystem since API version 9. -You need to adapt your application. +You need to adapt your application based on the following information. **Change Impact** -The `reject` API is deprecated and cannot be used any more. Use the `rejectCall` API instead. Otherwise, relevant functions will be affected. +The `reject` API is deprecated and cannot be used anymore. Use the `rejectCall` API instead. Otherwise, relevant functions will be affected. - Involved APIs: @@ -44,7 +44,7 @@ The `reject` API is deprecated and cannot be used any more. Use the `rejectCall` **Adaptation Guide** -The `reject` API is deprecated and cannot be used any more. Use the `rejectCall` API instead. +The `reject` API is deprecated and cannot be used anymore. Use the `rejectCall` API instead. Use the new API. The sample code is as follows: ```js @@ -100,11 +100,11 @@ call.rejectCall(rejectMessageOptions, (err, data) => { ## cl.telephony.2 Call Module answer API Change Changed the `answer` API to the `answerCall` API in the call module of the telephony subsystem since API version 9. -You need to adapt your application. +You need to adapt your application based on the following information. **Change Impact** -The `answer` API is deprecated and cannot be used any more. Use the `answerCall` API instead. Otherwise, relevant functions will be affected. +The `answer` API is deprecated and cannot be used anymore. Use the `answerCall` API instead. Otherwise, relevant functions will be affected. - Involved APIs: @@ -133,7 +133,7 @@ The `answer` API is deprecated and cannot be used any more. Use the `answerCall` **Adaptation Guide** -The `answer` API is deprecated and cannot be used any more. Use the `answerCall` API instead. +The `answer` API is deprecated and cannot be used anymore. Use the `answerCall` API instead. Use the new API. The sample code is as follows: ```js @@ -163,11 +163,11 @@ call.answerCall((err, data) => { ## cl.telephony.1 Call Module hangup API Change Changed the `hangup` API to the `hangUpCall` API in the call module of the telephony subsystem since API version 9. -You need to adapt your application. +You need to adapt your application based on the following information. **Change Impact** -The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` API instead. Otherwise, relevant functions will be affected. +The `hangup` API is deprecated and cannot be used anymore. Use the `hangUpCall` API instead. Otherwise, relevant functions will be affected. - Involved APIs: @@ -196,7 +196,7 @@ The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` **Adaptation Guide** -The `hangup` API is deprecated and cannot be used any more. Use the `hangUpCall` API instead. +The `hangup` API is deprecated and cannot be used anymore. Use the `hangUpCall` API instead. Use the new API. The sample code is as follows: ```js diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-util.md b/en/release-notes/changelogs/v3.2-Release/changelogs-util.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-util.md rename to en/release-notes/changelogs/v3.2-Release/changelogs-util.md diff --git a/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md b/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md new file mode 100644 index 0000000000000000000000000000000000000000..a376c048c99bdf7b2073f41547ad5766c2322af5 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/Readme-EN.md @@ -0,0 +1,29 @@ +# Readme + +- [Ability framework](changelogs-ability.md) +- [Account subsystem](changelogs-account_os_account.md) +- [ArkUI development framework](changelogs-arkui.md) +- [Multimedia subsystem - camera](changelogs-camera.md) +- [Device management subsystem](changelogs-device-manager.md) +- [USB](changelogs-device-usb.md) +- [Distributed scheduler subsystem](changelogs-dmsfwk.md) +- [DSoftBus](changelogs-dsoftbus.md) +- [Customization subsystem](changelogs-enterprise_device_management.md) +- [File management subsystem](changelogs-filemanagement.md) +- [Location subsystem](changelogs-geolocation.md) +- [Globalization subsystem](changelogs-global.md) +- [Input method framework](changelogs-inputmethod-framworks.md) +- [Multimedia subsystem](changelogs-multimedia.md) +- [Multimodal input subsystem](changelogs-multimodalinput.md) +- [Common event and notification subsystem](changelogs-notification.md) +- [Power management subsystem](changelogs-power.md) +- [Upload and download](changelogs-request.md) +- [Resource manager subsystem](changelogs-resource-manager.md) +- [Resource scheduler subsystem](changelogs-resourceschedule.md) +- [Telephony subsystem](changelogs-telephony.md) +- [Test subsystem](changelogs-testfwk_arkxtest.md) +- [Theme](changelogs-theme.md) +- [User IAM subsystem](changelogs-useriam.md) +- [Ability framework - WantAgent](changelogs-wantAgent.md) +- [Web subsystem](changelogs-web.md) +- [Communication subsystem - WiFi](changelogs-wifi.md) diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.2/changelog-x-x.md b/en/release-notes/changelogs/v3.2-beta4/changelog-x-x.md similarity index 88% rename from en/release-notes/changelogs/OpenHarmony_3.2.9.2/changelog-x-x.md rename to en/release-notes/changelogs/v3.2-beta4/changelog-x-x.md index 3ac3e83268d2ac247676cd313d5b5e45d195ea2b..dcc7cd9aabb636ed248b5a37383410d4218b346f 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.2/changelog-x-x.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelog-x-x.md @@ -1,31 +1,26 @@ -# *Example* Subsystem ChangeLog +# *Example* Subsystem Changelog -Changes that affect contract compatibility of the last version should be described in the ChangeLog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. +Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. ## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) -Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of ChangeLog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). - +Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. - If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. -**Change Impacts** +**Change Impact** Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. - Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. **Key API/Component Changes** List the API/component changes involved in the function change. -**Adaptation Guide (Optional)** +**Adaptation Guide** Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. - Example: - Change parameter *n* to *m* in the *a* file. ``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-ability.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-ability.md similarity index 83% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-ability.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-ability.md index ae3d6a17cce9d488dff3f84765ca9f2cfc2260fe..111e725be013af24299c340cd541d385000f182c 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-ability.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-ability.md @@ -1,20 +1,21 @@ -# Ability Subsystem ChangeLog +# Ability Framework Changelog ## cl.ability.1 Application Component Startup Rule Change -The rules for starting application components of the ability subsystem are changed in the following scenarios: +The rules for starting application components are changed in the following scenarios: - - Start application components when the application is in the background. - - Start invisible application components across applications. - - Start **serviceAbility** and **dataAbility** of the FA model across applications. + - Start an application component when the application is in the background. + - Start an invisible application component across applications. + - Start a ServiceAbility and DataAbility of the FA model across applications. - Use the **startAbilityByCall** API. -You need to adapt your application based on the following information. +You need to adapt your application. -**Change Impacts** + +**Change Impact** If new rules are not adapted, application components cannot be started in the previous scenarios. -> **NOTE** +> **NOTE** > > Starting application components refers to any behavior starting or connecting to an ability. > @@ -69,13 +70,13 @@ If new rules are not adapted, application components cannot be started in the pr **Adaptation Guide** Startup rules for different scenarios are as follows: - - **Start application components when the application is in the background.** - - OpenHarmony 3.2 Beta3 rules: + - **Starting an application component when the application is in the background** + - Rule in OpenHarmony 3.2 Beta3: - - Starting application components when the application is in the background is not restricted. - - OpenHarmony 3.2 Beta4 rules: - - When the application is in the background, starting application components requires authentication. The following permission needs to be applied for: - ```json + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Authentication is required. The following permissions must be configured: + - ```json { "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", "grantMode": "system_grant", @@ -84,18 +85,19 @@ Startup rules for different scenarios are as follows: "distributedSceneEnable": false } ``` - > **NOTE** + > **NOTE** > - > 1. Starting components of the same application is also restricted by this rule. - > 2. For SDKs of API version 8 or earlier, starting **serviceAbility** and **dataAbility** is not restricted by this rule. + > 1. Starting an application component of the same application is also restricted by this rule. + > 2. For SDKs of API version 8 or earlier, starting a ServiceAbility and DataAbility is not restricted by this rule. + + - **Starting an invisible application component across applications** - - **Start invisible application components across applications.** - - OpenHarmony 3.2 Beta3 rules: + - Rule in OpenHarmony 3.2 Beta3: - For applications whose APL is normal, invisible application components cannot be started across applications. - - OpenHarmony 3.2 Beta4 rules: - - For all applications, starting invisible application components across applications requires authentication. The following permission needs to be applied for: - ```json + - Rule in OpenHarmony 3.2 Beta4: + - For all applications, starting an invisible application component across applications requires authentication. The following permissions must be configured: + - ```json { "name": "ohos.permission.START_INVISIBLE_ABILITY", "grantMode": "system_grant", @@ -103,26 +105,26 @@ Startup rules for different scenarios are as follows: "provisionEnable": true, "distributedSceneEnable": false } - ``` - - - **Start serviceAbility and dataAbility of the FA model across applications.** + ``` + + - **Starting a ServiceAbility and DataAbility of the FA model across applications** - - OpenHarmony 3.2 Beta3 rules: - - Starting **serviceAbility** and **dataAbility** across applications is not restricted. - - OpenHarmony 3.2 Beta4 rules: - - Associated startup needs to be configured for the provider of **serviceAbility** and **dataAbility**. Otherwise, **serviceAbility** and **dataAbility** cannot be started across applications. (Associated startup cannot be configured for common applications.) + - Rule in OpenHarmony 3.2 Beta3: + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Associated startup must be configured for the provider of the ServiceAbility and DataAbility. Otherwise, they cannot be started across applications. (Associated startup cannot be configured for common applications.) - - **Use the startAbilityByCall API.** - - OpenHarmony 3.2 Beta3 rules: + - **Using the startAbilityByCall API** + - Rule in OpenHarmony 3.2 Beta3: - - The API call is not restricted. - - OpenHarmony 3.2 Beta4 rules: + - This is no restriction. + - Rule in OpenHarmony 3.2 Beta4: - The **startAbilityByCall** API cannot be called by the same application. - - Calling the **startAbilityByCall** API across applications requires authentication. The following permission needs to be applied for: + - Calling the **startAbilityByCall** API across applications requires authentication. The following permissions must be configured: - ```json + - ```json { "name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION", "grantMode": "system_grant", @@ -137,24 +139,24 @@ Startup rules for different scenarios are as follows: ## cl.ability.2 Cross-Device Application Component Startup Rule Change (for System Applications Only) -The rules for starting cross-device application components of the ability subsystem are changed in the following scenarios: +The rules for starting cross-device application components are changed in the following scenarios: - - Start application components when the application is in the background. - - Start invisible application components across applications. - - Start **serviceAbility** of the FA model across applications. + - Start an application component when the application is in the background. + - Start an invisible application component across applications. + - Start a ServiceAbility of the FA model across applications. -You need to adapt your application based on the following information. +You need to adapt your application. -**Change Impacts** +**Change Impact** If new rules are not adapted, application components cannot be started in the previous scenarios. ->**NOTE** +> **NOTE** > ->Starting application components refers to any behavior starting or connecting to an ability. +> Starting application components refers to any behavior starting or connecting to an ability. > ->1. Start an ability using APIs such as **startAbility**, **startAbilityForResult**, and **startAbilityByCall**. ->2. Connect to an ability using APIs such as **connectAbility**. +> 1. Start an ability using APIs such as **startAbility**, **startAbilityForResult**, and **startAbilityByCall**. +> 2. Connect to an ability using APIs such as **connectAbility**. **Key API/Component Changes** @@ -181,13 +183,13 @@ If new rules are not adapted, application components cannot be started in the pr **Adaptation Guide** Startup rules for different scenarios are as follows: - - **Start application components when the application is in the background.** - - OpenHarmony 3.2 Beta3 rules: + - **Starting an application component when the application is in the background** + - Rule in OpenHarmony 3.2 Beta3: - - Starting application components when the application is in the background is not restricted. - - OpenHarmony 3.2 Beta4 rules: - - When the application is in the background, starting application components requires authentication. The following permission needs to be applied for: - ```json + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Authentication is required. The following permissions must be configured: + - ```json { "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", "grantMode": "system_grant", @@ -196,18 +198,18 @@ Startup rules for different scenarios are as follows: "distributedSceneEnable": false } ``` - > **NOTE** - > - > 1. Starting components of the same application is also restricted by this rule. - > 2. For SDKs of API version 8 or earlier, starting **serviceAbility** is not restricted by this rule. + > **NOTE** + 1. Starting an application component of the same application is also restricted by this rule. + 2. For SDKs of API version 8 or earlier, starting a ServiceAbility is not restricted by this rule. + + - **Starting an invisible application component across applications** - - **Start invisible application components across applications.** - - OpenHarmony 3.2 Beta3 rules: + - Rule in OpenHarmony 3.2 Beta3: - Invisible application components cannot be started across applications. - - OpenHarmony 3.2 Beta4 rules: - - Starting invisible application components across applications requires authentication. The following permission needs to be applied for: - ```json + - Rule in OpenHarmony 3.2 Beta4: + - Authentication is required. The following permissions must be configured: + - ```json { "name": "ohos.permission.START_INVISIBLE_ABILITY", "grantMode": "system_grant", @@ -215,31 +217,31 @@ Startup rules for different scenarios are as follows: "provisionEnable": true, "distributedSceneEnable": false } - ``` + ``` - - **Start serviceAbility of the FA model across applications.** + - **Starting a ServiceAbility of the FA model across applications** - - OpenHarmony 3.2 Beta3 rules: + - Rule in OpenHarmony 3.2 Beta3: - - Starting **serviceAbility** across applications is not restricted. - - OpenHarmony 3.2 Beta4 rules: - - Associated startup needs to be configured for the **serviceAbility** provider application. Otherwise, **serviceAbility** cannot be started across applications. (Associated startup cannot be configured for common applications.) + - There is no restriction. + - Rule in OpenHarmony 3.2 Beta4: + - Associated startup needs to be configured for the provider of the ServiceAbility. Otherwise, the ServiceAbility cannot be started across applications. (Associated startup cannot be configured for common applications.) - Configure associated startup as follows: - ```json + - ```json { "bundleName": "", "app_signature": ["xxxxxxxxxxxxxxxxxxx"], "associatedWakeUp": true } - ``` + ``` ## cl.ability.3 API Exception Handling Method Change Certain APIs of the ability subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. -**Change Impacts** +**Change Impact** -The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. +The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected. **Key API/Component Changes** @@ -275,7 +277,7 @@ For adaptation to the unified API exception handling mode, certain ability subsy **Adaptation Guide** -The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. +The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. If the original API uses **@ohos.application.missionManager**: @@ -293,11 +295,11 @@ In addition, exception handling is needed. For details, see the API reference fo ## cl.ability.4 API Change -The names of some ability subsystem APIs are changed. +The names of certain ability subsystem APIs are changed. **Key API/Component Changes** -| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| Module | Class | Method/Attribute/Enum/Constant | Change Type| | ----------------------------------------- | ----------------------- | ------------------------------------------------------------ | -------- | | @ohos.application.Ability | Caller | onRelease(callback: OnReleaseCallBack): **void**; | Deprecated | | @ohos.app.ability.UIAbility | Caller | on(**type**: "release", callback: OnReleaseCallBack): **void**; | Added | diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-account_os_account.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..6a768be1685140abcb5d5b8301e95d0803d38698 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-account_os_account.md @@ -0,0 +1,233 @@ +# Account Subsystem Changelog + +## cl.account_os_account.1 Change of Definition and Return Mode of Error Codes + +To ensure consistent error codes and normalized return of error codes in the account subsystem APIs, the following changes are made in API version 9: + +- Added the following error code definitions: [Account Error Codes](../../../application-dev/reference/errorcodes/errorcode-account.md) + +- Changed the error code return modes as follows: + - Asynchronous APIs: Return error information in the **error** object of **AsyncCallback** or **Promise**. Throw an exception to return an error related to the parameter type or quantity. + - Synchronous APIs: Throw an exception to return an error message. + +**Change Impact** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the service logic will be affected. + +**Key API/Component Changes** + +Involved 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 describe 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 bussiness error + console.log("account_osAccount failed, error: " + JSON.stringify(err)); + } else { + console.log("account_osAccount successfully"); + } +} +try { + accountMgr.activateOsAccount("100", callbackFunc); +} catch (err) { // handle the parameter type error + console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err)); +} +try { + accountMgr.activateOsAccount(); +} catch (err) { // handle the parameter number error + console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err)); +} +``` + +The following uses **registerInputer** as an example to describe 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) { // handle the parameter type error + console.log("account_osAccount failed for incorrect parameter type, error: " + JSON.stringify(err)); +} +try { + pinAuth.registerInputer() +} catch (err) { // handle the parameter number error + console.log("account_osAccount failed for incorrect parameter number, error: " + JSON.stringify(err)); +} +``` + +# Account Subsystem Changelog + +## cl.account_os_account.2 Change in Error Information Return of Account System APIs + +Some system APIs of the account subsystem use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9: + +Asynchronous APIs: Return error information in the **error** object of **AsyncCallback** or **Promise**. + +Synchronous APIs: Throw an exception to return error information. + +**Change Impact** + +The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected. + +**Key API/Component Changes** + +Before change: + + - class UserAuth + - setProperty(request: SetPropertyRequest, callback: AsyncCallback<number>): void; + - setProperty(request: SetPropertyRequest): Promise<number>; + - cancelAuth(contextID: Uint8Array): number; + - class PINAuth + - registerInputer(inputer: Inputer): boolean; + - UserIdentityManager + - cancel(challenge: Uint8Array): number; + +After change: + + - class UserAuth + - setProperty(request: SetPropertyRequest, callback: AsyncCallback<void>): void; + - setProperty(request: SetPropertyRequest): Promise<void>; + - cancelAuth(contextID: Uint8Array): void; + - class PINAuth + - registerInputer(inputer: Inputer): void; + - UserIdentityManager + - cancel(challenge: Uint8Array): void; + +**Adaptation Guide** + +The following uses **setProperty** as an example for asynchronous APIs: + +``` +import account_osAccount from "@ohos.account.osAccount" +userAuth.setProperty({ + authType: account_osAccount.AuthType.PIN, + key: account_osAccount.SetPropertyType.INIT_ALGORITHM, + setInfo: new Uint8Array([0]) +}, (err) => { + if (err) { + console.log("setProperty failed, error: " + JSON.stringify(err)); + } else { + console.log("setProperty successfully"); + } +}); + +userAuth.setProperty({ + authType: account_osAccount.AuthType.PIN, + key: account_osAccount.SetPropertyType.INIT_ALGORITHM, + setInfo: new Uint8Array([0]) +}).catch((err) => { + if (err) { + console.log("setProperty failed, error: " + JSON.stringify(err)); + } else { + console.log("setProperty successfully"); + } +}); +``` + +The following uses **registerInputer** as an example for synchronous APIs: + +``` +import account_osAccount from "@ohos.account.osAccount" +let pinAuth = new account_osAccount.PINAuth() +let inputer = { + onGetData: (authType, passwordRecipient) => { + let password = new Uint8Array([0]); + passwordRecipient.onSetData(authType, password); + } +} +try { + pinAuth.registerInputer(inputer); +} catch (err) { + console.log("registerInputer failed, error: " + JSON.stringify(err)); +} +``` + +## cl.account_os_account.3 ACTION Definition Change for the Application Account Authentication Service + +**Change Impact** + +For the application developed based on an earlier version, you need to modify **ACTION** in the application configuration file (**config.json** for the FA model and **module.json5** for the stage model). Otherwise, the application authentication service will be affected. + +**Key API/Component Changes** + +Involved constant: + +@ohos.ability.wantConstant.ACTION_APP_ACCOUNT_AUTH + +Before change: + +ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth" + +After change: + +ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth" + +**Adaptation Guide** + +For a third-party application providing the account authentication service, change **ACTION** in the **ServiceAbility** configuration file (**config.json** for the FA module or **module.json5** for the stage module). + +``` +"abilities": [ + { + "name": "ServiceAbility", + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + ... + "visible": true, + "skills": { + { + "actions": [ + "ohos.appAccount.action.auth" + ] + } + } + }] +} + +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md similarity index 67% rename from en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md index 80e5645eba71f86ec75134e366d436164a961802..9122b5fa26084abcbee3157456d0944c89da6133 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md @@ -2,15 +2,15 @@ ## cl.arkui.1 xcomponent API Change -The following APIs of the **xcomponent** component of the ArkUI subsystem are changed: +Changed the following APIs of the **xcomponent** component of the ArkUI subsystem: - - **getXComponentSurfaceId** and **setXComponentSurfaceSize**: The **@systemapi** tag is removed. - - **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: The return value types are specified. + - **getXComponentSurfaceId** and **setXComponentSurfaceSize**: Removed the **@systemapi** tag. + - **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: Specified the return value type. -You need to adapt your applications based on the following information. +You need to adapt your application based on the following information. -**Change Impacts** +**Change Impact** Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. @@ -23,11 +23,10 @@ Released JS APIs are affected. The application needs to adapt these APIs so that **Adaptation Guide** Startup rules for different scenarios are as follows: - Adaptions to be made: - **getXComponentSurfaceId** - - OpenHarmony 3.2 Beta3 rules: + - Rule in OpenHarmony 3.2 Beta3: - System API - No specified return value - OpenHarmony 3.2 Beta4 rules: @@ -35,7 +34,7 @@ Adaptions to be made: - Return value type specified as string - You need to process the return value as a string. - **setXComponentSurfaceSize** - - OpenHarmony 3.2 Beta3 rules: + - Rule in OpenHarmony 3.2 Beta3: - System API - No specified return value - OpenHarmony 3.2 Beta4 rules: @@ -43,21 +42,21 @@ Adaptions to be made: - Return value type specified as void - You need to process the return value as a void. - **getXComponentContext** - - OpenHarmony 3.2 Beta3 rules: + - Rule in OpenHarmony 3.2 Beta3: - No specified return value - OpenHarmony 3.2 Beta4 rules: - Return value type specified as object - You need to process the return value as an object. - + ## cl.arkui.2 Change of Styles of Popup Component and APIs -The styles of the **alertDialog**, **actionSheet**, and **customDialog** components, as well as the **prompt** and **promptAction** APIs were changed. Specifically speaking: +Changed the styles of the **alertDialog**, **actionSheet**, and **customDialog** components, as well as the **prompt** and **promptAction** APIs. Specifically speaking: -The popup background blurring effect is added to **promptAction.showDialog**, **promptAction.showActionMenu**, **alertDialog**, **actionSheet**, and **customDialog**. + - Added the popup background blur effect to **promptAction.showDialog**, **promptAction.showActionMenu**, **alertDialog**, **actionSheet**, and **customDialog**. -**Change Impacts** +**Change Impact** -The popup background blurring effect is set by default. +The popup background blur effect is set by default. **Key API/Component Changes** @@ -70,15 +69,16 @@ No adaptation is required. ## cl.arkui.3 Supplementation of the Initialization Mode and Restriction Verification Scenarios of Custom Components' Member Variables -For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). +For details, see **Restrictions and Extensions**. + -**Change Impacts** +**Change Impact** If custom components' member variables are initialized or assigned with values not according to the document specifications, an error will be reported during compilation. **Key API/Component Changes** -N/A +N/A. **Adaptation Guide** @@ -86,16 +86,16 @@ Make modification according to specifications in the above document. ## cl.arkui.4 Supplementation of Verification Scenarios of Value Assignment Restrictions on Member Variables of Custom Parent Components and Child Components -For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). +For details, see **Restrictions and Extensions**. -**Change Impacts** +**Change Impact** If member variables of the parent component or child component are initialized not according to the document specifications, an error will be reported during compilation. **Key API/Component Changes** -N/A +N/A. **Adaptation Guide** @@ -103,12 +103,12 @@ Make modification according to specifications in the above document, using other ## cl.arkui.5 Supplementation of Verification for a Single Subcomponent -Verification for a single subcomponent is enabled for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**. +Added the check rule that allows only one child component to be enabled for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**. -**Change Impacts** +**Change Impact** -If one of the preceding components contains more than one subcomponent, an error will be reported during compilation. +If one of the preceding components contains more than one child component, an error will be reported during compilation. **Key API/Component Changes** @@ -123,4 +123,4 @@ RichText('RichText') { **Adaptation Guide** -Make modification based on the error message. Make sure that the specified component contains only one subcomponent. +Make modification based on the error message. Make sure that the specified component contains only one child component. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-camera.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-camera.md similarity index 92% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-camera.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-camera.md index 16559935d6dba10f19739a84c4fe45c11855298f..f7acbc22c91eed241e6ddfa34e041f87ece63130 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-camera.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-camera.md @@ -1,6 +1,4 @@ -# ChangeLog of JS API Changes in the Multimedia Subsystem - -Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2 Beta4 has the following changes in APIs of the camera component in the multimedia subsystem. +# Multimedia Subsystem Changelog ## Camera API Changes Some functional APIs are added and some others are deprecated to: @@ -10,13 +8,13 @@ Some functional APIs are added and some others are deprecated to: You need to refer to the following change description to adapt your application. -**Change Impacts** +**Change Impact** -JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. **Key API/Component Changes** -| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| Module | Class | Method/Attribute/Enum/Constant | Change Type| | ---------------------- | ----------------------- | ------------------------------------------------------------ | -------- | | ohos.multimedia.camera | Profile | readonly format:CameraFormat; | Added | | ohos.multimedia.camera | Profile | readonly size: Size; | Added | @@ -195,7 +193,7 @@ In Beta4 and later versions, the following APIs are changed. getSupportedOutputCapability(camera: CameraDevice): Promise; - The sample code is as follows: + The code snippet is as follows: ``` cameraManager.getSupportedCameras().then((cameras) => { @@ -221,7 +219,7 @@ In Beta4 and later versions, the following APIs are changed. 6. The **isCameraMuted(): boolean;** API is added to **CameraManager**. - The sample code is as follows: + The code snippet is as follows: ``` let ismuted = cameraManager.isCameraMuted(); @@ -229,7 +227,7 @@ In Beta4 and later versions, the following APIs are changed. 7. The **isCameraMuteSupported(): boolean;** API is added to **CameraManager**. - The sample code is as follows: + The code snippet is as follows: ``` let ismutesuppotred = cameraManager.isCameraMuteSupported(); @@ -237,7 +235,7 @@ In Beta4 and later versions, the following APIs are changed. 8. The **muteCamera(mute: boolean): void;** API is added to **CameraManager**. - The sample code is as follows: + The code snippet is as follows: ``` let mute = true; @@ -246,7 +244,7 @@ In Beta4 and later versions, the following APIs are changed. 9. The **on(type: 'cameraMute', callback: AsyncCallback): void;** API is added to **CameraManager**. - The sample code is as follows: + The code snippet is as follows: ``` cameraManager.on('cameraMute', (err, curMuetd) => { @@ -259,27 +257,27 @@ In Beta4 and later versions, the following APIs are changed. 10. The **open(callback: AsyncCallback): void;** and **open(): Promise;** APIs are added to **CameraInput**. -The sample code is as follows: + The code snippet is as follows: -``` -cameraInput.open((err) => { - if (err) { - console.error(`Failed to open the camera. ${err.message}`); - return; - } - console.log('Callback returned with camera opened.'); -}) -``` + ``` + cameraInput.open((err) => { + if (err) { + console.error(`Failed to open the camera. ${err.message}`); + return; + } + console.log('Callback returned with camera opened.'); + }) + ``` -``` -cameraInput.open().then(() => { - console.log('Promise returned with camera opened.'); -}) -``` + ``` + cameraInput.open().then(() => { + console.log('Promise returned with camera opened.'); + }) + ``` 11. The **close(callback: AsyncCallback): void;** and **close(): Promise;** APIs are added to **CameraInput**. - The sample code is as follows: + The code snippet is as follows: ``` cameraInput.close((err) => { @@ -297,25 +295,25 @@ cameraInput.open().then(() => { }) ``` -12. The following enumerations are added to **CameraInputErrorCode**: +12. The following enums are added to **CameraInputErrorCode**: - Enumeration: ERROR_NO_PERMISSION; value: 0 + Enum: ERROR_NO_PERMISSION; value: 0 - Enumeration: ERROR_DEVICE_PREEMPTED; value: 1 + Enum: ERROR_DEVICE_PREEMPTED; value: 1 - Enumeration: ERROR_DEVICE_DISCONNECTED; value: 2 + Enum: ERROR_DEVICE_DISCONNECTED; value: 2 - Enumeration: ERROR_DEVICE_IN_USE; value: 3 + Enum: ERROR_DEVICE_IN_USE; value: 3 - Enumeration: ERROR_DRIVER_ERROR; value: 4 + Enum: ERROR_DRIVER_ERROR; value: 4 -13. The following enumeration is added to **CameraFormat**: +13. The following enum is added to **CameraFormat**: - Enumeration: CAMERA_FORMAT_RGBA_8888; value: 3 + Enum: CAMERA_FORMAT_RGBA_8888; value: 3 14. The **getMeteringPoint(callback: AsyncCallback): void;** and **getMeteringPoint(): Promise;** APIs are added to **CaptureSession**. - The sample code is as follows: + The code snippet is as follows: ``` captureSession.getMeteringPoint((err, exposurePoint) => { @@ -335,7 +333,7 @@ cameraInput.open().then(() => { 15. The **setMeteringPoint(point: Point, callback: AsyncCallback): void;** and **setMeteringPoint(point: Point): Promise;** APIs are added to **CaptureSession**. - The sample code is as follows: + The code snippet is as follows: ``` const Point1 = {x: 1, y: 1}; @@ -357,11 +355,11 @@ cameraInput.open().then(() => { }) ``` -16. The following enumerations are added to **CaptureSessionErrorCode**: +16. The following enums are added to **CaptureSessionErrorCode**: - Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 + Enum: ERROR_INSUFFICIENT_RESOURCES; value: 0 - Enumeration: ERROR_TIMEOUT; value: 1 + Enum: ERROR_TIMEOUT; value: 1 17. The **CameraOutput** API is added and contains the **release(callback: AsyncCallback): void;** and **release(): Promise;** methods. @@ -385,7 +383,7 @@ cameraInput.open().then(() => { 18. The **start(callback: AsyncCallback): void;** and **start(): Promise;** APIs are added to **PreviewOutput**. - The sample code is as follows: + The code snippet is as follows: ``` previewOutput.start((err) => { @@ -405,7 +403,7 @@ cameraInput.open().then(() => { 19. The **stop(callback: AsyncCallback): void;** and **stop(): Promise;** APIs are added to **PreviewOutput**. - The sample code is as follows: + The code snippet is as follows: ``` previewOutput.stop((err) => { @@ -427,21 +425,21 @@ cameraInput.open().then(() => { Attribute 1: mirror?; type: boolean -21. The following enumerations are added to **PhotoOutputErrorCode**: +21. The following enums are added to **PhotoOutputErrorCode**: - Enumeration: ERROR_DRIVER_ERROR; value: 0 + Enum: ERROR_DRIVER_ERROR; value: 0 - Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 1 + Enum: ERROR_INSUFFICIENT_RESOURCES; value: 1 - Enumeration: ERROR_TIMEOUT; value: 2 + Enum: ERROR_TIMEOUT; value: 2 -22. The following enumeration is added to **VideoOutputErrorCode**: +22. The following enum is added to **VideoOutputErrorCode**: - Enumeration: ERROR_DRIVER_ERROR; value: 0 + Enum: ERROR_DRIVER_ERROR; value: 0 23. The **on(type: 'error', callback: ErrorCallback): void;** API is added to **MetadataOutput**. - The sample code is as follows: + The code snippet is as follows: ``` metadataOutput.on('error', (metadataOutputError) => { @@ -449,11 +447,11 @@ cameraInput.open().then(() => { }) ``` -24. The following enumerations are added to **MetadataOutputErrorCode**. +24. The following enums are added to **MetadataOutputErrorCode**. - Enumeration: ERROR_UNKNOWN; value: -1 + Enum: ERROR_UNKNOWN; value: -1 - Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 + Enum: ERROR_INSUFFICIENT_RESOURCES; value: 0 25. **MetadataOutputError** API @@ -489,7 +487,7 @@ cameraInput.open().then(() => { 1. In **CameraManager**, the return value of **getCameras** is changed from **Array** to **Array**, and the API name is changed from **getCameras** to **getSupportedCameras**. Therefore, the **getCameras(callback: AsyncCallback>): void;** and **getCameras(): Promise>;** APIs are changed to **getSupportedCameras(callback: AsyncCallback>): void** and **getSupportedCameras(): Promise>;**. - The sample code is as follows: + The code snippet is as follows: ``` cameraManager.getSupportedCameras((err, cameras) => { @@ -509,7 +507,7 @@ cameraInput.open().then(() => { 2. In **CameraManager**, the input parameter of **createCameraInput** is changed from **cameraId: string** to **camera: CameraDevice**. Therefore, the **createCameraInput(cameraId: string, callback: AsyncCallback): void;** and **createCameraInput(cameraId: string): Promise;** APIs are changed to **createCameraInput(camera: CameraDevice, callback: AsyncCallback): void;** and **createCameraInput(camera: CameraDevice): Promise;**. - The sample code is as follows: + The code snippet is as follows: ``` let cameraDevice = cameras[0]; @@ -531,7 +529,7 @@ cameraInput.open().then(() => { 3. In **CameraManager**, the input parameter **profile: Profile** is added to **createPreviewOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createPreviewOutput(surfaceId: string, callback: AsyncCallback): void;** and **createPreviewOutput(surfaceId: string): Promise;** APIs are changed to **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise;**. - The sample code is as follows: + The code snippet is as follows: ``` let profile = cameraoutputcapability.previewProfiles[0]; @@ -553,7 +551,7 @@ cameraInput.open().then(() => { 4. In **CameraManager**, the input parameter **profile: Profile** is added to **createPhotoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **CreatePhotoOutput(surfaceId: string, callback: AsyncCallback): void;** and **CreatePhotoOutput(surfaceId: string): Promise;** APIs are changed to **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise;**. - The sample code is as follows: + The code snippet is as follows: ``` let profile = cameraoutputcapability.photoProfiles[0]; @@ -575,7 +573,7 @@ cameraInput.open().then(() => { 5. In **CameraManager**, the input parameter **profile: Profile** is added to **createVideoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createVideoOutput(surfaceId: string, callback: AsyncCallback): void;** and **createVideoOutput(surfaceId: string): Promise;** APIs are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void;** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise;**. - The sample code is as follows: + The code snippet is as follows: ``` let profile = cameraoutputcapability.videoProfiles[0]; @@ -597,7 +595,7 @@ cameraInput.open().then(() => { 6. In **CameraManager**, the input parameter **metadataObjectTypes: Array** is added to **createMetadataOutput**, and the **metadataObjectTypes** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **function createMetadataOutput(callback: AsyncCallback): void;** and **function createMetadataOutput(): Promise;** APIs are changed to **createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void;** and **createMetadataOutput(metadataObjectTypes: Array): Promise;**. - The sample code is as follows: + The code snippet is as follows: ``` let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; @@ -619,7 +617,7 @@ cameraInput.open().then(() => { 7. In **CameraManager**, **createCaptureSession** does not need to consider the context attribute. Therefore, the **createCaptureSession(context: Context, callback: AsyncCallback): void;** and **createCaptureSession(context: Context): Promise;** APIs are changed to **createCaptureSession(callback: AsyncCallback): void;** and **createCaptureSession(): Promise;**. - The sample code is as follows: + The code snippet is as follows: ```typescript cameraManager.createCaptureSession((err, captureSession) => { @@ -641,7 +639,7 @@ cameraInput.open().then(() => { 9. In **CameraInput**, the input parameter **camera: CameraDevice** is added to the **on(type: 'error')** API. Therefore, the **on(type: 'error', callback: ErrorCallback): void;** API is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void;**. - The sample code is as follows: + The code snippet is as follows: ``` let cameraDevice = cameras[0]; @@ -696,7 +694,7 @@ cameraInput.open().then(() => { 11. The **on(type: 'focusStateChange', callback: AsyncCallback): void;** API is moved from **CameraInput** to **CaptureSession**. - The sample code is as follows: + The code snippet is as follows: ``` captureSession.on('focusStateChange', (focusState) => { @@ -704,23 +702,23 @@ cameraInput.open().then(() => { }) ``` -12. The following enumerations are added to **ExposureMode**: +12. The following enums are added to **ExposureMode**: - Enumeration: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1** + Enum: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1** - Enumeration: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2** + Enum: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2** -13. The following enumerations are added to **VideoStabilizationMode**: +13. The following enums are added to **VideoStabilizationMode**: - Enumeration: LOW; initial value: changed from the default value to **1** + Enum: LOW; initial value: changed from the default value to **1** - Enumeration: MIDDLE; initial value: changed from the default value to **2** + Enum: MIDDLE; initial value: changed from the default value to **2** - Enumeration: HIGH; initial value: changed from the default value to **3** + Enum: HIGH; initial value: changed from the default value to **3** - Enumeration: AUTO; initial value: changed from the default value to **4** + Enum: AUTO; initial value: changed from the default value to **4** -14. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original subclass type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. +14. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original child class type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. APIs before change: @@ -730,7 +728,7 @@ cameraInput.open().then(() => { addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
addOutput(cameraOutput: CameraOutput): Promise; - The sample code (for **PreviewOutput**) is as follows: + The sample code (for **previewOutput**) is as follows: ``` captureSession.addOutput(previewOutput, (err) => { @@ -748,7 +746,7 @@ cameraInput.open().then(() => { }) ``` -15. In **CaptureSession**, the parameter of the **removeOutput** API is changed from the original subclass type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. +15. In **CaptureSession**, the parameter of the **removeOutput** API is changed from the original child class type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. APIs before change: @@ -758,7 +756,7 @@ cameraInput.open().then(() => { removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
removeOutput(cameraOutput: CameraOutput): Promise; - The sample code (for **PreviewOutput**) is as follows: + The sample code (for **previewOutput**) is as follows: ``` captureSession.removeOutput(previewOutput, (err) => { @@ -776,8 +774,8 @@ cameraInput.open().then(() => { }) ``` -16. The following enumeration in **MetadataObjectType** is changed: +16. The following enum in **MetadataObjectType** is changed: - The enumeration value name is changed from **FACE** to **FACE_DETECTION**. + The enum value name is changed from **FACE** to **FACE_DETECTION**. 17. The name of the **Camera** API is changed to **CameraDevice**. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-manager.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-manager.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-usb.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-device-usb.md similarity index 95% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-usb.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-device-usb.md index cc7d82ae7758a9be105037bfc60c9ab7eb54b0b1..9890002af31ae8d36e4f645adfc2d920000fe936 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-device-usb.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-device-usb.md @@ -1,10 +1,10 @@ -# USB Manager ChangeLog +# USB Manager Changelog ## cl.usb_manager.1 Error Information Return Method Change of APIs The USB manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. Beginning from API version 9, error information is returned by throwing exceptions. -**Change Impacts** +**Change Impact** 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. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-dmsfwk.md similarity index 55% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-dmsfwk.md index 5eda23bba4e9832210d6f57de819bfe341ba75d4..d81d9080a4eea114c2028114c99e62c542f5d54c 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-dmsfwk.md @@ -1,18 +1,18 @@ -# Distributed Scheduler Subsystem ChangeLog +# Distributed Scheduler Subsystem Changelog -## cl.DistributedManagerService.1 continuationManager API Changes +## cl.DistributedManagerService.1 continuationManager on()/off() Changes -- Event names passed to the **continuationManager** API do not comply with the OpenHarmony API specifications. -- The **continuationManager.on** API does not have a unified return value for various events, which does not comply with the OpenHarmony API specifications. +- The event types passed to the **continuationManager.on** and **continuationManager.off** APIs do not comply with the OpenHarmony API specifications. +- The return value of **continuationManager.on** varies with the event type, which does not comply with the OpenHarmony API specifications. The following changes have been made: -- The device selection event name of **continuationManager.on** and **continuationManager.off** is changed from **deviceConnect** to **deviceSelected**, and the device deselection event name is changed from **deviceDisconnect** to **deviceUnselected**. -- The **continuationManager.on** API returns **Callback<Array<ContinuationResult>>** for all events. +- Changed the event type **deviceConnect** to **deviceSelected** and **deviceDisconnect** to **deviceUnselected** in the **continuationManager.on** and **continuationManager.off** APIs. +- Changed the return value of **continuationManager.on** to **Callback<Array<ContinuationResult>>** for all events. -**Change Impacts** +**Change Impact** -The application developed based on earlier versions needs to adapt the new APIs. Otherwise, the original service logic will be affected. +The application developed based on earlier versions needs to be adapted. Otherwise, the service logic will be affected. **Key API/Component Changes** @@ -40,10 +40,9 @@ The application developed based on earlier versions needs to adapt the new APIs. ``` **Adaptation Guide** - Change the event names. The sample code is as follows: -Device selection event of **continuationManager.on**: +Event of device selection in **continuationManager.on**: ```ts let token = 1; @@ -61,7 +60,7 @@ Device selection event of **continuationManager.on**: } ``` -Device selection event of **continuationManager.off**: +Event of device selection in **continuationManager.off**: ```ts let token = 1; @@ -72,7 +71,7 @@ Device selection event of **continuationManager.off**: } ``` -Device deselection event of **continuationManager.on**: +Event of device deselection in **continuationManager.on**: ```ts let token = 1; @@ -91,7 +90,7 @@ Device deselection event of **continuationManager.on**: } ``` -Device deselection event of **continuationManager.off**: +Event of device deselection in **continuationManager.off**: ```ts let token = 1; @@ -101,3 +100,23 @@ Device deselection event of **continuationManager.off**: console.error('off failed, cause: ' + JSON.stringify(err)); } ``` + +## cl.DistributedManagerService.2 Adding DATASYNC Permission Verification to continuationManager APIs + +In earlier versions, the **continuationManager** APIs do not verify the caller, which does not comply with the OpenHarmony API specifications. +Now, before using a **continuationManager** API, the caller must apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission. + +**Change Impact** + +The application developed based on earlier versions needs to apply for the **ohos.permission.DISTRIBUTED_DATASYNC** permission in advance. Otherwise, the service logic will be affected. + +**Key API/Component Changes** + +Involved APIs: + + - continuationManager.registerContinuation; + - continuationManager.on; + - continuationManager.off; + - continuationManager.unregisterContinuation; + - continuationManager.updateContinuationState; + - continuationManager.startContinuationDeviceManager; diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-dsoftbus.md similarity index 91% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-dsoftbus.md index ef64e7d28caf508bcbc0011975071a613e544649..ea1e10f12173db035ae4c1a702d392511cdd4108 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-dsoftbus.md @@ -1,17 +1,17 @@ -# DSoftBus Subsystem ChangeLog +# DSoftBus Subsystem Changelog -## IPC&RPC APIs support the exception handling mode and the selection of synchronous or asynchronous message sending by passing a Boolean value or a numeric value. -1. Some IPC&RPC APIs of DSoftBus use service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. -2. A Boolean value can be passed to specify the mode of sending information as asynchronous or synchronous. -#### Change Impacts +## Support for Exception Handling and Selecting Synchronous or Asynchronous Message Sending by Using a Boolean or Numeric Value in IPC&RPC APIs +1. Some IPC&RPC APIs of DSoftBus use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. +2. A Boolean value can be passed in to specify the asynchronous or synchronous message transfer mode. +#### Change Impact -This version is compatible with earlier versions and no adaptation is required. Newly added APIs can be called to support the following changes: -1. Supports exception handling and return of error codes. -2. Supports selection of synchronous or asynchronous message sending by passing a Boolean value or by passing 0 or a non-0 number. +No adaptation is required. Use the new APIs provided by this version to: +1. Implement exception handling and return of error codes. +2. Select synchronous or asynchronous message transfer by using a Boolean value or a number of 0 or non-0. #### **Key API/Component Changes** -For adaptation to the unified API exception handling mode, related IPC&RPC APIs are deprecated, and corresponding new APIs and methods are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. +For easy use, related IPC&RPC APIs are deprecated, and new APIs are added to implement unified error code handling. The functionalities of these APIs remain unchanged. | Class| Deprecated API | New Class | New API | | ------------ | ------------ | ------------ | ------------ | | MessageParcel | static create(): MessageParcel | MessageSequence | static create(): MessageSequence | @@ -130,7 +130,7 @@ For adaptation to the unified API exception handling mode, related IPC&RPC APIs #### Adaptation Guide -The newly added APIs return error codes and corresponding error information by throwing exceptions. Take the **create** API in **MessageParcel** as an example. The sample code is as follows: +The new APIs return error codes and error information by throwing exceptions. The following uses the **create()** API of **MessageParcel** as an example. ```js import rpc from '@ohos.rpc' @@ -142,4 +142,4 @@ try { console.info("create meassageParcel failed, errorMessage = " + error.errorMessage); } ``` -For details about sample code of more APIs, see [RPC API reference](../../../application-dev/reference/apis/js-apis-rpc.md). +For details about the APIs, see [RPC](../../../application-dev/reference/apis/js-apis-rpc.md). diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-enterprise_device_management.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md similarity index 80% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-enterprise_device_management.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md index 5a3f51481a6ce67f75c16deded929f64c1b29432..dd8eb99aa48bbc0ab5ea2b83e51233a41320b03e 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-enterprise_device_management.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md @@ -1,12 +1,10 @@ # Customization Subsystem ChangeLog -Compared with OpenHarmony 3.2.8.1, OpenHarmony 3.2.8.3 has the following API changes in the customization subsystem: - ## cl.Customization.1 Change of the Enterprise Device Management Module Name -Beginning from OpenHarmony 3.2.8.3, **@ohos.enterpriseDeviceManager.d.ts** is changed to **@ohos.enterprise.adminManager.d.ts**. You need to adapt your applications according to the following information. +Changed **@ohos.enterpriseDeviceManager.d.ts** to **@ohos.enterprise.adminManager.d.ts**. -**Change Impacts** +**Change Impact** The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. @@ -18,7 +16,7 @@ The application developed based on OpenHarmony earlier than 3.2.8.3 must be adap **Adaptation Guide** -The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. +The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. If the original API uses **@ohos.enterpriseDeviceManager**: @@ -26,7 +24,7 @@ If the original API uses **@ohos.enterpriseDeviceManager**: import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'; ``` -You can directly modify **import** to switch to the new namespace: +You can modify **import** to switch to the new namespace: ```js import enterpriseDeviceManager from '@ohos.enterprise.adminManager'; @@ -34,9 +32,9 @@ import enterpriseDeviceManager from '@ohos.enterprise.adminManager'; ## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change -Beginning from OpenHarmony 3.2.8.3, **enterpriseDeviceManager/DeviceSettingsManager.d.ts** is changed to **ohos.enterprise.dateTimeManager.d.ts**. +Changed **enterpriseDeviceManager/DeviceSettingsManager.d.ts** to **ohos.enterprise.dateTimeManager.d.ts**. -**Change Impacts** +**Change Impact** The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. @@ -88,54 +86,54 @@ dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => { ## cl.Customization.3 System API Change -Beginning from OpenHarmony 3.2.8.3, all enterprise device management APIs are changed to system APIs. +Changed all enterprise device management APIs to system APIs. -**Change Impacts** +**Change Impact** All APIs can be called only by system applications. **Key API/Component Changes** -| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| Module | Class | Method/Attribute/Enum/Constant | Change Type| | ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | -| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **interface** EnterpriseInfo | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **enum** AdminType | Changed to a system API | -| @ohos.enterprise.adminManager | adminManager | **enum** ManagedEvent | Changed to a system API | -| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | Changed to a system API | -| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | Changed to a system API | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **interface** EnterpriseInfo | systemapi | +| @ohos.enterprise.adminManager | adminManager | **enum** AdminType | systemapi | +| @ohos.enterprise.adminManager | adminManager | **enum** ManagedEvent | systemapi | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | systemapi | ## cl.Customization.4 API Permission Change -Beginning from OpenHarmony 3.2.8.3, permission verification is required for some APIs. +Added permission verification for some APIs. -**Change Impacts** +**Change Impact** The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs. **Key API/Component Changes** -| Module | Class | Method/Attribute/Enumeration/Constant | New Permission| +| Module | Class | Method/Attribute/Enum/Constant | New Permission| | ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | | @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-filemanagement.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-filemanagement.md new file mode 100644 index 0000000000000000000000000000000000000000..154e840dddb2be62b03af5209b199340ef798c94 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-filemanagement.md @@ -0,0 +1,93 @@ +# File Management Subsystem Changelog + +## cl.filemanagement.1 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 changes of 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 are added in **@ohos.file.fs** to support unified error code handling and have slight changes in parameters. The functionalities of the APIs remain unchanged. + +| Module | Method/Attribute/Enum/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** + +Before the change, the APIs are imported as follows: + +```js +import fileio from '@ohos.fileio'; +``` + +Now, the APIs are imported as follows: + +```js +import fs from '@ohos.file.fs'; +``` + +In addition, exception handling needs to be adapted. + +Sample code for exception handling in a synchronous API: + +```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 exception handling in an asynchronous API (promise): +```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 exception handling in an asynchronous API (callback): +```js +import fs from '@ohos.file.fs' + +try { + fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ // Asynchronous thread errors (such as a syscall error) are obtained via a callback. + if (e) { + console.error("open in async errCode:" + e.code + ", errMessage:" + e.message); + } + }); +} catch (err) {// Main thread errors (such as invalid parameters) are obtained by try catch. + console.error("open callback errCode:" + err.code + ", errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-geolocation.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-geolocation.md similarity index 94% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-geolocation.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-geolocation.md index 2c593c302956fa32807147e0a549da967fc1b264..5dfe147895af9dbd969f32864e981644be48c70b 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-geolocation.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-geolocation.md @@ -1,4 +1,4 @@ -# Location Subsystem ChangeLog +# Location Subsystem Changelog ## cl.location.1 Migration of System APIs and APIs in API Version 9 to the New @ohos.geoLocationManager.d.ts @@ -9,7 +9,7 @@ To use system APIs and APIs in API version 9 of the location subsystem, you need import geoLocationManager from '@ohos.geoLocationManager'; -**Change Impacts** +**Change Impact** System APIs and APIs in API version 9 are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**. @@ -19,7 +19,7 @@ Other APIs are not affected. **Key API/Component Changes** -| Class| Type| Declaration| Change Type| +| Class| API Type| Declaration| Change Type| | -- | -- | -- | -- | |geolocation| namespace | declare namespacegeolocation| Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| |geolocation | interface | export interface ReverseGeocodingMockInfo | Migrated this API in API version 9 to **@ohos.geoLocationManager.d.ts**.| @@ -57,7 +57,7 @@ Other APIs are not affected. **(Optional) Adaptation Guide** -The following uses **enableLocation** as an example to show how it is called in the new version: +The following sample code shows how to call **enableLocation** in the new version: ```ts import geoLocationManager from '@ohos.geoLocationManager'; @@ -78,7 +78,7 @@ From API version 9, the **ohos.permission.APPROXIMATELY_LOCATION** permission is If you use API version 9 or later, you need to apply for both the **ohos.permission.LOCATION** and **ohos.permission.APPROXIMATELY_LOCATION** permissions. Applying for only the **ohos.permission.LOCATION** permission will fail. -**Change Impacts** +**Change Impact** Applications using API versions earlier than 9 are not affected. For an application using API version 9 or later, the method for applying for the location permission is changed. The details are as follows: @@ -101,13 +101,13 @@ API version 9 and later: Apply for **ohos.permission.APPROXIMATELY_LOCATION**, o | API Version| Location Permission| Permission Application Result| Location Accuracy| | -------- | -------- | -------- | -------- | | Earlier than 9| ohos.permission.LOCATION | Success| Location accurate to meters| -| 9 and later| ohos.permission.LOCATION | Failure| No location obtained| -| 9 and later| ohos.permission.APPROXIMATELY_LOCATION | Success| Location accurate to 5 kilometers| +| 9 and later| ohos.permission.LOCATION | Failed| No location obtained.| +| 9 and later| ohos.permission.APPROXIMATELY_LOCATION | Success| Location accurate to 5 kilometers.| | 9 and later| ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Success| Location accurate to meters| If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background. -You can declare the required permission in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md). +You can declare the required permissions in your application's configuration file. For details, see the [permission application guide](../../../application-dev/security/accesstoken-guidelines.md). **Key API/Component Changes** diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-global.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-global.md similarity index 52% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-global.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-global.md index 3ea6d2e61ae7d061f0631b217bdba75d0a27319c..e572a20c68e1b4ea3dbb64ed110a0493b40ccb72 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-global.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-global.md @@ -1,8 +1,8 @@ -# Globalization Subsystem ChangeLog +# Globalization Subsystem Changelog ## cl.global.1 Support of Error Codes for the Internalization Module -APIs provided by the internationalization component of the globalization subsystem are changed to support error codes in the following scenarios. The following changes are made in API version 9 and later: +APIs provided by the internationalization component of the globalization subsystem are changed to support error codes in the following scenarios. The following changes are made in API version 9: - Obtaining the local expression of a country or language - Obtaining the list of languages supported by the system and the list of areas supported by a language - Checking whether a language matches an area @@ -11,37 +11,37 @@ APIs provided by the internationalization component of the globalization subsyst - Obtaining, adding, and removing the preferred language - Obtaining and setting localized numbers -You need to adapt your applications based on the following information: +You need to adapt your application based on the following information. -**Change Impacts** +**Change Impact** The preceding APIs are changed to the static methods of the **System** class. When such an API is called, add the class name to the end of the module name. -The return value data type of the setting APIs (for example, **setSystemLanguage**) is changed from boolean to void. +For setter APIs, the type of the return value is changed from boolean to void, for example, setSystemLanguage. When a call to an API fails, an error code is returned according to the failure cause. For example, when permissions are not correctly configured for an application, **201** is returned. **Key API/Component Changes** -Involved APIs: -- getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; -- getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; -- getSystemLanguages(): Array; -- getSystemCountries(language: string): Array; -- isSuggested(language: string, region?: string): boolean; -- getSystemLanguage(): string; -- setSystemLanguage(language: string): void; -- getSystemRegion(): string; -- setSystemRegion(region: string): void; -- getSystemLocale(): string; -- setSystemLocale(locale: string): void; -- is24HourClock(): boolean; -- set24HourClock(option: boolean): void; -- addPreferredLanguage(language: string, index?: number): void; -- removePreferredLanguage(index: number): void; -- getPreferredLanguageList(): Array; -- getFirstPreferredLanguage(): string; -- getAppPreferredLanguage(): string; -- setUsingLocalDigit(flag: boolean): void; -- getUsingLocalDigit(): boolean; + - Involved APIs: + - getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; + - getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; + - getSystemLanguages(): Array; + - getSystemCountries(language: string): Array; + - isSuggested(language: string, region?: string): boolean; + - getSystemLanguage(): string; + - setSystemLanguage(language: string): void; + - getSystemRegion(): string; + - setSystemRegion(region: string): void; + - getSystemLocale(): string; + - setSystemLocale(locale: string): void; + - is24HourClock(): boolean; + - set24HourClock(option: boolean): void; + - addPreferredLanguage(language: string, index?: number): void; + - removePreferredLanguage(index: number): void; + - getPreferredLanguageList(): Array; + - getFirstPreferredLanguage(): string; + - getAppPreferredLanguage(): string; + - setUsingLocalDigit(flag: boolean): void; + - getUsingLocalDigit(): boolean; **Adaptation Guide** diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-inputmethod-framworks.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md similarity index 69% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-inputmethod-framworks.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md index 10b882debbe61ecbb41c7ef43f96f1d563ea22ca..be4a459e4070a68f50a6b68ea019167c70897e02 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-inputmethod-framworks.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md @@ -18,7 +18,7 @@ Asynchronous API: An error message is returned via **AsyncCallback** or the **er Synchronous API: An error message is returned via an exception. -**Change Impacts** +**Change Impact** 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. @@ -26,51 +26,97 @@ The application developed based on earlier versions needs to adapt the method fo Error code processing is added for the following APIs: - getSetting(): InputMethodSetting; + - getController(): InputMethodController; - - switchInputMethod(target: InputMethodProperty, callback: AsyncCallback): void; - - switchInputMethod(target: InputMethodProperty): Promise; - - switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback): void; - - switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise; - - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback): void; - - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise; - - listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback>): void; - - listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise>; - - listCurrentInputMethodSubtype(callback: AsyncCallback>): void; - - listCurrentInputMethodSubtype(): Promise>; - - getInputMethods(enable: boolean, callback: AsyncCallback>): void; - - getInputMethods(enable: boolean): Promise>; - - showOptionalInputMethods(callback: AsyncCallback): void; - - showOptionalInputMethods(): Promise; - - stopInputSession(callback: AsyncCallback): void; - - stopInputSession(): Promise; - - showSoftKeyboard(callback: AsyncCallback): void; - - showSoftKeyboard():Promise; - - hideSoftKeyboard(callback: AsyncCallback): void; - - hideSoftKeyboard():Promise; - - hide(callback: AsyncCallback): void; - - hide(): Promise; - - onCreate(want: Want): void; - - onDestroy(): void; - In **InputClient**: - - sendKeyFunction(action: number, callback: AsyncCallback): void; - - sendKeyFunction(action: number): Promise; - - deleteForward(length: number, callback: AsyncCallback): void; - - deleteForward(length: number): Promise; - - deleteBackward(length: number, callback: AsyncCallback): void; - - deleteBackward(length: number): Promise; - - insertText(text: string, callback: AsyncCallback): void; - - insertText(text: string): Promise; - - getForward(length: number, callback: AsyncCallback): void; - - getForward(length: number): Promise; - - getBackward(length: number, callback: AsyncCallback): void; - - getBackward(length: number): Promise; - - getEditorAttribute(callback: AsyncCallback): void; - - getEditorAttribute(): Promise; - - moveCursor(direction: number, callback: AsyncCallback): void; - - moveCursor(direction: number): Promise; - In **InputMethodExtensionAbility**: + + - switchInputMethod(target: InputMethodProperty, callback: AsyncCallback\): void; + + - switchInputMethod(target: InputMethodProperty): Promise\; + + - switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback\): void; + + - switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise\; + + - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback\): void; + + - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise\; + + - listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback>): void; + + - listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise>; + + - listCurrentInputMethodSubtype(callback: AsyncCallback>): void; + + - listCurrentInputMethodSubtype(): Promise>; + + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + + - getInputMethods(enable: boolean): Promise>; + + - showOptionalInputMethods(callback: AsyncCallback\): void; + + - showOptionalInputMethods(): Promise\; + + - stopInputSession(callback: AsyncCallback\): void; + + - stopInputSession(): Promise\; + + - showSoftKeyboard(callback: AsyncCallback\): void; + + - showSoftKeyboard():Promise\; + + - hideSoftKeyboard(callback: AsyncCallback\): void; + + - hideSoftKeyboard():Promise\; + + - hide(callback: AsyncCallback\): void; + + - hide(): Promise\; + - onCreate(want: Want): void; + - onDestroy(): void; + + + - In **InputClient**: + + - sendKeyFunction(action: number, callback: AsyncCallback\): void; + + - sendKeyFunction(action: number): Promise\; + + - deleteForward(length: number, callback: AsyncCallback\): void; + + - deleteForward(length: number): Promise\; + + - deleteBackward(length: number, callback: AsyncCallback\): void; + + - deleteBackward(length: number): Promise\; + + - insertText(text: string, callback: AsyncCallback\): void; + + - insertText(text: string): Promise\; + + - getForward(length: number, callback: AsyncCallback\): void; + + - getForward(length: number): Promise\; + + - getBackward(length: number, callback: AsyncCallback\): void; + + - getBackward(length: number): Promise\; + + - getEditorAttribute(callback: AsyncCallback\): void; + + - getEditorAttribute(): Promise\EditorAttribute>; + + - moveCursor(direction: number, callback: AsyncCallback\): void; + + - moveCursor(direction: number): Promise\; + +- In **InputMethodExtensionAbility**: + + - onCreate(want: Want): void; + + - onDestroy(): void; **Adaptation Guide** @@ -143,11 +189,9 @@ Substitute APIs: - hide(): Promise; **NOTE** - -- Use the **getInputMethodAbility()** API to obtain an **InputMethodAbility** object, and do not use **getInputMethodEngine()** to obtain an **InputMethodEngine** object. -- Use methods in **InputMethodAbility**, and do not use methods in **InputMethodEngine**. -- Use the **on('inputStart')** method in **InputMethodAbility** to obtain a **KeyboardController** instance and an **InputClient** instance, and do not use the **on('inputStart')** method in **InputMethodEngine** to obtain a **TextInputClient** instance. - + Use the **getInputMethodAbility()** API to obtain an **InputMethodAbility** object, and do not use **getInputMethodEngine()** to obtain an **InputMethodEngine** object. + Use methods in **InputMethodAbility**, and do not use methods in **InputMethodEngine**. + Use the **on('inputStart')** method in **InputMethodAbility** to obtain a **KeyboardController** instance and an **InputClient** instance, and do not use the **on('inputStart')** method in **InputMethodEngine** to obtain a **TextInputClient** instance. Before: ```js diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-multimedia.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md similarity index 68% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-multimedia.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md index a2edb4e0b1bb14cf4d8185549b09069dc5da7cf1..aa585ed0e8922116000a5aa0cf766e1e04a6dcb1 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-multimedia.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md @@ -1,10 +1,10 @@ -# Multimedia Subsystem ChangeLog +# Multimedia Subsystem Changelog ## cl.multimedia.audio.001 Call Mode Change of getRoutingManager() **getRoutingManager()** is changed from asynchronous to synchronous. -**Change Impacts** +**Change Impact** If the new mode is not used, an error will be reported during compilation. @@ -25,7 +25,7 @@ getRoutingManager(): AudioRoutingManager; **getStreamManager()** is changed from asynchronous to synchronous. -**Change Impacts** +**Change Impact** If the new mode is not used, an error will be reported during compilation. @@ -46,7 +46,7 @@ getStreamManager(): AudioStreamManager; In the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed. -**Change Impacts** +**Change Impact** If the new mode is not used, an error will be reported during compilation. @@ -71,7 +71,7 @@ interface AudioVolumeGroupManager { The call mode of **getVolumeGroups()** is changed. -**Change Impacts** +**Change Impact** If the new mode is not used, an error will be reported during compilation. @@ -96,7 +96,7 @@ interface AudioVolumeManager{ The call mode of **getGroupManager()** is changed. -**Change Impacts** +**Change Impact** If the new mode is not used, an error will be reported during compilation. @@ -121,9 +121,9 @@ interface AudioVolumeManager{ **FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**. -**Change Impacts** +**Change Impact** -If the new name is not used, an error will be reported during compilation. +If the new mode is not used, an error will be reported during compilation. **Key API/Component Changes** @@ -145,9 +145,9 @@ enum InterruptRequestType { The listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed. -**Change Impacts** +**Change Impact** -If the new name is not used, an error will be reported during compilation. +If the new mode is not used, an error will be reported during compilation. **Key API/Component Changes** @@ -170,141 +170,84 @@ interface AudioRenderer { In the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use. **VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**. -**Change Impacts** +**Change Impact** If the **VideoRecorder** caller is not a system user, the call will fail. - -Involved APIs and enumerations: - +Involved APIs and enums: function createVideoRecorder(callback: AsyncCallback): void; - function createVideoRecorder(): Promise; - type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; - interface VideoRecorder{ - -​ prepare(config: VideoRecorderConfig, callback: AsyncCallback): void; - -​ prepare(config: VideoRecorderConfig): Promise; - -​ getInputSurface(callback: AsyncCallback): void; - -​ getInputSurface(): Promise; - -​ start(callback: AsyncCallback): void; - -​ start(): Promise; - -​ pause(callback: AsyncCallback): void; - -​ pause(): Promise; - -​ resume(callback: AsyncCallback): void; - -​ resume(): Promise; - -​ stop(callback: AsyncCallback): void; - -​ stop(): Promise; - -​ release(callback: AsyncCallback): void; - -​ release(): Promise; - -​ reset(callback: AsyncCallback): void; - -​ reset(): Promise; - -​ on(type: 'error', callback: ErrorCallback): void; - -​ readonly state: VideoRecordState; - + prepare(config: VideoRecorderConfig, callback: AsyncCallback): void; + prepare(config: VideoRecorderConfig): Promise; + getInputSurface(callback: AsyncCallback): void; + getInputSurface(): Promise; + start(callback: AsyncCallback): void; + start(): Promise; + pause(callback: AsyncCallback): void; + pause(): Promise; + resume(callback: AsyncCallback): void; + resume(): Promise; + stop(callback: AsyncCallback): void; + stop(): Promise; + release(callback: AsyncCallback): void; + release(): Promise; + reset(callback: AsyncCallback): void; + reset(): Promise; + on(type: 'error', callback: ErrorCallback): void; + readonly state: VideoRecordState; } - interface VideoRecorderProfile { - -​ readonly audioBitrate: number; - -​ readonly audioChannels: number; - -​ readonly audioCodec: CodecMimeType; - -​ readonly audioSampleRate: number; - -​ readonly fileFormat: ContainerFormatType; - -​ readonly videoBitrate: number; - -​ readonly videoCodec: CodecMimeType; - -​ readonly videoFrameWidth: number; - -​ readonly videoFrameHeight: number; - -​ readonly videoFrameRate: number; - + readonly audioBitrate: number; + readonly audioChannels: number; + readonly audioCodec: CodecMimeType; + readonly audioSampleRate: number; + readonly fileFormat: ContainerFormatType; + readonly videoBitrate: number; + readonly videoCodec: CodecMimeType; + readonly videoFrameWidth: number; + readonly videoFrameHeight: number; + readonly videoFrameRate: number; } - enum AudioSourceType { - -​ AUDIO_SOURCE_TYPE_DEFAULT = 0, - -​ AUDIO_SOURCE_TYPE_MIC = 1, - + AUDIO_SOURCE_TYPE_DEFAULT = 0, + AUDIO_SOURCE_TYPE_MIC = 1, } - enum VideoSourceType { - -​ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, - -​ VIDEO_SOURCE_TYPE_SURFACE_ES = 1, - + VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, + VIDEO_SOURCE_TYPE_SURFACE_ES = 1, } - enum VideoRecorderConfig { - -​ audioSourceType?: AudioSourceType; - -​ videoSourceType: VideoSourceType; - -​ profile: VideoRecorderProfile; - -​ url: string; - -​ rotation?: number; - -​ location?: Location; - + audioSourceType?: AudioSourceType; + videoSourceType: VideoSourceType; + profile: VideoRecorderProfile; + url: string; + rotation?: number; + location?: Location; } ## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer In API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version. -**Change Impacts** +**Change Impact** Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**. **Key API/Component Changes** Deleted APIs: - interface VideoPlayer { - -​ selectBitrate(bitrate: number): Promise; - -​ selectBitrate(bitrate: number, callback: AsyncCallback): void; - -​ on(type: 'availableBitratesCollect', callback: (bitrates: Array) => void): void; - + selectBitrate(bitrate: number): Promise; + selectBitrate(bitrate: number, callback: AsyncCallback): void; + on(type: 'availableBitratesCollect', callback: (bitrates: Array) => void): void; } ## cl.multimedia.media.003 Error Information Change of VideoRecorder Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications. -**Change Impacts** +**Change Impact** Error codes returned from **VideoRecorder** are changed. @@ -315,5 +258,5 @@ Error codes returned from **VideoRecorder** are changed. **Adaptation Guide** For details about exception handling, see the following documents: -[Media](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-media.md) -[Media Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-media.md) +https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md +https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-media.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-multimodalinput.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-multimodalinput.md similarity index 55% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-multimodalinput.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-multimodalinput.md index c9514a515412e1d6b765558272650f2c20cac5af..f128d80d2e74c6b03c5ed749b933e9d6fc371397 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-multimodalinput.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-multimodalinput.md @@ -1,4 +1,4 @@ -# Multimodal Input ChangeLog +# Multimodal Input Changelog ## cl.multimodalinput.1 Error Information Return Method Change of APIs @@ -17,45 +17,45 @@ The internal APIs of the following modules used service logic return values to i Asynchronous APIs in the preceding modules have the following changes: A parameter check error is returned synchronously; a service logic error is returned via **AsyncCallback** or the **error** object of **Promise**. No change is made to synchronous APIs. -**Change Impacts** +**Change Impact** 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** - supportKeys(deviceId: number, keys: Array<KeyCode>, callback: AsyncCallback<Array<boolean>>): void; - - supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>>; - - getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void; > - - getKeyboardType(deviceId: number): Promise<KeyboardType>; - - setPointerSpeed(speed: number, callback: AsyncCallback<void>): void; - - setPointerSpeed(speed: number): Promise<void>; - - getPointerSpeed(callback: AsyncCallback<number>): void; - - getPointerSpeed(): Promise<number>; - - setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback<void>): void; - - setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise<void>; - - getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): void; - - getPointerStyle(windowId: number): Promise<PointerStyle>; - - setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void; - - setPointerVisible(visible: boolean): Promise<void>; - - isPointerVisible(callback: AsyncCallback<boolean>): void; - - isPointerVisible(): Promise<boolean>; - - on(type:"touch", receiver:TouchEventReceiver):void; - - on(type:"mouse", receiver:Callback<MouseEvent>):void; - - off(type:"touch", receiver?:TouchEventReceiver):void; - - off(type:"mouse", receiver?:Callback<MouseEvent>):void; - - injectEvent({KeyEvent: KeyEvent}): void; - - enable(enable: boolean, callback: AsyncCallback<void>): void; - - enable(enable: boolean): Promise<void>; - - start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCallback<void>): void; - - start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise<void>; - - stop(callback: AsyncCallback<void>): void; - - stop(): Promise<void>; - - getState(deviceDescriptor: string, callback: AsyncCallback<{ state: boolean }>): void; - - getState(deviceDescriptor: string): Promise<{ state: boolean }>; - - on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, eventMsg: EventMsg }>): void; - - off(type: 'cooperation', callback?: AsyncCallback<void>): void; - - on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): void; - - off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): void; + - supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>>; + - getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void; > + - getKeyboardType(deviceId: number): Promise<KeyboardType>; + - setPointerSpeed(speed: number, callback: AsyncCallback<void>): void; + - setPointerSpeed(speed: number): Promise<void>; + - getPointerSpeed(callback: AsyncCallback<number>): void; + - getPointerSpeed(): Promise<number>; + - setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback<void>): void; + - setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise<void>; + - getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): void; + - getPointerStyle(windowId: number): Promise<PointerStyle>; + - setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void; + - setPointerVisible(visible: boolean): Promise<void>; + - isPointerVisible(callback: AsyncCallback<boolean>): void; + - isPointerVisible(): Promise<boolean>; + - on(type:"touch", receiver:TouchEventReceiver):void; + - on(type:"mouse", receiver:Callback<MouseEvent>):void; + - off(type:"touch", receiver?:TouchEventReceiver):void; + - off(type:"mouse", receiver?:Callback<MouseEvent>):void; + - injectEvent({KeyEvent: KeyEvent}): void; + - enable(enable: boolean, callback: AsyncCallback<void>): void; + - enable(enable: boolean): Promise<void>; + - start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCallback<void>): void; + - start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise<void>; + - stop(callback: AsyncCallback<void>): void; + - stop(): Promise<void>; + - getState(deviceDescriptor: string, callback: AsyncCallback<{ state: boolean }>): void; + - getState(deviceDescriptor: string): Promise<{ state: boolean }>; + - on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, eventMsg: EventMsg }>): void; + - off(type: 'cooperation', callback?: AsyncCallback<void>): void; + - on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): void; + - off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): void; Deprecated APIs: - getDeviceIds(callback: AsyncCallback<Array<number>>): void; diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-notification.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-notification.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-notification.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-notification.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-power.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-power.md similarity index 91% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-power.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-power.md index 116bff7f084ebed42c0c8842f4c8e2936bca3e75..5edb31b22901b2afdf8cdb76ccd008ae13162727 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-power.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-power.md @@ -1,8 +1,8 @@ -# Power Subsystem ChangeLog +# Power Subsystem Changelog ## cl.powermgr.1 Error Information Return Method Change of APIs -The following APIs used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. +The **power** module uses service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. Therefore, modification is made in API version 9 and later. - Power consumption statistics: [@ohos.batteryStatistics](../../../application-dev/reference/apis/js-apis-batteryStatistics.md) - Brightness: [@ohos.brightness](../../../application-dev/reference/apis/js-apis-brightness.md) @@ -14,7 +14,7 @@ Asynchronous API: An error message is returned via **AsyncCallback** or the **er Synchronous API: An error message is returned via an exception. -#### Change Impacts +#### Change Impact 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. @@ -50,7 +50,7 @@ Error code processing is added for the following APIs: For details, see the API reference document of each API. ## cl.powermgr.2 System API Change -#### Change Impacts +#### Change Impact The application developed based on earlier versions needs to adapt to new API names and the new method for returning API error information. Otherwise, the original service logic will be affected. diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-request.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-request.md new file mode 100644 index 0000000000000000000000000000000000000000..a6911a3e16d7c249981afe350fb893261a5f7686 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-request.md @@ -0,0 +1,106 @@ +# Upload and Download Subsystem Changelog + +## 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 Impact** + +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): void; | Added| +| ohos.request | DownloadTask | restore(): Promise; | Added| +| ohos.request | DownloadTask | getTaskInfo(callback: AsyncCallback): void; | Added| +| ohos.request | DownloadTask | getTaskInfo(): Promise; | Added| +| ohos.request | DownloadTask | getTaskMimeType(callback: AsyncCallback): void; | Added| +| ohos.request | DownloadTask | getTaskMimeType(): Promise; | Added| +| ohos.request | UploadTask | delete(callback: AsyncCallback): void; | Added| +| ohos.request | UploadTask | delete(): Promise; | Added| +| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback): void;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;| Deprecated| +| ohos.request | request | function download(config: DownloadConfig): Promise;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Deprecated| +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void;| Deprecated| +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise;
Substitute API: function downloadFile(context: BaseContext, config: DownloadConfig): Promise; | Deprecated| +| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback): void;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deprecated| +| ohos.request | request | function upload(config: UploadConfig): Promise;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Deprecated| +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deprecated| +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise;
Substitute API: function uploadFile(context: BaseContext, config: UploadConfig): Promise; | Deprecated| +| ohos.request | DownloadTask | remove(callback: AsyncCallback): void;
Substitute API: delete(callback: AsyncCallback): void | Deprecated| +| ohos.request | DownloadTask | remove(): Promise;
Substitute API: delete(): Promise; | Deprecated| +| ohos.request | DownloadTask | pause(callback: AsyncCallback): void;
Substitute API: suspend(callback: AsyncCallback): void; | Deprecated| +| ohos.request | DownloadTask | pause(): Promise;
Substitute API: suspend(): Promise; | Deprecated| +| ohos.request | DownloadTask | resume(callback: AsyncCallback): void;
Substitute API: restore(callback: AsyncCallback): void; | Deprecated| +| ohos.request | DownloadTask | resume(): Promise;
Substitute API: restore(): Promise; | Deprecated| +| ohos.request | DownloadTask | query(callback: AsyncCallback): void;
Substitute API: getTaskInfo(callback: AsyncCallback): void; | Deprecated| +| ohos.request | DownloadTask | query(): Promise;
Substitute API: getTaskInfo(): Promise; | Deprecated| +| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback): void;
Substitute API: getTaskMimeType(callback: AsyncCallback): void; | Deprecated| +| ohos.request | DownloadTask | queryMimeType(): Promise;
Substitute API: getTaskMimeType(): Promise; | Deprecated| +| ohos.request | UploadTask | remove(callback: AsyncCallback): void;
Substitute API: delete(callback: AsyncCallback): void; | Deprecated| +| ohos.request | UploadTask | remove(): Promise;
Substitute API: delete(): Promise; | Deprecated| +| system.request | UploadResponse | code | Deprecated| +| system.request | UploadResponse | data | Deprecated| +| system.request | UploadResponse | headers | Deprecated| +| system.request | DownloadResponse | token | Deprecated| +| system.request | OnDownloadCompleteResponse | uri | Deprecated| +| system.request | RequestFile | filename | Deprecated| +| system.request | RequestFile | name | Deprecated| +| system.request | RequestFile | uri | Deprecated| +| system.request | RequestFile | type | Deprecated| +| system.request | RequestData | name | Deprecated| +| system.request | RequestData | value | Deprecated| +| system.request | UploadRequestOptions | url | Deprecated| +| system.request | UploadRequestOptions | data | Deprecated| +| system.request | UploadRequestOptions | files | Deprecated| +| system.request | UploadRequestOptions | header | Deprecated| +| system.request | UploadRequestOptions | description | Deprecated| +| system.request | UploadRequestOptions | success | Deprecated| +| system.request | UploadRequestOptions | fail | Deprecated| +| system.request | UploadRequestOptions | complete | Deprecated| +| system.request | OnDownloadCompleteOptions | token | Deprecated| +| system.request | OnDownloadCompleteOptions | success | Deprecated| +| system.request | OnDownloadCompleteOptions | fail | Deprecated| +| system.request | OnDownloadCompleteOptions | complete | Deprecated| +| system.request | Request | static upload(options: UploadRequestOptions): void; | Deprecated| +| system.request | Request | static download(options: DownloadRequestOptions): void; | Deprecated| +| system.request | Request | static onDownloadComplete(options: OnDownloadCompleteOptions): void; | Deprecated| + + +**Adaptation Guide** + +The following uses **downloadFile** as an example to show how it is called in the new version: + +```ts +try { + request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap', + filePath: 'xxx/xxxxx.hap'}, (err, data) => { + if (err) { + console.error('Failed to request the download. Cause: ' + JSON.stringify(err)); + return; + } + }); +} catch (err) { + console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-resource-manager.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md similarity index 95% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-resource-manager.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md index b5c769a395a5bc9efc9239fde9b4284f85f74c3c..d3c7391445f3497c388b4804f4fa3a730f14ba06 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-resource-manager.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md @@ -1,12 +1,12 @@ -# Resource Manager ChangeLog +# Resource Manager Changelog ## cl.resourceManager.1 Name Change of Some Multi-Project APIs in API Version 9 of Resource Manager -The resource manager can return error codes and error information for APIs in API version 9 and later. Some multi-project APIs in API version 9 need to be adapted. The following changes are made in API version 9 and later: +The resource manager can return error codes and error information for APIs in API version 9 and later. Some multi-project APIs in API version 9 need to be adapted. The following changes are made in API version 9: Some multi-project APIs of the resource manager need to be replaced with new APIs, and the parameters remain unchanged. -**Change Impacts** +**Change Impact** For applications developed based on earlier versions, relevant JavaScript multi-project APIs need to be replaced with new APIs. @@ -27,10 +27,10 @@ For applications developed based on earlier versions, relevant JavaScript multi- **Adaptation Guide** -The following describes how to change **getMedia** to **getMediaContent** in callback mode. The promise mode is similar. You only need to change the function name, add the error code and error information, and keep other information unchanged. The sample code is as follows: +The following describes how to change **getMedia** to **getMediaContent** in callback mode. The promise mode is similar. You only need to change the function name, add the error code and error information, and keep other information unchanged. The code snippet is as follows: - Before the change: **getMedia(resource: Resource, callback: AsyncCallback): void;** -```ts + ```ts let resource = { bundleName: "com.example.myapplication", moduleName: "entry", diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md similarity index 53% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md index f109d28cec55335f3422fd063532aad1cafe310f..73ffb069e25875d25b14dd6c199996b4af8cdf2b 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.2/changelog-resourceschedule.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md @@ -1,61 +1,60 @@ -# Resource Scheduler Subsystem ChangeLog +# Resource Scheduler Subsystem Changelog -## cl.resourceschedule.backgroundTaskManager - +## cl.resourceschedule.backgroundTaskManager Rectified original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. -**Change Impacts** +**Change Impact** The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. **Key API/Component Changes** -The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are migrated to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. | Class| API Type| Declaration| Description| | -- | -- | -- | -- | -| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | This API is changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | This API is deprecated in API version 9 and later versions and is migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | export enum ResourceType | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | CPU = 1 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| -| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | This API is changed in API version 9 and migrated to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| - - -**Adaptation Guide**
+| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | Changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | export enum ResourceType | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | CPU = 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| + + +**Adaptation Guide** Import the **backgroundTaskManager** module. ``` @@ -63,107 +62,106 @@ import bundle form '@ohos.resourceschedule.backgroundTaskManager' ``` Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md). -## c2.resourceschedule.usageStatistics - +## c2.resourceschedule.usageStatistics Rectified original APIs of **deviceUsageStatistics** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. -**Change Impacts** +**Change Impact** The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. **Key API/Component Changes** -The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.bundleState.d.ts** file is deprecated, the **@ohos.resourceschedule.usageStatistics.d.ts** file is added, and the class name is changed from **bundleState** to **usageStatistics**. +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.bundleState.d.ts** file is deprecated, the **@ohos.resourceschedule.usageStatistics.d.ts** file is added, and the class name is changed from **bundleState** to **usageStatistics**. -| Class | API Type | Method/Attribute/Enumeration/Constant | Change Type | +| Class | API Type | Method/Attribute/Enum/Constant | Change Type | | ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback): void; | Deprecated and migrated to **usageStatistics.isIdleState** | -| bundleState | method | function isIdleState(bundleName: string): Promise; | Deprecated and migrated to **usageStatistics.isIdleState** | -| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback): void;**| -| bundleState | method | function queryAppUsagePriorityGroup(): Promise; | Deprecated and changed to **function queryAppGroup(): Promise;** | -| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;**| -| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise;**| -| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;**| -| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;**| -| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise>;**| -| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**| -| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise>;**| -| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**| -| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise>; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number): Promise>;** and **function QueryModuleUsageRecords(): Promise>;**| -| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; | Deprecated and changed to the following two APIs: **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback>): void;**| -| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise;**| -| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback): void;**| -| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;**| -| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise;**| -| bundleState | method | function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;**| -| bundleState | method | function registerGroupCallBack(callback: Callback): Promise; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback): Promise;**| -| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback): void; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise;**| -| bundleState | method | function unRegisterGroupCallBack(): Promise; | Deprecated and changed to **function unregisterAppGroupCallBack(): Promise;**| +| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback): void; | Deprecated and moved to **usageStatistics.isIdleState**. | +| bundleState | method | function isIdleState(bundleName: string): Promise; | Deprecated and moved to **usageStatistics.isIdleState**. | +| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback): void;**.| +| bundleState | method | function queryAppUsagePriorityGroup(): Promise; | Deprecated and changed to **function queryAppGroup(): Promise;**. | +| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;**.| +| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise;**.| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;**.| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise>; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number): Promise>;** and **function QueryModuleUsageRecords(): Promise>;**.| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback>): void;**.| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise;**.| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback): void;**.| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;**.| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise;**.| +| bundleState | method | function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;**.| +| bundleState | method | function registerGroupCallBack(callback: Callback): Promise; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback): Promise;**.| +| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback): void; | Changed to **function unregisterAppGroupCallBack(): Promise;**.| +| bundleState | method | function unRegisterGroupCallBack(): Promise; | Changed to **function unregisterAppGroupCallBack(): Promise;**.| | bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void;**| -| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise>; | Changed in API version 9 and later versions to **function queryDeviceEventStats(begin: number, end: number): Promise>;**| -| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void;**| -| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise>; | Changed in API version 9 and later versions to **function queryNotificationEventStats(begin: number, end: number): Promise>;**| -| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Changed to **usageStatistics.AppGroupCallbackInfo** | -| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | -| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | -| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Changed and migrated to **usageStatistics.AppGroupCallbackInfo** | -| bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | Deprecated and changed to **appNewGroup** | -| bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | Deprecated and changed to **appOldGroup** | -| bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | Deprecated and changed to **usageStatistics.DeviceEventStats** | -| bundleState.BundleActiveEventState | field | count: number | Changed and migrated to **usageStatistics.DeviceEventStats** | -| bundleState.BundleActiveEventState | field | eventId: number | Changed and migrated to **usageStatistics.DeviceEventStats** | -| bundleState.BundleActiveEventState | field | name: string | Changed and migrated to **usageStatistics.DeviceEventStats** | -| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 and later versions to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | formRecords: Array | Changed to **formRecords: Array** | -| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | launchedCount: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | labelId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | abilityName?: string | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | moduleName: string | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | bundleName: string | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.BundleActiveModuleInfo | field | deviceId?: string | Changed and migrated to **usageStatistics.HapModuleInfo** | -| bundleState.GroupType | enum | enum GroupType | Changed and migrated to **usageStatistics.GroupType** | -| bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | Deprecated and changed to **ALIVE_GROUP** | -| bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | Deprecated and changed to **DAILY_GROUP** | -| bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | Deprecated and changed to **FIXED_GROUP** | -| bundleState.GroupType | enum | ACTIVE_GROUP_RARE | Deprecated and changed to **RARE_GROUP** | -| bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | Deprecated and changed to **LIMITED_GROUP** | -| bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | Deprecated and changed to **NEVER_GROUP** | -| bundleState.IntervalType | enum | enum IntervalType | Deprecated and migrated to **usageStatistics.IntervalType** | -| bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and migrated to **usageStatistics.IntervalType** | -| bundleState.IntervalType | enum | BY_DAILY | Deprecated and migrated to **usageStatistics.IntervalType** | -| bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and migrated to **usageStatistics.IntervalType** | -| bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and migrated to **usageStatistics.IntervalType** | -| bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and migrated to **usageStatistics.IntervalType** | -| bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | Deprecated and changed to **usageStatistics.BundleStatsMap** | -| bundleState.BundleActiveState | interface | interface BundleActiveState | Deprecated and changed to **usageStatistics.BundleEvents** | -| bundleState.BundleActiveState | field | stateType?: number | Deprecated and changed to **eventId** | -| bundleState.BundleActiveState | field | stateOccurredTime?: number | Deprecated and changed to **eventOccurredTime** | -| bundleState.BundleActiveState | field | nameOfClass?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | -| bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | -| bundleState.BundleActiveState | field | bundleName?: string | Deprecated and migrated to **usageStatistics.BundleEvents** | -| bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | Deprecated and changed to **appGroup** | -| bundleState.BundleStateInfo | interface | interface BundleStateInfo | Deprecated and changed to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | Deprecated | -| bundleState.BundleStateInfo | field | infosEndTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState.BundleStateInfo | field | id: number | Deprecated and migrated to **usageStatistics.BundleStatsInfo** | -| bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and migrated to **ohos.resourceschedule.usageStatistics.d.ts**| - - -**Adaptation Guide**
+| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise>; | Changed in API version 9 to **function queryDeviceEventStats(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise>; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number): Promise>;**.| +| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | Deprecated and changed to **appNewGroup**. | +| bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | Deprecated and changed to **appOldGroup**. | +| bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | Deprecated and changed to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | count: number | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | eventId: number | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | name: string | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | formRecords: Array | Changed to **formRecords: Array**. | +| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | launchedCount: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | labelId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityName?: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | moduleName: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | bundleName: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | deviceId?: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.GroupType | enum | enum GroupType | Moved to **usageStatistics.GroupType**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | Deprecated and changed to **ALIVE_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | Deprecated and changed to **DAILY_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | Deprecated and changed to **FIXED_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_RARE | Deprecated and changed to **RARE_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | Deprecated and changed to **LIMITED_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | Deprecated and changed to **NEVER_GROUP**. | +| bundleState.IntervalType | enum | enum IntervalType | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_DAILY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | Deprecated and changed to **usageStatistics.BundleStatsMap**. | +| bundleState.BundleActiveState | interface | interface BundleActiveState | Deprecated and changed to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | stateType?: number | Deprecated and changed to **eventId**. | +| bundleState.BundleActiveState | field | stateOccurredTime?: number | Deprecated and changed to **eventOccurredTime**. | +| bundleState.BundleActiveState | field | nameOfClass?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | Deprecated and changed to **appGroup**. | +| bundleState.BundleStateInfo | interface | interface BundleStateInfo | Deprecated and changed to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | Deprecated. | +| bundleState.BundleStateInfo | field | infosEndTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | id: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and moved to **ohos.resourceschedule.usageStatistics.d.ts**.| + + +**Adaptation Guide** Import the **usageStatistics** module. ``` @@ -172,70 +170,69 @@ import bundle form '@ohos.resourceschedule.usageStatistics' Exception handling also needs to be adapted. For details, see the [usageStatistics API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md). -## c3.resourceschedule.workScheduler - +## c3.resourceschedule.workScheduler Rectified original APIs of **workScheduler** of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications. -**Change Impacts** +**Change Impact** The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. **Key API/Component Changes** -The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are migrated to the newly added **@ohos.resourceschedule.workScheduler.d.ts** file. +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.workScheduler.d.ts** file. | Class| API Type| Declaration| Change Type| | -- | -- | -- | -- | -| workScheduler | namespace | declare namespace workScheduler | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function obtainAllWorks(): Promise>; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function getWorkStatus(workId: number): Promise; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| -| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and migrated to the **ohos.resourceschedule.workScheduler.d.ts** file| - - -**Adaptation Guide**
+| workScheduler | namespace | declare namespace workScheduler | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(): Promise>; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| + + +**Adaptation Guide** Import the **workScheduler** module. ``` @@ -245,71 +242,70 @@ Exception handling also needs to be adapted. For details, see the [workScheduler ## c4.resourceschedule.reminderAgent - Rectified original APIs of **reminderAgent** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. -**Change Impacts** +**Change Impact** The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. **Key API/Component Changes** -The following methods, attributes, enumerations, and constants are changed in API version 9 and later versions. The **@ohos.reminderAgent.d.ts** file is deprecated, the **@ohos.reminderAgentManager.d.ts** file is added, and the class name is changed from **reminderAgent** to **reminderAgentManager**. +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.reminderAgent.d.ts** file is deprecated, the **@ohos.reminderAgentManager.d.ts** file is added, and the class name is changed from **reminderAgent** to **reminderAgentManager**. -| Class | API Type | Method/Attribute/Enumeration/Constant | Change Type | +| Class | API Type | Method/Attribute/Enum/Constant | Change Type | | --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | cancelReminder(reminderId: number): Promise; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | getValidReminders(callback: AsyncCallback>): void; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | getValidReminders(): Promise>; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | cancelAllReminders(callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | cancelAllReminders(): Promise; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise; | Deprecated and migrated to **reminderAgentManager**| -| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and migrated to **reminderAgentManager.ActionButtonType**| -| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and migrated to **reminderAgentManager.ActionButtonType**| -| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and migrated to **reminderAgentManager.ReminderType**| -| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and migrated to **reminderAgentManager.ReminderType**| -| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and migrated to **reminderAgentManager.ReminderType**| -| reminderAgent.ActionButton | field | title:string | Deprecated and migrated to **reminderAgentManager.ActionButton**| -| reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and migrated to **reminderAgentManager.ActionButton**| -| reminderAgent.WantAgent | field | pkgName:string | Deprecated and migrated to **reminderAgentManager.WantAgent**| -| reminderAgent.WantAgent | field | abilityName:string | Deprecated and migrated to **reminderAgentManager.WantAgent**| -| reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and migrated to **reminderAgentManager.MaxScreenWantAgent**| -| reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and migrated to **reminderAgentManager.MaxScreenWantAgent**| -| reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | title?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | content?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and migrated to **reminderAgentManager.ReminderRequest**| -| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| -| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| -| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array | Deprecated and migrated to **reminderAgentManager.ReminderRequestCalendar**| -| reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| -| reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| -| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array | Deprecated and migrated to **reminderAgentManager.ReminderRequestAlarm**| -| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and migrated to **reminderAgentManager.ReminderRequestTimer**| -| reminderAgent.LocalDateTime | field | year:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| -| reminderAgent.LocalDateTime | field | month:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| -| reminderAgent.LocalDateTime | field | day:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| -| reminderAgent.LocalDateTime | field | hour:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| -| reminderAgent.LocalDateTime | field | minute:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| -| reminderAgent.LocalDateTime | field | second?:number | Deprecated and migrated to **reminderAgentManager.LocalDateTime**| - - -**Adaptation Guide**
+| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelReminder(reminderId: number): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | getValidReminders(callback: AsyncCallback>): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | getValidReminders(): Promise>; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelAllReminders(callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelAllReminders(): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ActionButton | field | title:string | Deprecated and moved to **reminderAgentManager.ActionButton**.| +| reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and moved to **reminderAgentManager.ActionButton**.| +| reminderAgent.WantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.| +| reminderAgent.WantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.| +| reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.| +| reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.| +| reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | title?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | content?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and moved to **reminderAgentManager.ReminderRequestTimer**.| +| reminderAgent.LocalDateTime | field | year:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | month:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | day:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | hour:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | minute:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | second?:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| + + +**Adaptation Guide** Import the **reminderAgentManager** module. ``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-telephony.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-telephony.md similarity index 77% rename from en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-telephony.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-telephony.md index 9e31a3ecf2f85cc83be7eace01d25fe8f060e238..1d72dd98d69e748adcf597fa4eb970ccd2ba6670 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-telephony.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-telephony.md @@ -4,17 +4,21 @@ ## cl.telephony.1 Input Parameter Change of System APIs of the SMS Module -Input parameters are changed for some released system APIs of the SMS module of the telephony subsystem, which do not comply with the API specifications of OpenHarmony. The following changes are made in API version 9 and later: +Input parameters are changed for some released system APIs of the SMS module of the telephony subsystem, leading to noncompliance with the API specifications of OpenHarmony. The following changes are made in API version 9 and later: The **slotId** parameter is added to the **isImsSmsSupported** API, indicating the slot ID. -**Change Impacts** -Input parameters of JavaScript APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + +**Change Impact** + +Input parameters of JS APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + + **Key API/Component Changes** -- Involved APIs +- Involved APIs: isImsSmsSupported(callback: AsyncCallback): void; isImsSmsSupported(): Promise; @@ -33,6 +37,8 @@ function isImsSmsSupported(slotId: number, callback: AsyncCallback): vo function isImsSmsSupported(slotId: number): Promise; ``` + + **Adaptation Guide** Add an input parameter. The sample code is as follows: @@ -56,4 +62,4 @@ promise.then(data => { }).catch(err => { console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`); }); -``` \ No newline at end of file +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-testfwk_arkxtest.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-testfwk_arkxtest.md similarity index 62% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-testfwk_arkxtest.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-testfwk_arkxtest.md index 69bf6038edfb09bcee929d5f85bb66254ef58ab7..48e66b1bbf35ef9d79889ea95c2c460d8d8eb8ad 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-testfwk_arkxtest.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-testfwk_arkxtest.md @@ -2,7 +2,7 @@ ## cl.testfwk_arkxtest.1 Exception Handling Support of On, Driver, and Component APIs -The original APIs in API version 8 are deprecated, and substitute APIs that support exception handling are introduced in API version 9. You must use **try catch** to capture exceptions thrown by the APIs. +Deprecated the original APIs in API version 8, and introduced substitute APIs that support exception handling in API version 9. You must use **try catch** to capture exceptions thrown by the APIs. ## Change Impacts @@ -17,25 +17,25 @@ This change affects the JS APIs in API version 9 provided by **@ohos.uitest**. I ## Adaptation Guide -1. Adapt to the API name changes. +### 1. Adapt to the API name changes. - You can replace the class name according to the following rules: +You can replace the class name according to the following rules: - - `By-->On` - - `BY-->ON` - - `UiDriver-->Driver` - - `UiComponent-->Component` +- `By-->On` +- `BY-->ON` +- `UiDriver-->Driver` +- `UiComponent-->Component` -2. Catch and handle exceptions. +### 2. Catch and handle exceptions. - Use **try-catch** to catch and handle exceptions thrown by the APIs. Below is the sample code: +Use **try-catch** to catch and handle exceptions thrown by the APIs. Below is the sample code: - ```typescript - import {Driver,ON,Component} from '@ohos.uitest' - - try { - let driver = Driver.create(); - } catch (error) { - // error handle; error.code indicates the error code. - } - ``` \ No newline at end of file +```typescript +import {Driver,ON,Component} from '@ohos.uitest' + +try { + let driver = Driver.create(); +} catch (error) { + // error handle; error.code indicates the error code. +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-theme.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-theme.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-theme.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-theme.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-useriam.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-useriam.md similarity index 50% rename from en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-useriam.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-useriam.md index a9a1a8dd9d3b33f6a36b741d60e4859e61e00bee..61146c1ff8b3c53feb9d20ec72d768852abbb1f7 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.8.3/changelogs-useriam.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-useriam.md @@ -1,20 +1,20 @@ -# User IAM Subsystem ChangeLog +# User IAM Subsystem Changelog -## cl.useriam.1 API Exception Handling Method Change +## cl.useriam.1 API Exception Handling Change in APIs -Certain APIs of user IAM use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: +Certain user IAM APIs use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9: -An error message is returned via an exception. +An error message is returned by throwing an exception. -**Change Impacts** +**Change Impact** -Applications developed based on earlier versions are not affected. If your application uses API version 9 or later, you need to adapt the change in the way for APIs to return the error information. Otherwise, service logic will be affected. +Applications developed based on earlier versions are not affected. If your application uses API version 9 or later, you need to adapt the change in the way for APIs to return error information. Otherwise, service logic will be affected. **Key API/Component Changes** -For adaptation to the unified API exception handling mode, certain APIs of user IAM are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. +For easy use, related user IAM APIs are deprecated, and new APIs are added to implement unified error code handling. The functionalities of these APIs remain unchanged. -| Module | Class | Method/Attribute/Enumeration/Constant | Change Type | +| Module | Class | Method/Attribute/Enum/Constant | Change Type | | ---------------------- | ------------------- | ------------------------- | ------------------------ | | ohos.userIAM.userAuth | UserAuth | constructor() | Deprecated| | ohos.userIAM.userAuth | UserAuth | getVersion() : number | Deprecated| @@ -24,18 +24,18 @@ For adaptation to the unified API exception handling mode, certain APIs of user | ohos.userIAM.userAuth | IUserAuthCallback | onResult: (result : number, extraInfo : AuthResult) => void | Deprecated| | ohos.userIAM.userAuth | IUserAuthCallback | onAcquireInfo ?: (module : number, acquire : number, extraInfo : any) => void | Deprecated| | ohos.userIAM.userAuth | AuthResult | AuthResult {
token ?: Uint8Array;
remainTimes ?: number;
freezingTime ?: number;} | Deprecated| -| ohos.userIAM.userAuth | Enumeration| ResultCode {
SUCCESS = 0,
FAIL = 1,
GENERAL_ERROR = 2,
CANCELED = 3,
TIMEOUT = 4,
TYPE_NOT_SUPPORT = 5,
TRUST_LEVEL_NOT_SUPPORT = 6,
BUSY = 7,
INVALID_PARAMETERS = 8,
LOCKED = 9,
NOT_ENROLLED = 10,} | Deprecated| +| ohos.userIAM.userAuth | Enum| ResultCode {
SUCCESS = 0,
FAIL = 1,
GENERAL_ERROR = 2,
CANCELED = 3,
TIMEOUT = 4,
TYPE_NOT_SUPPORT = 5,
TRUST_LEVEL_NOT_SUPPORT = 6,
BUSY = 7,
INVALID_PARAMETERS = 8,
LOCKED = 9,
NOT_ENROLLED = 10,} | Deprecated| | ohos.userIAM.userAuth | type | AuthEventKey = "result" | Added| | ohos.userIAM.userAuth | type | EventInfo = AuthResultInfo | Added| | ohos.userIAM.userAuth | AuthResultInfo | AuthResultInfo {
result : number;
token ?: Uint8Array;
remainAttempts ?: number;
lockoutDuration ?: number;} | Added| | ohos.userIAM.userAuth | TipInfo | TipInfo {
module : number;
tip : number;} | Added| | ohos.userIAM.userAuth | AuthInstance | AuthInstance {
on: (name: AuthEventKey, callback: AuthEvent) => void;
off: (name: AuthEventKey) => void;
start: () => void;
cancel: () => void;} | Added| -| ohos.userIAM.userAuth | Enumeration| ResultCodeV9 {
SUCCESS = 12500000,
FAIL = 12500001,
GENERAL_ERROR = 12500002,
CANCELED = 12500003,
TIMEOUT = 12500004,
TYPE_NOT_SUPPORT = 12500005,
TRUST_LEVEL_NOT_SUPPORT = 12500006,
BUSY = 12500007,
LOCKED = 12500009,
NOT_ENROLLED = 12500010,} | Added| +| ohos.userIAM.userAuth | Enum| ResultCodeV9 {
SUCCESS = 12500000,
FAIL = 12500001,
GENERAL_ERROR = 12500002,
CANCELED = 12500003,
TIMEOUT = 12500004,
TYPE_NOT_SUPPORT = 12500005,
TRUST_LEVEL_NOT_SUPPORT = 12500006,
BUSY = 12500007,
LOCKED = 12500009,
NOT_ENROLLED = 12500010,} | Added| | ohos.userIAM.userAuth | function | getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel) : AuthInstance | Added| | ohos.userIAM.userAuth | function | getVersion() : number | Added| | ohos.userIAM.userAuth | function | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : void | Added| | ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId : string) : ResultCode | Deleted| -| ohos.userIAM.faceAuth | Enumeration| ResultCode {
SUCCESS = 0,
FAIL = 1,} | Deleted| +| ohos.userIAM.faceAuth | Enum| ResultCode {
SUCCESS = 0,
FAIL = 1,} | Deleted| | ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId: string) : void | Added| **Adaptation Guide** @@ -53,22 +53,22 @@ try { } ``` -For sample code of more APIs, see the [user authentication API reference](../../../application-dev/reference/apis/js-apis-useriam-userauth.md) and [face authentication API reference](../../../application-dev/reference/apis/js-apis-useriam-faceauth.md). +For more information about the APIs, see [User Authentication](../../../application-dev/reference/apis/js-apis-useriam-userauth.md) and [Facial Authentication](../../../application-dev/reference/apis/js-apis-useriam-faceauth.md). -## cl.useriam.2 API Call Permission Change +## cl.useriam.2 API Invoking Permission Change -Some APIs of user IAM can only be called by system applications, and system application runtime authentication is required. The following changes are made in API version 9 and later: +Some user IAM APIs can only be called by system applications, and system application runtime authentication is required. The following changes are made in API version 9: -The service logic for checking whether an application is a system application is added for the **setSurfaceId** API of the face authentication module. Non-system applications cannot call this API. +Added the service logic for checking whether an application is a system application to the **setSurfaceId** API of the facial authentication module. Non-system applications cannot call this API. -**Change Impacts** +**Change Impact** -Applications developed based on earlier versions are not affected. If your application uses API version 9 or later and wants to call this API, your application must be a system application. +Applications developed based on earlier versions are not affected. **Key API/Component Changes** -The service logic for checking whether an application is a system application is added for the **setSurfaceId** API. Error code **202** will be returned if the API is called by a non-system application. +The service logic for checking whether an application is a system application is added to **setSurfaceId()** . Error code **202** will be returned if the API is called by a non-system application. **Adaptation Guide** -Modify the **UnsgnedReleasedProfileTemplate.json** file related to [app signing](https://gitee.com/openharmony/developtools_hapsigner/tree/master/dist) to change the **app-feature** field to **hos_system_app**, so that the signed application is a system application. +Change the **app-feature** field to **hos_system_app** in the **UnsgnedReleasedProfileTemplate.json** file in [developtools_hapsigner](https://gitee.com/openharmony/developtools_hapsigner/tree/master/dist). Then, the signed application is a system application. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md similarity index 87% rename from en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md index a060017598caf758524179f7fa4ee836ee5f6fec..0700c6585be1ac90b3371ba7b230ef821a4d43ee 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md @@ -1,6 +1,4 @@ -# ChangeLog of JS API Changes in the WantAgent - -This document describes the WantAgent API changes in OpenHarmony 3.2.9.1 SP8 when compared with OpenHarmony 3.2.8.1. +# WantAgent JS API Changelog ## cl.url.1 Trigger API Changes trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void ; @@ -9,7 +7,7 @@ This API has been deleted, because some functions have not been implemented. You trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback): void -**Change Impacts** +**Change Impact** Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. @@ -71,7 +69,7 @@ function getWantAgentCallback(err, data) { // getUid callback function triggerCallback(err, data) { if(err) { - console.info('getUid failed!' + err.code + err.message); + console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); } else { console.info('getUid ok!' + JSON.stringify(data)); } @@ -79,12 +77,12 @@ function getWantAgentCallback(err, data) { try { WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); } catch(err) { - console.info('getUid failed!' + err.code + err.message); + console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); } } try{ WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); } catch(err){ - console.info('getWantAgent failed!' + err.code + err.message); + console.info('getWantAgent failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); } ``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-web.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-web.md similarity index 96% rename from en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-web.md rename to en/release-notes/changelogs/v3.2-beta4/changelogs-web.md index c9bccbb9f588c2ed237f73516a27d10effeded39..a754808f32c35ceab510e8a87150f9ed858b3c48 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-web.md +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-web.md @@ -1,7 +1,5 @@ # Web Subsystem ChangeLog -This document describes the web API changes in OpenHarmony 3.2.9.1 SP8 when compared with OpenHarmony 3.2.8.1. - ## cl.web.1 Deletion of Unnecessary Error Codes APIs in the webviewController component of the web subsystem are changed: diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-wifi.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-wifi.md new file mode 100644 index 0000000000000000000000000000000000000000..f2cd5ba5068c702016f1469cddac6810e3921cf8 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-wifi.md @@ -0,0 +1,115 @@ +# Wi-Fi Subsystem Changelog + + +## cl.wifi.1 Change of System APIs and APIs of Version 9 +Moved all system APIs and APIs of version 9 from **@ohos.wifi.d.ts** to the newly added **@ohos.wifiManager.d.ts**, and added error code description. The **@ohos.wifi.d.ts** APIs do not support error code handling. + +To use these APIs, import the **@ohos.wifiManager.d.ts** module as follows: + +import wifiManager from '@ohos.wifiManager'; + + +**Change Impact** + +System APIs and APIs of version 9 are affected. To use these APIs, import **@ohos.wifiManager** as follows: + +import wifiManager from '@ohos.wifiManager'; + +Other APIs are not affected. + + +**Key API/Component Changes** + +| Class| API Type| Declaration| Change Type| +| -- | -- | -- | -- | +| wifi | namespace | declare namespace wifi | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function enableWifi(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function disableWifi(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function scan(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function getScanResults(): Promise<Array<WifiScanInfo>> | Changed from **getScanInfos** to **getScanResults** and moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void | Changed from **getScanInfos** to **getScanResults** and moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function getScanResultsSync():  Array<[WifiScanInfo]> | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function addCandidateConfig(config: WifiDeviceConfig): Promise<number> | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function removeCandidateConfig(networkId: number): Promise<void> | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function removeCandidateConfig(networkId: number, callback: AsyncCallback<void>): void | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> | Deleted| +| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void | Deleted| +| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> | Deleted| +| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void | Deleted| +| wifi | method | function getCandidateConfigs():  Array<[WifiDeviceConfig]> | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function connectToCandidateConfig(networkId: number): void | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function connectToNetwork(networkId: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function connectToDevice(config: WifiDeviceConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function disconnect(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function reassociate(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function reconnect(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function disableNetwork(netId: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function removeAllNetwork(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function removeDevice(id: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function enableHotspot(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function disableHotspot(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function setHotspotConfig(config: HotspotConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function getP2pLocalDevice(): Promise<WifiP2pDevice> | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function getP2pLocalDevice(callback: AsyncCallback<WifiP2pDevice>): void | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>> | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void | Moved to **@ohos.wifiManager.d.ts**| +| wifi | method | function createGroup(config: WifiP2PConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function removeGroup(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function p2pConnect(config: WifiP2PConfig): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function p2pCancelConnect(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function startDiscoverDevices(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function stopDiscoverDevices(): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function deletePersistentGroup(netId: number): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | method | function setDeviceName(devName: string): void | Moved to **@ohos.wifiManager.d.ts**, with the return value changed to **void**| +| wifi | interface | export interface WifiEapConfig | Moved to **@ohos.wifiManager.d.ts**| +| wifi | enum | export enum EapMethod | Moved to **@ohos.wifiManager.d.ts**| +| wifi | enum | export enum Phase2Method | Moved to **@ohos.wifiManager.d.ts**| +| wifi | interface | export interface WifiDeviceConfig | Added with the **eapConfig** parameter and moved to **@ohos.wifiManager.d.ts**| +| wifi | interface | export interface IpConfig | Added with the **prefixLength** parameter and moved to **@ohos.wifiManager.d.ts**| +| wifi | interface | export interface WifiInfoElem | Moved to **@ohos.wifiManager.d.ts**| +| wifi | enum | export enum WifiChannelWidth | Moved to **@ohos.wifiManager.d.ts**| +| wifi | interface | export interface WifiScanInfo | Added with the **centerFrequency0**, **centerFrequency1**, and **infoElems** parameters and moved to **@ohos.wifiManager.d.ts**| +| wifi | enum | export enum WifiSecurityType | Added with four encryption types and moved to **@ohos.wifiManager.d.ts**| +| wifi | interface | export interface WifiLinkedInfo | Added with the **MacType** parameter and moved to **@ohos.wifiManager.d.ts**| + + +**Adaptation Guide** + +The following uses **getLinkedInfo** as an example: + +``` +import wifiManager from '@ohos.wifiManager' + +wifiManager.getLinkedInfo((err, data) => { + if (err) { + console.error("get linked info error"); + return; + } + console.info("get linked info: " + JSON.stringify(data)); +}); + +wifiManager.getLinkedInfo().then(data => { + console.info("get linked info: " + JSON.stringify(data)); +}).catch(error => { + console.info("get linked info error"); +}); + +``` + +## cl.wifiext.1 Change of System APIs and APIs of Version 9 + +Moved all system APIs and APIs of version 9 from **@ohos.wifiext.d.ts** to the newly added **@ohos.wifiManagerExt.d.ts**, and added error code description. + +To use these APIs, import the **@ohos.wifiManagerExt.d.ts** module as follows: + +import wifiManagerExt from '@ohos.wifiManagerExt'; + + +**Change Impact** + +System APIs and APIs of version 9 are affected. Import **@ohos.wifiManagerExt** and use it together with **wifiManager**. + +import wifiManagerExt from '@ohos.wifiManagerExt'; + +Other APIs are not affected. diff --git a/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md b/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md new file mode 100644 index 0000000000000000000000000000000000000000..fb9d008aee389972cd00926b4fad6d66b408bb05 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/Readme-EN.md @@ -0,0 +1,27 @@ +# Readme + +- [Ability framework](changelogs-ability.md) +- [Account subsystem](changelogs-account_os_account.md) +- [ArkUI development framework](changelogs-arkui.md) +- [Multimedia subsystem - camera](changelogs-camera-sync.md) +- [Common library subsystem - container](changelogs-container.md) +- [Distributed data management](changelogs-distributeddatamgr.md) +- [File management subsystem](changelogs-filemanagement.md) +- [Input method framework](changelogs-inputmethod-framworks.md) +- [File management subsystem - MediaLibrary](changelogs-mediaLibrary.md) +- [Multimedia subsystem](changelogs-multimedia.md) +- [Communication subsystem - NFC](changelogs-nfc.md) +- [Common event and notification subsystem](changelogs-notification.md) +- Location subsystem + - [ohos.geoLocationManager](changelogs-ohos-geoLocationManager.md) + - [ohos.geoLocation](changelogs-ohos-geolocation.md) + - [system.geolocation](changelogs-system-geolocation.md) +- [Upload and download](changelogs-request.md) +- [Resource scheduler subsystem](changelogs-resourceschedule.md) +- [Security subsystem](changelogs-security.md) +- [Telephony subsystem](changelogs-telephony.md) +- [Time service](changelogs-time.md) +- [Common library subsystem - URL](changelogs-url.md) +- [User IAM subsystem](changelogs-useriam.md) +- [Window manager subsystem](changelogs-window.md) + diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelog-x-x.md b/en/release-notes/changelogs/v3.2-beta5/changelog-x-x.md similarity index 88% rename from en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelog-x-x.md rename to en/release-notes/changelogs/v3.2-beta5/changelog-x-x.md index 3ac3e83268d2ac247676cd313d5b5e45d195ea2b..dcc7cd9aabb636ed248b5a37383410d4218b346f 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.3/changelog-x-x.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelog-x-x.md @@ -1,31 +1,26 @@ -# *Example* Subsystem ChangeLog +# *Example* Subsystem Changelog -Changes that affect contract compatibility of the last version should be described in the ChangeLog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. +Changes that affect contract compatibility of the last version should be described in the changelog. The changes include but are not limited to those related to API names, parameters, return values, required permissions, call sequence, enumerated values, configuration parameters, and paths. The last version can be an LTS, release, beta, or monthly version, or the like. Contract compatibility, also called semantic compatibility, means that the original program behavior should remain consistent over versions. ## cl.subsystemname.x xxx Function Change (Example: DeviceType Attribute Change or Camera Permission Change. Use a short description.) -Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of ChangeLog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). - +Add the number **cl.*subsystemname*.*x*** before each change title, where **cl** is the abbreviation of changelog, *subsystemname* is the standard English name of the subsystem, and *x* indicates the change sequence number (starting from 1 in ascending order). Describe the changes in terms of functions. Example: *n* and *m* of the *a* function are changed. Developers need to adapt their applications based on the change description. - If there is a requirement or design document corresponding to the change, attach the requirement number or design document number in the description. -**Change Impacts** +**Change Impact** Describe whether released APIs (JS or native APIs) are affected or API behavior is changed. - Describe whether available applications are affected, that is, whether an adaptation is required for building the application code in the SDK environment of the new version. **Key API/Component Changes** List the API/component changes involved in the function change. -**Adaptation Guide (Optional)** +**Adaptation Guide** Provide guidance for developers on how to adapt their application to the changes to be compatible with the new version. - Example: - Change parameter *n* to *m* in the *a* file. ``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-ability.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-ability.md similarity index 80% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-ability.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-ability.md index 7bac43bac44302e751f466896946d345a5ed90f9..6117462498c03b872b83d1cde479be6b2f094a01 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-ability.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-ability.md @@ -1,15 +1,13 @@ -# Ability Subsystem Changelog - -Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(MR) has the following API changes in the ability subsystem: +# Ability Framework Changelog ## cl.ability.1 API Migration The **requestPermissionsFromUser** API of **UIAbilityContext** is migrated from the ability subsystem to the security subsystem. Previously, the permission popup was implemented based on **UIAbility**, which used the **startAbilityForResult** API of **UIAbilityContext** to return the permission authorization result to the caller. Therefore, **requestPermissionsFromUser** was temporarily placed in **UIAbilityContext**. The permission popup is now implemented based on **ServiceExtensionAbility**, which no longer requires **startAbilityForResult** of **UIAbilityContext**. Therefore, **requestPermissionsFromUser** is migrated to the security subsystem. -You need to adapt your application. +You need to adapt your application based on the following information. -**Change Impact** + **Change Impact** JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. @@ -50,7 +48,7 @@ onWindowStageCreate() { ## cl.ability.2 Deletion of Deprecated APIs in API Version 9 -In the [Ability Exception Rectification](../OpenHarmony_3.2.8.3/changelogs-ability.md) document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted. +In the **Ability Exception Rectification** document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted. **Change Impact** @@ -112,10 +110,6 @@ APIs or attributes are deleted: - @ohos.wantAgent.d.ts - **TriggerInfo** and **WantAgentInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.wantAgent.d.ts**. - - - - **Adaptation Guide** As mentioned above, only several APIs have their names changed in terms of, for example, the registration callbacks (**registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback**) and connection and disconnection **ServiceExtensionAbility** (**connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility**). For such APIs, replace their names with those of their corresponding new APIs in the lifecycle callbacks. @@ -135,3 +129,40 @@ import Ability from '@ohos.app.ability.UIAbility'; ``` In addition, exception handling is needed. For details, see the API reference for the new APIs. + +## cl.ability.3 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.3/changelogs-account_os_account.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-arkui.md similarity index 73% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-arkui.md index 8b4e22b93cf9d6124ac0ac1082ad903fb25ba11d..f4262ae286c279a79b30a657e24faea35b3c7fac 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-arkui.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-arkui.md @@ -102,7 +102,7 @@ N/A 1. Explicitly declare the data type for state variables decorated by state decorators. 2. If a state variable decorated by a state decorator uses the **Date** object, change it to a regular variable – a variable not decorated by any decorator. 3. Adapt the **@State**, **@Provide**, **@Link**, and **@Consume** decorated variables based on the following code snippet so that they do not use the **Length(string|number|Resource)**, **ResourceStr(string|Resource)**, and **ResourceColor(string|number|Color|Resource)** types: - + ```ts // Incorrect: @State message: ResourceStr = $r('app.string.hello') @@ -214,4 +214,121 @@ N/A To change these variables from the parent component, use the API provided by the **LocalStorage** (such as the **set** API) to assign values to them. -2. For details about how to use **@ObjectLink**, see [@Observed and @ObjectLink](../../../application-dev/quick-start/arkts-observed-and-objectlink.md). +2. For details about how to use **@ObjectLink**, see @ObjectLink. + +## 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.arkui.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.arkui.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.arkui.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.arkui.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.arkui.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 +``` \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md similarity index 93% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md index c20c9e4c50f8de7ba2c8a0323f19d2000e4007ad..ef66b7500c4b5fccde024c10c95beeca5b6cbd5d 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-camera-sync.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md @@ -1,18 +1,16 @@ -# Multimedia Subsystem ChangeLog - -Compared with OpenHarmony 3.2 Beta4, OpenHarmony3.2.10.3 has the following changes in APIs of the camera component in the multimedia subsystem. +# Multimedia Subsystem Changelog ## cl.subsystemname.1 Camera API Changed 1. All the APIs of the camera component are changed to system APIs in the API version 9. 2. Some functional APIs are added and some others are deprecated to: -- Improve the usability of camera APIs. -- Help you quickly understand camera APIs and use them for development. -- Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules. +Improve the usability of camera APIs. +Help you quickly understand camera APIs and use them for development. +Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules. You need to refer to the following change description to adapt your application. -**Change Impacts** +**Change Impact** JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. @@ -57,7 +55,7 @@ JS APIs in API version 9 are affected. Your application needs to adapt these API **Adaptation Guide** -In addition to the new APIs and deprecated APIs, you need to adapt your application to the changed APIs. +In addition to new APIs and deprecated APIs, you need to adapt your application to changed APIs. In Beta4 and later versions, the following APIs are changed. @@ -135,388 +133,388 @@ In Beta4 and later versions, the following APIs are changed. 1. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback): void** and **getCameraManager(context: Context): Promise** are changed to **getCameraManager(context: Context): CameraManager**. - The sample code is as follows: + The code snippet is as follows: ``` let cameraManager = camera.getCameraManager(context); ``` - + 2. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback>): void** and **getSupportedCameras(): Promise>** are changed to **getSupportedCameras(): Array**. - The sample code is as follows: + The code snippet is as follows: ``` let cameras = cameraManager.getSupportedCameras(); ``` - + 3. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**. - The sample code is as follows: - + The code snippet is as follows: + ``` let cameraDevice = cameras[0]; let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); ``` - + 4. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback): void** and **createCameraInput(camera: CameraDevice): Promise** are changed to **createCameraInput(camera: CameraDevice): CameraInput**. - The sample code is as follows: - + The code snippet is as follows: + ``` let cameraDevice = cameras[0]; let cameraInput = cameraManager.createCameraInput(cameraDevice); ``` - + 5. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**. - The sample code is as follows: - + The code snippet is as follows: + ``` let cameraDevice = cameras[0]; let position = cameraDevice.cameraPosition; let type = cameraDevice.cameraType; let cameraInput = cameraManager.createCameraInput(position, type); ``` - + 6. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**. - The sample code is as follows: - + The code snippet is as follows: + ``` let profile = cameraoutputcapability.previewProfiles[0]; let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); ``` - + 7. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**. - The sample code is as follows: - + The code snippet is as follows: + ``` let profile = cameraoutputcapability.photoProfiles[0]; let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); ``` - + 8. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**. - The sample code is as follows: - + The code snippet is as follows: + ``` let profile = cameraoutputcapability.videoProfiles[0]; let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); ``` - + 9. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void** and **createMetadataOutput(metadataObjectTypes: Array): Promise** are changed to **createMetadataOutput(metadataObjectTypes: Array): MetadataOutput**. - The sample code is as follows: - + The code snippet is as follows: + ``` let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); ``` - + 10. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback): void** and **createCaptureSession(): Promise** are changed to **createCaptureSession(): CaptureSession**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let captureSession = cameraManager.createCaptureSession(); - ``` + ``` 11. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**. 12. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let cameraDevice = cameras[0]; cameraInput.on('error', cameraDevice, (BusinessError) => { - + }) - ``` + ``` 13. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback): void** and **beginConfig(): Promise** are changed to **beginConfig(): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.beginConfig(); - ``` + ``` 14. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback): void** and **addInput(cameraInput: CameraInput): Promise** are changed to **addInput(cameraInput: CameraInput): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.addInput(cameraInput); - ``` + ``` 15. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback): void** and **removeInput(cameraInput: CameraInput): Promise** are changed to **removeInput(cameraInput: CameraInput): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.removeInput(cameraInput); - ``` + ``` 16. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void** and **addOutput(cameraOutput: CameraOutput): Promise** are changed to **addOutput(cameraOutput: CameraOutput): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.addOutput(previewOutput); - ``` + ``` 17. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void** and **removeOutput(cameraOutput: CameraOutput): Promise** are changed to **removeOutput(cameraOutput: CameraOutput): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.removeOutput(previewOutput); - ``` + ``` 18. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback): void** and **hasFlash(): Promise** are changed to **hasFlash(): boolean**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let status = captureSession.hasFlash(); - ``` + ``` 19. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void** and **isFlashModeSupported(flashMode: FlashMode): Promise** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); - ``` + ``` 20. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback): void** and **getFlashMode(): Promise** are changed to **getFlashMode(): FlashMode**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let flashMode = captureSession.getFlashMode(); - ``` + ``` 21. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); - ``` + ``` 22. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback): void** and **getExposureMode(): Promise** are changed to **getExposureMode(): ExposureMode**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let exposureMode = captureSession.getExposureMode(); - ``` + ``` 23. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void** and **setExposureMode(aeMode: ExposureMode): Promise** are changed to **setExposureMode(aeMode: ExposureMode): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); - ``` + ``` 24. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback): void** and **getMeteringPoint(): Promise** are changed to **getMeteringPoint(): Point**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let exposurePoint = captureSession.getMeteringPoint(); - ``` + ``` 25. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback): void** and **setMeteringPoint(point: Point): Promise** are changed to **setMeteringPoint(point: Point): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let Point2 = {x: 2, y: 2}; captureSession.setMeteringPoint(Point2); - ``` + ``` 26. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback>): void** and **getExposureBiasRange(): Promise>** are changed to **getExposureBiasRange(): Array**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let biasRangeArray = captureSession.getExposureBiasRange(); - ``` + ``` 27. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback): void** and **setExposureBias(exposureBias: number): Promise** are changed to **setExposureBias(exposureBias: number): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let exposureBias = biasRangeArray[0]; captureSession.setExposureBias(exposureBias); - ``` + ``` 28. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback): void** and **getExposureValue(): Promise** are changed to **getExposureValue(): number**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let exposureValue = captureSession.getExposureValue(); - ``` + ``` 29. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void** and **isFocusModeSupported(afMode: FocusMode): Promise** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); - ``` + ``` 30. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback): void** and **getFocusMode(): Promise** are changed to **getFocusMode(): FocusMode**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let afMode = captureSession.getFocusMode(); - ``` + ``` 31. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback): void** and **setFocusMode(afMode: FocusMode): Promise** are changed to **setFocusMode(afMode: FocusMode): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); - ``` + ``` 32. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback): void** and **setFocusPoint(point: Point): Promise** are changed to **setFocusPoint(point: Point): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let Point2 = {x: 2, y: 2}; captureSession.setFocusPoint(Point2); - ``` + ``` 33. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback): void** and **getFocusPoint(): Promise** are changed to **getFocusPoint(): Point**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let point = captureSession.getFocusPoint(); - ``` + ``` 34. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback): void** and **getFocalLength(): Promise** are changed to **getFocalLength(): number**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let focalLength = captureSession.getFocalLength(); - ``` + ``` 35. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback>): void** and **getZoomRatioRange(): Promise>** are changed to **getZoomRatioRange(): Array**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let zoomRatioRange = captureSession.getZoomRatioRange(); - ``` + ``` 36. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback): void** and **getZoomRatio(): Promise** are changed to **getZoomRatio(): number**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let zoomRatio = captureSession.getZoomRatio(); - ``` + ``` 37. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback): void** and **setZoomRatio(zoomRatio: number): Promise** are changed to **setZoomRatio(zoomRatio: number): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let zoomRatio = zoomRatioRange[0]; captureSession.setZoomRatio(zoomRatio); - ``` + ``` 38. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); - ``` + ``` 39. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback): void** and **getActiveVideoStabilizationMode(): Promise** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let vsMode = captureSession.getActiveVideoStabilizationMode(); - ``` + ``` 40. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); - ``` + ``` 41. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` captureSession.on('error', (BusinessError) => { - + }) - ``` + ``` 42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` previewOutput.on('error', (BusinessError) => { - + }) - ``` + ``` 43. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback): void** and **isMirrorSupported(): Promise** are changed to **isMirrorSupported(): boolean**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` let isSupported = photoOutput.isMirrorSupported(); - ``` + ``` 44. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` PhotoOutput.on('error', (BusinessError) => { - + }) - ``` + ``` 45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` VideoOutput.on('error', (BusinessError) => { - + }) - ``` + ``` 46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback** to **ErrorCallback**. Therefore, the original API **on(type: 'error', callback: ErrorCallback): void** is changed to **on(type: 'error', callback: ErrorCallback): void**. - The sample code is as follows: + The code snippet is as follows: - ``` + ``` MetadataOutput.on('error', (BusinessError) => { - + }) - ``` \ No newline at end of file + ``` \ No newline at end of file diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-container.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-container.md new file mode 100644 index 0000000000000000000000000000000000000000..6bd06001584f34addcbec3f81a80d47d482e7ffe --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-container.md @@ -0,0 +1,21 @@ +# Common Library Subsystem Changelog + +## cl.commonlibrary.1 Error Code and Information Change +The error codes and information returned by APIs of the **ArrayList**, **List**, **LinkedList**, **Stack**, **Queue**, **Deque**, **PlainArray**, **LightWeightMap**, **LightWeightSet**, **HashMap**, **HashSet**, **TreeMap**, and **TreeSet** classes are changed. + +For details about the changed error codes, see [Utils Error Codes](../../../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 Impact** + +No impact. diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md new file mode 100644 index 0000000000000000000000000000000000000000..20f6121d2cc72d776f490cafb627128dec59fb3c --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md @@ -0,0 +1,168 @@ +# Distributed Data Management Subsystem JS API Changelog + +## cl.distributeddatamgr.1 API Change +Changed the APIs in **kv_store** of the distributed data management subsystem: + +Changed the **createKVManager()** implementation from asynchronous mode to synchronous mode because the execution duration is fixed and short. + +Before change:
**createKVManager(config: KVManagerConfig): Promise\;**
**createKVManager(config: KVManagerConfig, callback: AsyncCallback): void;**
After change:
**createKVManager(config: KVManagerConfig): KVManager;** + +You need to adapt your application. + +**Change Impact** + +JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enum/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 Move of getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +Moved **getRdbStoreV9()** from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts, and renamed it **getRdbStore()**. + +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**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; +``` +Moved the above APIs 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** + * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + * Change the names of the **getRdbStore()** APIs. + +## cl.distributeddatamgr.3 Move of deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts + +Moved **deleteRdbStoreV9()** from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts, and renamed it **deleteRdbStore()**. + +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**Key API/Component Changes** +APIs: +```ts +function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; +function deleteRdbStoreV9(context: Context, name: string): Promise; +``` +Moved the above APIs from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. +``` +function deleteRdbStore(context: Context, name: string, callback: AsyncCallback): void; +function deleteRdbStore(context: Context, name: string): Promise; +``` + +**Adaptation Guide** + * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + * Change the names of the **deleteRdbStoreV9()** APIs. + +## cl.distributeddatamgr.4 Move of StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**Key API/Component Changes** +Moved **StoreConfigV9** from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **StoreConfig**. + +**Adaptation Guide** + + * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + * Change the **StoreConfigV9** in APIs. + +## cl.distributeddatamgr.5 Move of enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**Key API/Component Changes** +Moved **enum SecurityLevel** from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. + +**Adaptation Guide** + +Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + +## cl.distributeddatamgr.6 Mover of RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**Key API/Component Changes** +Moved **RdbStoreV9** from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **RdbStore**. + +**Adaptation Guide** + * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + * Change **RdbStoreV9** in relevant APIs. + +## cl.distributeddatamgr.7 Move of class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**Key API/Component Changes** +Moved the class **RdbPredicatesV9** from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **RdbPredicates**. + +**Adaptation Guide** + * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + * Change **RdbPredicatesV9** in the relevant APIs. + +## cl.distributeddatamgr.8 Move of ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts +**Change Impact** +The change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. + +**Key API/Component Changes** +Moved **ResultSetV9** from **api/data/rdb/resultSet.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **ResultSet**. + +**Adaptation Guide** + * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. + * Obtain the **ResultSetV9** instance only by using **getRdbStoreV9**. After modifications are made according to cl.distributeddatamgr.2, the code can automatically adapt to **ResultSet**. + diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md new file mode 100644 index 0000000000000000000000000000000000000000..5e8d6ff199e2f3786489708028e9e3744d3e3530 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md @@ -0,0 +1,145 @@ +# File Management Subsystem Changelog + +## cl.filemanagement.1 environment Module Change + +Moved the file management subsystem **d.ts** file 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](../v3.2-beta4/changelogs-filemanagement.md) for more details. + +**Key API/Component Changes** + +Before the change, **environment** was 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](../v3.2-beta4/changelogs-filemanagement.md) for more details. + +**Key API/Component Changes** + +Before the change, **securityLabel** was 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](../v3.2-beta4/changelogs-filemanagement.md) for more details. + +**Key API/Component Changes** + +Before the change, **fileAccess** was 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](../v3.2-beta4/changelogs-filemanagement.md) for more details. + +**Key API/Component Changes** + +Before the change, **fileExtensionInfo** was 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](../v3.2-beta4/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](../v3.2-beta4/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'; +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-inputmethod-framworks.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md similarity index 65% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-inputmethod-framworks.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md index 3318c618bd3cb511da78865aa85a779c689673fb..b8dc285044dc94ad02ba7cc17ea70005e1f282da 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-inputmethod-framworks.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md @@ -4,12 +4,12 @@ The following modules do not comply with the OpenHarmony API file naming rules. Therefore, they are modified in API version 9 and later. -**Change Impacts** - -The SDK after the change is incompatible with the earlier versions. Therefore, adaptation is required for applications developed in earlier versions so that they can be properly built with the SDK in the new version. - -**Key API/Component Changes** - + **Change Impacts** + + The SDK after the change is incompatible with the earlier versions. Therefore, adaptation is required for applications developed in earlier versions so that they can be properly built with the SDK in the new version. + + **Key API/Component Changes** + | Module| File Name Before Change| File Name After Change| |------|--------------|--------------| | Input method framework module| @ohos.inputmethod.d.ts |@ohos.inputMethod.d.ts | @@ -17,15 +17,14 @@ The SDK after the change is incompatible with the earlier versions. Therefore, a | Input method ExtentionAbility module| @ohos.inputmethodextensionability.d.ts | @ohos.InputMethodExtensionAbility.d.ts | | Input method ExtentionContext module|@ohos.inputmethodextensioncontext.d.ts | @ohos.InputMethodExtensionContext.d.ts | | Input method subtype module| @ohos.inputMethodSubtype.d.ts | @ohos.InputMethodSubtype.d.ts | - -**Adaptation Guide** - -In the application code, change the name of the d.ts file following **import** to the new file name, which complies with the UpperCamelCase or lowerCamelCase style. - -Example: - + + **Adaptation Guide** + + In the application code, change the name of the d.ts file following **import** to the new file name, which complies with the UpperCamelCase or lowerCamelCase style. + Example: + ```js import inputMethodEngine from '@ohos.inputMethodEngine'; ``` - + diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-mediaLibrary.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md similarity index 51% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-mediaLibrary.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md index b3e49188e7630f1f6a5cd7c1d43f6d85d302b2d8..459adbacf8a02fbb45ef82ee6bb6dba706633258 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-mediaLibrary.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md @@ -1,33 +1,64 @@ -# File Subsystem Changelog +# File Management Subsystem Changelog ## cl.file.1 mediaLibrary APIs Changed -All APIs provided by the mediaLibrary module of the multimedia subsystem are deprecated. +The **MediaLibrary** class of the multimedia component is replaced by the **FilePicker** class. **Change Impact** -All APIs described in [mediaLibrary](../../../application-dev/reference/apis/js-apis-medialibrary.md) are deprecated. Third-party applications can only select and save files in the public directory by calling the APIs of [FilePicker](../../../application-dev/reference/apis/js-apis-file-picker.md). -For applications developed based on earlier versions, pay attention to the changes of APIs. +For applications developed based on earlier versions, pay attention to the changes of APIs. **FilePicker** is a system application preset in OpenHarmony. You can use it to select and save files. **Key API/Component Changes** -The table below lists the **mediaLibrary** APIs that can be substituted by the **FilePicker** APIs. +The APIs of **MediaLibrary**, located in **@ohos.multimedia.medialibrary**, are deprecated. The **FilePicker** class, located in [@ohos.file.picker](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.file.picker.d.ts) is used. | Module | Method/Attribute/Enum/Constant | Change Type| | ------------------------- | ------------------------------------------------------------ | -------- | +| medialibrary | **function** getMediaLibrary(): MediaLibrary; | Deprecated | | medialibrary | **function** getMediaLibrary(context: Context): MediaLibrary; | Deprecated | | medialibrary | **function** getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\ | Deprecated | +| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void | Deprecated | +| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void | Deprecated | | medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\ | Deprecated | +| medialibrary | **function** deleteAsset(uri: string): Promise\ | Deprecated | +| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\ | Deprecated | -| medialibrary | **function** release(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\\> | Deprecated | +| medialibrary | **function** release(callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** release(): Promise\ | Deprecated | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\ | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** startImagePreview(images: Array\, index?: number): Promise\ | Deprecated | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\\>): void | Deprecated | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\\> | Deprecated | +| medialibrary | **function** getActivePeers(): Promise\\>; | Deprecated | +| medialibrary | **function** getActivePeers(callback: AsyncCallback\\>): void; | Deprecated | +| medialibrary | **function** getAllPeers(): Promise\\>; | Deprecated | +| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isDirectory():Promise\ | Deprecated | +| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.commitModify(): Promise\ | Deprecated | | medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** FileAsset.open(mode: string): Promise\ | Deprecated | | medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** FileAsset.close(fd: number): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isFavorite():Promise\ | Deprecated | +| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\ | Deprecated | +| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** FileAsset.isTrash():Promise\ | Deprecated | | medialibrary | **function** FetchFileResult.getCount(): number | Deprecated | | medialibrary | **function** FetchFileResult.isAfterLast(): boolean | Deprecated | | medialibrary | **function** FetchFileResult.close(): void | Deprecated | @@ -41,232 +72,45 @@ The table below lists the **mediaLibrary** APIs that can be substituted by the * | medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\ | Deprecated | | medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\\>): void | Deprecated | | medialibrary | **function** FetchFileResult.getAllObject(): Promise\\> | Deprecated | +| medialibrary | **function** Album.commitModify(callback: AsyncCallback\): void | Deprecated | +| medialibrary | **function** Album.commitModify(): Promise\ | Deprecated | | medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | Deprecated | | medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\ | Deprecated | +| medialibrary | **enum** DeviceType | Deprecated | | medialibrary | **enum** FileKey | Deprecated | | medialibrary | **enum** DirectoryType | Deprecated | | medialibrary | **enum** MediaType | Deprecated | +| medialibrary | **interface** PeerInfo | Deprecated | +| medialibrary | **interface** Size | Deprecated | | medialibrary | **interface** MediaFetchOptions | Deprecated | +| medialibrary | **interface** MediaAssetOption | Deprecated | +| medialibrary | **interface** MediaSelectOption | Deprecated | | medialibrary | **interface** FileAsset | Deprecated | **Adaptation Guide** -**The following example shows how to use the mediaLibrary APIs to edit a file in the public directory:** - -1. Call **getMediaLibrary** to obtain a **mediaLibrary** instance. -2. Create a **MediaFetchOptions** object, and call **getFileAssets** to obtain files in the public directory. -3. Call the **FetchFileResult** APIs to obtain the file asset of the target file. -4. Call **fileAsset.open** to open the file and obtain the FD. -5. Call [fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync) to edit the file through the FD. -6. After the edit, call **fileAsset.close** to close the FD of the file. -7. Call **fetchFileResult.close** to release the resources occupied by **getFileAssets**. -8. Call **release** to release the **mediaLibrary** instance. - -**Example** - -```js -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import fs from '@ohos.file.fs'; - -async function example() { - try { - let context = getContext(this); - let media = mediaLibrary.getMediaLibrary(context); - let fileKeyObj = mediaLibrary.FileKey; - let imageType = mediaLibrary.MediaType.IMAGE; - let getImageOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [imageType.toString()], - order: fileKeyObj.DATE_ADDED + ' DESC', - }; - const fetchFileResult = await media.getFileAssets(getImageOp); - const fileAsset = await fetchFileResult.getFirstObject(); - console.info('mediaLibrary fileAsset displayName: ' + fileAsset.displayName); - let fd = await fileAsset.open('rw'); - console.info('mediaLibrary fileAsset open fd: ' + fd); - let writeLen = fs.writeSync(fd, 'hello, world'); - console.info('write data to file succeed and size is: ' + writeLen); - fileAsset.close(fd); - fetchFileResult.close(); - media.release(); - } catch (err) { - console.error('mediaLibrary fail, err: ' + err); - } -} -``` - -**The following example shows how to use the FilePicker APIs to edit a file in the public directory:** - -1. Obtain a **DocumentViewPicker** object. -2. Call **DocumentViewPicker.select** to select a file. -3. After a file is selected, a file URI is returned. -4. After the UI is returned from DocumentViewPicker, call [fs.openSync](../../../application-dev/reference/apis/js-apis-file-fs.md#fsopensync) to open the file based on the URI and obtain the FD. -5. Call [fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync) to edit the file through the FD. -6. After the edit, call [fs.closeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#closesync) to close the FD. - -**Example** - -```js -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import picker from '@ohos.file.picker'; -import fs from '@ohos.file.fs'; - -let uri; - -async function example() { - try { - let DocumentSelectOptions = new picker.DocumentSelectOptions(); - let documentPicker = new picker.DocumentViewPicker(); - documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult) => { - console.info('DocumentViewPicker.select successfully, DocumentSelectResult uri: ' + JSON.stringify(DocumentSelectResult)); - uri = DocumentSelectResult[0]; - }).catch((err) => { - console.error('DocumentViewPicker.select failed with err: ' + err); - }); - } catch (err) { - console.error('DocumentViewPicker failed with err: ' + err); - } -} - -async function writeFile() { - try { - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); - console.info('DocumentViewPicker file fd: ' + file.fd); - let writeLen = fs.writeSync(file.fd, 'hello, world'); - console.info('write data to file succeed and size is: ' + writeLen); - fs.closeSync(file); - } catch (err) { - console.error('DocumentViewPicker fail, err: ' + err); - } -} -``` - -**The following example shows how to use the mediaLibrary APIs to create a file in the public directory:** - -1. Call **getMediaLibrary** to obtain a **mediaLibrary** instance. -2. Call **getPublicDirectory** to obtain the path of the public directory. -3. Call **createAsset** to create a file and obtain the file asset. -4. Call **fileAsset.open** to open the file and obtain the FD. -5. Call **fs.write** to edit the file through the FD. -6. After the edit, call **fileAsset.close** to close the FD. -7. Call **release** to release the **mediaLibrary** instance. - -**Example** +For example, refer to the code snippet below to call an API to select an image: ```js -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; -import fs from '@ohos.file.fs'; - -async function example() { - try { - let context = getContext(this); - let media = mediaLibrary.getMediaLibrary(context); - let mediaType = mediaLibrary.MediaType.FILE; - let DIR_DOWNLOAD = mediaLibrary.DirectoryType.DIR_DOWNLOAD; - const path = await media.getPublicDirectory(DIR_DOWNLOAD); - const fileAsset = await media.createAsset(mediaType, 'test.txt', path); - console.info('mediaLibrary fileAsset displayName: ' + fileAsset.displayName); - let fd = await fileAsset.open('rw'); - console.info('mediaLibrary fileAsset open fd: ' + fd); - let writeLen = fs.writeSync(fd, 'hello, world'); - console.info('write data to file succeed and size is: ' + writeLen); - fileAsset.close(fd); - media.release(); - } catch (err) { - console.error('mediaLibrary fail, err: ' + err); - } -} -``` - -**The following example shows how to use the FilePicker APIs to create a file in the public directory:** - -1. Obtain a **DocumentViewPicker** object. -2. Call **DocumentViewPicker.save** to create and save an empty file. -3. After the file is saved, a file URI is returned. -4. After the UI is returned from DocumentViewPicker, call [fs.openSync](../../../application-dev/reference/apis/js-apis-file-fs.md#fsopensync) to open the file based on the URI and obtain the FD. -5. Call [fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync) to edit the file through the FD. -6. After the edit, call [fs.closeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#closesync) to close the FD. - -**Example** - -```js -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; import picker from '@ohos.file.picker'; -import fs from '@ohos.file.fs'; - -let uri; async function example() { - try { - let DocumentSaveOptions = new picker.DocumentSaveOptions(); - DocumentSaveOptions.newFileNames = ['DocumentViewPicker01.txt']; - let documentPicker = new picker.DocumentViewPicker(); - documentPicker.save(DocumentSaveOptions).then((DocumentSaveResult) => { - console.info('DocumentViewPicker.save successfully, DocumentSaveResult uri: ' + JSON.stringify(DocumentSaveResult)); - uri = DocumentSaveResult[0]; - }).catch((err) => { - console.error('DocumentViewPicker.save failed with err: ' + err); - }); - } catch (err) { - console.error('DocumentViewPicker failed with err: ' + err); - } -} - -async function writeFile() { - try { - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); - console.info('DocumentViewPicker file fd: ' + file.fd); - let writeLen = fs.writeSync(file.fd, 'hello, world'); - console.info('write data to file succeed and size is: ' + writeLen); - fs.closeSync(file); - } catch (err) { - console.error('DocumentViewPicker fail, err: ' + err); - } + try { + let PhotoSelectOptions = new picker.PhotoSelectOptions(); + PhotoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE; + PhotoSelectOptions.maxSelectNumber = 1; + let photoPicker = new picker.PhotoViewPicker(); + photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult) => { + if (PhotoSelectResult !== undefined) { + console.info("PhotoViewPicker.select pass, PhotoSelectResult uri: " + JSON.stringify(PhotoSelectResult)); + } else { + console.error("PhotoViewPicker.select PhotoSelectResult is undefined"); + } + }).catch((err) => { + console.error("PhotoViewPicker.select fail, err: " + err); + }); + } catch (err) { + console.error("PhotoViewPicker fail, err: " + err); + } } ``` - -**Key API/Component Changes** - -The table below lists the mediaLibrary APIs that are not open to third-party applications due to function control. There are no substitute APIs for them. - -| Module | Method/Attribute/Enum/Constant | Change Type| -| ------------------------- | ------------------------------------------------------------ | -------- | -| medialibrary | **function** getMediaLibrary(): MediaLibrary; | Deprecated | -| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void | Deprecated | -| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void | Deprecated | -| medialibrary | **function** deleteAsset(uri: string): Promise\ | Deprecated | -| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\ | Deprecated | -| medialibrary | **function** startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** startImagePreview(images: Array\, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** startImagePreview(images: Array\, index?: number): Promise\ | Deprecated | -| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\\>): void | Deprecated | -| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\\> | Deprecated | -| medialibrary | **function** getActivePeers(): Promise\\>; | Deprecated | -| medialibrary | **function** getActivePeers(callback: AsyncCallback\\>): void; | Deprecated | -| medialibrary | **function** getAllPeers(): Promise\\>; | Deprecated | -| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.isDirectory():Promise\ | Deprecated | -| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.commitModify(): Promise\ | Deprecated | -| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\ | Deprecated | -| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\ | Deprecated | -| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.isFavorite():Promise\ | Deprecated | -| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\ | Deprecated | -| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** FileAsset.isTrash():Promise\ | Deprecated | -| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\\>): void | Deprecated | -| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\\> | Deprecated | -| medialibrary | **function** Album.commitModify(callback: AsyncCallback\): void | Deprecated | -| medialibrary | **function** Album.commitModify(): Promise\ | Deprecated | -| medialibrary | **enum** DeviceType | Deprecated | -| medialibrary | **interface** PeerInfo | Deprecated | -| medialibrary | **interface** Size | Deprecated | -| medialibrary | **interface** MediaAssetOption | Deprecated | -| medialibrary | **interface** MediaSelectOption | Deprecated | diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-multimedia.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md similarity index 95% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-multimedia.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md index 4b223c8ac73a16fceaa2002167640f8aeb94fabd..ffeb68c714639f07a5b53a0bacaca16be2aab81a 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-multimedia.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md @@ -2,7 +2,7 @@ All av_session APIs are changed to system APIs. -**Change Impacts** +**Change Impact** Non-system applications and applications without system API permission cannot call system APIs. @@ -10,7 +10,7 @@ Non-system applications and applications without system API permission cannot ca All APIs are changed to system APIs. The table below describes the APIs. -| API, Enumeration, or Variable| Type| Is System API| +| API/Enum/Variable| Type| Is System API| | -------- | -------- | ------- | | SessionToken | interface | Yes| | AVMetadata | interface | Yes| diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md new file mode 100644 index 0000000000000000000000000000000000000000..d1693278786b3ebcb09e1bbb60e33177b7cec656 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md @@ -0,0 +1,58 @@ +# Changelog of NFC JS APIs in the Communication Subsystem + +## cl.nfc.1 API Change +Deprecated some NFC JS APIs in API versions 6 to 8 because the APIs cannot throw error codes, and added new APIs in API version 9 instead. + +You need to adapt your application based on the following information. + + **Change Impact** + +The deprecated 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** + +See the following: +[@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](../../../application-dev/reference/apis/js-apis-cardEmulation.md) + +[@ohos.nfc.controller (Standard NFC)](../../../application-dev/reference/apis/js-apis-nfcController.md) + +[@ohos.nfc.tag (Standard NFC Tags)](../../../application-dev/reference/apis/js-apis-nfcTag.md) + +[tagSession (Standard NFC Tag Session)](../../../application-dev/reference/apis/js-apis-tagSession.md) +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-notification.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-notification.md similarity index 91% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-notification.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-notification.md index 9a1113faab7fcf5329564939b5be571da88dec80..2a028d4b32b85c1f6894139df16cfa11d1f78c9a 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-notification.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-notification.md @@ -2,7 +2,7 @@ ## cl.notification.1 Deleting Deprecated APIs (Version 9) -In the [event notification exception handling rectification](../OpenHarmony_3.2.8.3/changelogs-notification.md), some APIs in API version 9 are marked as deprecated, and these APIs need to be deleted, according to OpenHarmony API specifications. +In the event notification exception handling rectification, some APIs in API version 9 are marked as deprecated, and these APIs need to be deleted, according to OpenHarmony API specifications. **Change Impacts** diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md new file mode 100644 index 0000000000000000000000000000000000000000..fe1db611f384bf1550c0fa4583df6c9fd186d7e4 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md @@ -0,0 +1,107 @@ +# 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 Impact** + +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/v3.2-beta5/changelogs-ohos-geolocation.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md new file mode 100644 index 0000000000000000000000000000000000000000..aaa0ed72daf37764bbf4cc36a23b783799d2e6bb --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md @@ -0,0 +1,92 @@ +# 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 Impact** + +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.6/changelogs-request.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-request.md similarity index 53% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-request.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-request.md index f5d0e2eb9849c362fc25c6c106c127aeacfdd471..d3e9b53e4d93fb4e6067a7485dbfa0925b2404d9 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-request.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-request.md @@ -1,31 +1,31 @@ # Upload and Download Subsystem Changelog -## cl.request.2 request API Change +## cl.request.2 Upload and Download API Change -Deleted the beta APIs in API version 9: - -1. function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback\): void; -2. function download(context: BaseContext, config: DownloadConfig): Promise\; -3. function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback\): void; -4. function upload(context: BaseContext, config: UploadConfig): Promise\; +- Deleted the beta APIs in API version 9: +1. function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; +2. function download(context: BaseContext, config: DownloadConfig): Promise; +3. function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; +4. function upload(context: BaseContext, config: UploadConfig): Promise; **Change Impact** -The application developed based on an earlier version in the stage model needs to be adapted to the new APIs. Otherwise, the original service logic will be affected. +The application developed based on the Stage mode of earlier versions needs to be adapted. Otherwise, the service logic will be affected. **Key API/Component Changes** -| Module | Class | Method/Attribute/Enum/Constant | Change Type| +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| |--------------|--------------|-------------------------------------------------------------------------------------------------------------------|------| -| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback\): void; | Deleted | -| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise\; | Deleted | -| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback\): void; | Deleted | -| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise\; | Deleted | +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; | Deleted. | +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise; | Deleted. | +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | Deleted. | +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise; | Deleted. | + **Adaptation Guide** -Call the new APIs. The following uses **downloadFile** as an example to show how it is called in the new version: +The following sample code shows how to call **downloadFile** in the new version: ```ts try { diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelog-resourceschedule.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md similarity index 99% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelog-resourceschedule.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md index 48da92c6fc824d0d4f799c21bf28906a1a784040..8df3e6671bd98eb04092412fd0c6e563268fb91d 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelog-resourceschedule.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md @@ -1,4 +1,4 @@ -# Resource Scheduler Subsystem ChangeLog +# Resource Scheduler Subsystem Changelog ## cl.resourceschedule.backgroundTaskManager Rectified the original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs of API version 9 in the **@ohos.backgroundTaskManager.d.ts** file are deleted, and the APIs of API version 9 in the **@ohos.resourceschedule.backgroundTaskManager.d.ts** file are used. The new APIs in API version 9 comply with the error code specifications. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-security.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-security.md similarity index 53% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-security.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-security.md index 4bd1acf87dcc5940947215d8c3dd3d459d0c49bc..94ef4335af23115d485ea58eb5ce28af9e4aedc9 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelog-security.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-security.md @@ -1,354 +1,354 @@ -# Security Subsystem ChangeLog +# Security Subsystem Changelog -## cl.security.1 Change of the setSeed API of Random from Asynchronous to Synchronous +## cl.security.1 Change of setSeed() from Asynchronous to Synchronous -**Change Impacts** +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: setSeed(seed : DataBlob, callback : AsyncCallback\) : void; setSeed(seed : DataBlob) : Promise\; -API prototype after the change: +API after the change: setSeed(seed : DataBlob) : void; **Adaptation Guide** -See the API adaptation guide of **setSeed** in the API reference: -[Crypto Framework - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cryptoFramework.md) +See **setSeed()** in the following: +[Crypto Framework](../../../application-dev/reference/apis/js-apis-cryptoFramework.md) -## cl.security.2 Migration of interface DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.2 Move of DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.3 Migration of interface EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.3 Move of EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.4 Migration of interface EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.4 Move of EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.5 Migration of interface CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.5 Move of CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.6 Migration of interface X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.6 Move of X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.7 Migration of function createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.7 Move of createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **function createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.8 Migration of interface X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts. -**Change Impacts** +## cl.security.8 Move of X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts. +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.9 Migration of interface X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.9 Move of X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.10 Migration of function createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.10 Move of createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **function createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.11 Migration of interface CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.11 Move of CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **interface CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.12 Migration of function createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts -**Change Impacts** +## cl.security.12 Move of createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -Migrated **function createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. +Moved **createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. **Adaptation Guide** Import and use the new .d.ts file: import cryptoCert from '@ohos.security.cert'; -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.13 Change of the getPublicKey API of X509Cert from Asynchronous to Synchronous -**Change Impacts** +## cl.security.13 Change of getPublicKey() of X509Cert from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: getPublicKey(callback : AsyncCallback\) : void; getPublicKey() : Promise\; -API prototype after the change: +API after the change: getPublicKey() : cryptoFramework.PubKey; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.14 Change of the checkValidityWithDate API of X509Cert from Asynchronous to Synchronous -**Change Impacts** +## cl.security.14 Change of checkValidityWithDate of X509Cert from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: checkValidityWithDate(date: string, callback : AsyncCallback\) : void; checkValidityWithDate(date: string) : Promise\; -API prototype after the change: +API after the change: checkValidityWithDate(date: string) : void; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.15 Change of the getCertIssuer API of X509CrlEntry from Asynchronous to Synchronous -**Change Impacts** +## cl.security.15 Change of getCertIssuer of X509CrlEntry from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: getCertIssuer(callback : AsyncCallback\) : void; getCertIssuer() : Promise\; -API prototype after the change: +API after the change: getCertIssuer() : DataBlob; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.16 Change of the getRevocationDate API of X509CrlEntry from Asynchronous to Synchronous -**Change Impacts** +## cl.security.16 Change of getRevocationDate of X509CrlEntry from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: getRevocationDate(callback : AsyncCallback\) : void; getRevocationDate() : Promise\; -API prototype after the change: +API after the change: getRevocationDate() : string; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.17 Change of the isRevoked API of X509Crl from Asynchronous to Synchronous -**Change Impacts** +## cl.security.17 Change of isRevoked of X509Crl from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: isRevoked(cert : X509Cert, callback : AsyncCallback\) : void; isRevoked(cert : X509Cert) : Promise\; -API prototype after the change: +API after the change: isRevoked(cert : X509Cert) : boolean; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.18 Change of the getRevokedCert API of X509Crl from Asynchronous to Synchronous -**Change Impacts** +## cl.security.18 Change of getRevokedCert of X509Crl from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: getRevokedCert(serialNumber : number, callback : AsyncCallback\) : void; getRevokedCert(serialNumber : number) : Promise\; -API prototype after the change: +API after the change: getRevokedCert(serialNumber : number) : X509CrlEntry; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.19 Change of the getRevokedCertWithCert API of X509Crl from Asynchronous to Synchronous -**Change Impacts** +## cl.security.19 Change of getRevokedCertWithCert of X509Crl from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\) : void; getRevokedCertWithCert(cert : X509Cert) : Promise\; -API prototype after the change: +API after the change: getRevokedCertWithCert(cert : X509Cert) : X509CrlEntry; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) -## cl.security.20 Change of the getTbsInfo API of X509Crl from Asynchronous to Synchronous -**Change Impacts** +## cl.security.20 Change of getTbsInfo of X509Crl from Asynchronous to Synchronous +**Change Impact** Behavior of released JavaScript APIs will be changed. 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** -API prototype before the change: +API before the change: getTbsInfo(callback : AsyncCallback\) : void; getTbsInfo() : Promise\; -API prototype after the change: +API after the change: getTbsInfo() : DataBlob; **Adaptation Guide** -See the corresponding API adaptation guide in the API reference: -[Certificate - API Reference](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-cert.md) +See the following API reference: +[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) ## cl.security.21 Support of No-Hash Signing Mode for HUKS -Before the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS uses **huks.HuksKeyDigest.HUKS_DIGEST_SHA256** for processing by default. After the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS does not perform digest processing by default. In this case, the service needs to perform the hash operation on the original data and then pass the hashed digest to HUKS for signing or signature verification. +Before the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS uses **huks.HuksKeyDigest.HUKS_DIGEST_SHA256** for processing by default. After the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS does not generate a digest by default. Instead, the service performs a hash operation on the original data and then passes a hashed digest to HUKS for signing or signature verification. -**Change Impacts** +**Change Impact** Behavior of released JavaScript APIs will be changed. The application needs to adapt these APIs so that the signing or signature verification result can be passed before and after the change. @@ -357,11 +357,11 @@ The application needs to adapt these APIs so that the signing or signature verif Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed. -The service uses the No-Hash signing mode, and needs to hash the original data and then pass the hashed digest to the signing or signature verification API of HUKS. In addition, the **huks.HuksTag.HUKS_TAG_DIGEST** parameter is set to **huks.HuksKeyDigest.HUKS_DIGEST_NONE**. +The service uses the No-Hash signing mode, and hashes the original data and then passes a hashed digest to the signing or signature verification API of HUKS. In addition, the **huks.HuksTag.HUKS_TAG_DIGEST** parameter is set to **huks.HuksKeyDigest.HUKS_DIGEST_NONE**. **Adaptation Guide** -Take signing as an example. The sample code is as follows: +The following uses signing as an example. ```js import huks from '@ohos.security.huks'; @@ -399,13 +399,13 @@ let signOptions = { huks.initSession(keyAlias, signOptions); ``` -For sample codes of other APIs, see [HUKS guidelines](../../../application-dev/security/huks-guidelines.md) and [HUKS APIs](../../../application-dev/reference/apis/js-apis-huks.md). +For for information about the sample code, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md). -## cl.security.22 Support of Key Calculation Parameter Specification for HUKS During Key Usage +## cl.security.22 Support for Key Calculation Parameter Specifications During Key Usage -Before the change, all parameters for key calculation must be specified when the application generates a key. After the change, only mandatory parameters need to be specified when the application generates a key, and other parameters can be specified when the key is used. The application can specify key calculation parameters more flexibly. +Before the change, all parameters for key calculation must be specified when the application generates a key. After the change, only mandatory parameters need to be specified when the application generates a key, and other parameters can be passed in when the key is used. The application can specify key calculation parameters more flexibly. -**Change Impacts** +**Change Impact** Behavior of released JavaScript APIs will be changed. @@ -413,7 +413,7 @@ The application can specify only mandatory parameters when creating a key and sp **Key API/Component Changes** -Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed and parameters are classified into mandatory parameters and optional parameters. For details, see [HUKS guidelines](../../../application-dev/security/huks-guidelines.md). +Released JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed and parameters are classified into mandatory parameters and optional parameters. For details, see [HUKS Development](../../../application-dev/security/huks-guidelines.md). huks.generateKeyItem @@ -429,7 +429,7 @@ huks.finishSession **Adaptation Guide** -Take key generation as an example. The sample code is as follows: +The following uses the key generation process as an example. ```js let keyAlias = 'keyAlias'; @@ -472,4 +472,4 @@ try { } ``` -For sample codes of other APIs, see [HUKS guidelines](../../../application-dev/security/huks-guidelines.md) and [HUKS APIs](../../../application-dev/reference/apis/js-apis-huks.md). +For for information about the sample code, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md). diff --git a/en/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md new file mode 100644 index 0000000000000000000000000000000000000000..70dc51c8a568783425dba3b5d56791a43274258f --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md @@ -0,0 +1,50 @@ +# 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 Impact** + +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-telephony.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md similarity index 89% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-telephony.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md index 63af2cfb5f1e316fd85236469dcc16ac9e51506e..222ae6bf97ebe7c9b9cacea29fba53436c73cb9d 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.6/changelogs-telephony.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md @@ -5,15 +5,15 @@ ## cl.telephony.1 Radio Module API Change -### Changed the `isNrSupported` API in the radio module of the telephone subsystem: +### Changed the `isNrSupported` API in the radio module of the telephony subsystem: NR is a proper noun and must be capitalized. -You need to adapt your application. +You need to adapt your application based on the following information. -**Change Impacts** +**Change Impact** The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-time.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-time.md similarity index 100% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-time.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-time.md diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-url.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-url.md similarity index 92% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-url.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-url.md index c5f219a9dca53926c131a4bf36e17122e2b47cce..4dfc6cacb85bb40bc9f02dab6343a82d4dbf7691 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.1/changelogs-url.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-url.md @@ -1,9 +1,6 @@ # Common Library Subsystem Changelog -Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(MR) has the following API changes in the URL module of the common library subsystem. - ## cl.commonlibrary.1 URLParams Class Changes - The constructor function of the **URLParams** class in the URL module of the common library subsystem is changed. Specifically, **constructor(init?: string[][] | Record | string | URLSearchParams)** is changed to **constructor(init?: string[][] | Record | string | URLParams)**, and the parameter type is changed from **URLSearchParams** to **URLParams**. @@ -19,7 +16,7 @@ JS APIs in API version 9 are affected. Your application needs to adapt these API | Module | Class | Method/Attribute/Enum/Constant | Change Type| | :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | | @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLSearchParams) | Deleted | -| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLParams)| Changed +| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLParams)| Changed | **Adaptation Guide** @@ -39,14 +36,13 @@ try { } ``` ## cl.commonlibrary.2 URL Attribute Changes of URLParams Class APIs - The URL attributes of the URL module in the common library subsystem are changed. Specifically, the **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added. You need to adapt your application. -**Change Impacts** + **Change Impacts** JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-useriam.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-useriam.md similarity index 60% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-useriam.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-useriam.md index a3abb3143332e234f4583eaffc95aed632cb5260..b081b93fe1433c2268715314a2bef6a746b8e18b 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-useriam.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-useriam.md @@ -1,10 +1,10 @@ -# User IAM Subsystem ChangeLog +# User IAM Subsystem Changelog -## cl.useriam.1 API9 Authentication Result Code Class Name Change +## cl.useriam.1 API9 Result Value Change -The name of the authentication result code class of user IAM API version 9 is changed from **ResultCode** to **UserAuthResultCode**. +Changed the return value **ResultCodeV9** to **UserAuthResultCode** for API9. -**Change Impacts** +**Change Impact** Applications developed based on earlier versions are not affected. For the applications developed from this version, the class name of the error code needs to be adapted. Otherwise, the service logic is affected. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-window.md b/en/release-notes/changelogs/v3.2-beta5/changelogs-window.md similarity index 98% rename from en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-window.md rename to en/release-notes/changelogs/v3.2-beta5/changelogs-window.md index b3514e82cca44c154a70b999e6cc62a54d47ff92..45f62272f6749f6822179648004f04623401a093 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-window.md +++ b/en/release-notes/changelogs/v3.2-beta5/changelogs-window.md @@ -1,4 +1,4 @@ -# Window Subsystem ChangeLog +# Window Manager Subsystem Changelog ## cl.window.1 Change of Window Stage Lifecycle Listener Types diff --git a/zh-cn/application-dev/application-dev-guide.md b/zh-cn/application-dev/application-dev-guide.md index c32eb246e3601a9025b0240335725a8ca0e867e1..670f1f64246963e00e00cc1e1c27259b31613248 100644 --- a/zh-cn/application-dev/application-dev-guide.md +++ b/zh-cn/application-dev/application-dev-guide.md @@ -1,7 +1,7 @@ # 应用开发导读 > **说明**: -> 您当前正在浏览OpenHarmony 4.0 Beta1版本的配套文档,请获取与该版本[配套的SDK](release-notes/OpenHarmony-v4.0-beta1.md#配套关系)开发应用。 +> 您当前正在浏览OpenHarmony 4.0 Beta1版本的配套文档,请获取与该版本[配套的SDK](../release-notes/OpenHarmony-v4.0-beta1.md#配套关系)开发应用。 应用开发文档用于指导开发者通过OpenHarmony提供的接口完成应用开发。当前应用开发文档提供了在标准系统上开发应用的JS接口。 diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md b/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md index cedc34b23bb67788c98024bea7b4ad303075f175..0289fc67984d9cce33aed0ddc3d537fa3a7c7a40 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-event-call.md @@ -60,7 +60,7 @@ } function FunBCall(data) { - console.info('FunACall param:' + JSON.stringify(data.readString())); + console.info('FunBCall param:' + JSON.stringify(data.readString())); return null; } @@ -71,11 +71,13 @@ // 监听call事件所需的方法 this.callee.on('funA', FunACall); this.callee.on('funB', FunBCall); - } catch (error) { + } catch (err) { console.error(`Failed to register callee on. Cause: ${JSON.stringify(err)}`); } } + ... + // 进程退出时,解除监听 onDestroy() { try { diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md b/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md index 1e984be68a6921e90853dd064ebc040308689d2a..67845df50f758ec6b99f4bcd69ce7421d5fc2d14 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-event-overview.md @@ -55,7 +55,7 @@ Button('拉至后台') 'abilityName': 'EntryAbility', 'params': { 'method': 'fun', // 自定义调用的方法名,必填 - 'message': 'testForcall' // 自定义要发送的message + 'message': 'testForCall' // 自定义要发送的message } }); }) diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md b/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md index 009683ed2d6a21fc29d2a0c0fce0e2d43e126f4e..857c403ab6aeeb7025bb694885273c0f0ed75aa1 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md @@ -148,7 +148,6 @@ import UIAbility from '@ohos.app.ability.UIAbility'; import formBindingData from '@ohos.app.form.formBindingData'; import formProvider from '@ohos.app.form.formProvider'; - import formInfo from '@ohos.app.form.formInfo'; const MSG_SEND_METHOD: string = 'funA'; diff --git a/zh-cn/application-dev/application-models/uiability-launch-type.md b/zh-cn/application-dev/application-models/uiability-launch-type.md index 263dc70696a7ab8e0058516203d76b5692d18b34..724e5b5ee637d20b912c7fba6daf9229f01c1440 100644 --- a/zh-cn/application-dev/application-models/uiability-launch-type.md +++ b/zh-cn/application-dev/application-models/uiability-launch-type.md @@ -90,7 +90,7 @@ specified启动模式为指定实例模式,针对一些特殊场景使用( } ``` -2. 在创建UIAbility实例之前,开发者可以为该实例指定一个唯一的字符串Key,这样在调用[`startAbility()`](.../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability)方法时,应用就可以根据指定的Key来识别响应请求的UIAbility实例。在EntryAbility中,调用[`startAbility()`](.../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability)方法时,可以在`want`参数中增加一个自定义参数,例如`instanceKey`,以此来区分不同的UIAbility实例。 +2. 在创建UIAbility实例之前,开发者可以为该实例指定一个唯一的字符串Key,这样在调用[`startAbility()`](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability)方法时,应用就可以根据指定的Key来识别响应请求的UIAbility实例。在EntryAbility中,调用[`startAbility()`](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability)方法时,可以在`want`参数中增加一个自定义参数,例如`instanceKey`,以此来区分不同的UIAbility实例。 ```ts // 在启动指定实例模式的UIAbility时,给每一个UIAbility实例配置一个独立的Key标识 diff --git a/zh-cn/application-dev/quick-start/arkts-style.md b/zh-cn/application-dev/quick-start/arkts-style.md index 04a862b4a6c13dd6386738971e8630b883707e2b..3fbf608cb33814888c1ad2012fe0578d952d3044 100644 --- a/zh-cn/application-dev/quick-start/arkts-style.md +++ b/zh-cn/application-dev/quick-start/arkts-style.md @@ -94,7 +94,7 @@ struct FancyUse { Text('FancyA') .globalFancy () .fontSize(30) - // 使用全局的@Styles封装的样式 + // 使用组件内的@Styles封装的样式 Text('FancyB') .fancy() .fontSize(30) diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md index 22e2fd481fed190b88ee82b92d27a9acca1c9b43..d71dabc4c8b38071f30c5d8ef766aab50721f36b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md +++ b/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md @@ -197,7 +197,7 @@ grantUserGrantedPermission(tokenID: number, permissionName: Permissions, permiss | tokenID | number | 是 | 目标应用的身份标识。可通过应用的[ApplicationInfo](js-apis-bundleManager-applicationInfo.md)获得。| | permissionName | Permissions | 是 | 被授予的权限名称,合法的权限名取值可在[系统权限定义列表](../../security/permission-list.md)中查询。 | | permissionFlags | number | 是 | 授权选项
- 0表示权限未经过用户主动设置。
- 1表示当次用户若选择禁止该权限,下次权限弹窗仍可以弹出申请用户授权。
- 2表示当次用户若选择禁止该权限,下次不会再弹出权限弹窗,需要用户在setting的权限管理中进行授权。
- 4表示当次权限设置为系统授权,用户不可更改这个权限授权状态。 | -| callback | AsyncCallback<void> | 是 | 授予应用user grant权限。当授予权限成功时,err为undefine;否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 授予应用user grant权限。当授予权限成功时,err为undefined;否则为错误对象。 | **错误码:** @@ -308,7 +308,7 @@ revokeUserGrantedPermission(tokenID: number, permissionName: Permissions, permis | tokenID | number | 是 | 目标应用的身份标识。可通过应用的[ApplicationInfo](js-apis-bundleManager-applicationInfo.md)获得。 | | permissionName | Permissions | 是 | 被撤销的权限名称,合法的权限名取值可在[系统权限定义列表](../../security/permission-list.md)中查询。 | | permissionFlags | number | 是 | 授权选项
- 0表示权限未经过用户主动设置。
- 1表示当次用户若选择禁止该权限,下次权限弹窗仍可以弹出申请用户授权。
- 2表示当次用户若选择禁止该权限,下次不会再弹出权限弹窗,需要用户在setting的权限管理中进行授权。
- 4表示当次权限设置为系统授权,用户不可更改这个权限授权状态。 | -| callback | AsyncCallback<void> | 是 | 撤销应用user grant权限。当撤销权限成功时,err为undefine;否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 撤销应用user grant权限。当撤销权限成功时,err为undefined;否则为错误对象。 | **错误码:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-animator.md b/zh-cn/application-dev/reference/apis/js-apis-animator.md index b0c58257114f39e21f789d3239e32dfb6b9f913d..16c362683449d14287bd8bfa9a8b3ed2e187ede9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-animator.md +++ b/zh-cn/application-dev/reference/apis/js-apis-animator.md @@ -6,7 +6,7 @@ > > 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > -> 该模块不支持在[UIAbility](./js-apis-app-ability-uiAbility.md)中使用。 +> 该模块不支持在[UIAbility](./js-apis-app-ability-uiAbility.md)中使用,需要在创建组件实例后使用。 ## 导入模块 diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md b/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md index c5f817c83f7f8940ceca599bffde8e812c356d3c..51000aff51856c265eff8d7c1c3d1e99d3a8b873 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md @@ -368,8 +368,8 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback, callba | 参数名 | 类型 | 必填 | 说明 | | --------- | --------------------------------------- | ---- | ----- | -| parameter | [ContinueDeviceInfo](#js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | -| options | [ContinueCallback](#js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | +| parameter | [ContinueDeviceInfo](js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | +| options | [ContinueCallback](js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | | callback | AsyncCallback<void> | 是 | 执行结果回调函数。 | **错误码:** @@ -426,8 +426,8 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback): Promi | 参数名 | 类型 | 必填 | 说明 | | --------- | --------------------------------------- | ---- | ----- | -| parameter | [ContinueDeviceInfo](#js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | -| options | [ContinueCallback](#js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | +| parameter | [ContinueDeviceInfo](js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | +| options | [ContinueCallback](js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md b/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md index 44a24be4f6bed086ce2a089b45b752f3b537035d..3f78f1ce07e9331ed1a7d2c8bfbb5930b1061071 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md @@ -6,7 +6,7 @@ > > 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > -> 该模块不支持在[UIAbility](./js-apis-app-ability-uiAbility.md)中使用。 +> 该模块不支持在[UIAbility](./js-apis-app-ability-uiAbility.md)中使用,需要在创建组件实例后使用。 ## 导入模块 diff --git a/zh-cn/application-dev/reference/apis/js-apis-privacyManager.md b/zh-cn/application-dev/reference/apis/js-apis-privacyManager.md index d7ff5598a78d4d713a33c6172c06f94d65a94d90..a4e435df6d81463fc6808af176ea1c59cfc0cccf 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-privacyManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-privacyManager.md @@ -87,7 +87,7 @@ addPermissionUsedRecord(tokenID: number, permissionName: Permissions, successCou | permissionName | Permissions | 是 | 应用权限名称。 | | successCount | number | 是 | 访问成功的次数。 | | failCount | number | 是 | 访问失败的次数。 | -| callback | AsyncCallback<void> | 是 | 回调函数。当添加使用记录成功时,err为undefine;否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当添加使用记录成功时,err为undefined;否则为错误对象。 | **错误码:** @@ -195,7 +195,7 @@ getPermissionUsedRecord(request: PermissionUsedRequest, callback: AsyncCallback& | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------- | ---- | ------------------------------------------ | | request | [PermissionUsedRequest](#permissionusedrequest) | 是 | 查询权限使用记录的请求。 | -| callback | AsyncCallback<[PermissionUsedResponse](#permissionusedresponse)> | 是 | 回调函数。当查询记录成功时,err为undefine,data为查询到的权限使用记录;否则为错误对象。 | +| callback | AsyncCallback<[PermissionUsedResponse](#permissionusedresponse)> | 是 | 回调函数。当查询记录成功时,err为undefined,data为查询到的权限使用记录;否则为错误对象。 | **错误码:** @@ -306,7 +306,7 @@ startUsingPermission(tokenID: number, permissionName: Permissions, callback: Asy | -------------- | --------------------- | ---- | ------------------------------------ | | tokenID | number | 是 | 调用方的应用身份标识。可通过应用的[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)获得。 | | permissionName | Permissions | 是 | 需要使用的权限名。 | -| callback | AsyncCallback<void> | 是 | 回调函数。当开始使用权限成功时,err为undefine;否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当开始使用权限成功时,err为undefined;否则为错误对象。 | **错误码:** @@ -409,7 +409,7 @@ stopUsingPermission(tokenID: number, permissionName: Permissions, callback: Asyn | -------------- | --------------------- | ---- | ------------------------------------ | | tokenID | number | 是 | 调用方的应用身份标识。可通过应用的[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)获得。 | | permissionName | Permissions | 是 | 需要使用的权限名。 | -| callback | AsyncCallback<void> | 是 | 回调函数。当停止使用权限成功时,err为undefine;否则为错误对象。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当停止使用权限成功时,err为undefined;否则为错误对象。 | **错误码:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-promptAction.md b/zh-cn/application-dev/reference/apis/js-apis-promptAction.md index 0163d488caf265565ac25d3684a7f2d95071469d..216fcf9485f5efa3bd4f3ccfa85321b38d13d1d9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-promptAction.md +++ b/zh-cn/application-dev/reference/apis/js-apis-promptAction.md @@ -6,7 +6,7 @@ > > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > -> 该模块不支持在[UIAbility](./js-apis-app-ability-uiAbility.md)中使用。 +> 该模块不支持在[UIAbility](./js-apis-app-ability-uiAbility.md)中使用,需要在创建组件实例后使用。 ## 导入模块 diff --git a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md index cd03af9c882b4f781010d36ba09a60e73b1b464c..d07683c9f13db381c9f1b70ba29b0c67424ab7b3 100644 --- a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md +++ b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md @@ -153,7 +153,6 @@ - [Matrix2D](ts-components-canvas-matrix2d.md) - [OffscreenCanvasRenderingContext2D对象](ts-offscreencanvasrenderingcontext2d.md) - [Path2D对象](ts-components-canvas-path2d.md) - - [Lottie](ts-components-canvas-lottie.md) - 动画 - [属性动画](ts-animatorproperty.md) - [显式动画](ts-explicit-animation.md) diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/DataPickerDialog.gif b/zh-cn/application-dev/reference/arkui-ts/figures/DataPickerDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..f16653bb3fb1c69d1ecbe2702a676d7200a1111f Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/DataPickerDialog.gif differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/TextPickerDialog.gif b/zh-cn/application-dev/reference/arkui-ts/figures/TextPickerDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..81dbc3fdfaf99298e7272654398db6b6b8af387a Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/TextPickerDialog.gif differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/TimePickerDialog.gif b/zh-cn/application-dev/reference/arkui-ts/figures/TimePickerDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..834e4ff3d13b357479c261b24e431e813c0eb616 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/TimePickerDialog.gif differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001194352468.gif b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001194352468.gif deleted file mode 100644 index 58feeb2988e8d9a643234691ae4d5cf5ccef6d4f..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001194352468.gif and /dev/null differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md index 32625499f5c27d7660d2fcababe1604f3266d86e..187475feb0509e570620ea2b38c2ec872e8ba78d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md @@ -410,7 +410,7 @@ | Start | 水平对齐首部。 | | Center | 水平居中对齐。 | | End | 水平对齐尾部。 | -| Justify10+ | 双端对齐。 | +| JUSTIFY10+ | 双端对齐。 | ## TextOverflow @@ -421,7 +421,7 @@ | None | 文本超长时裁剪显示。 | | Clip | 文本超长时进行裁剪显示。 | | Ellipsis | 文本超长时显示不下的文本用省略号代替。 | -| Marquee10+ | 文本超长时以跑马灯的方式展示。 | +| MARQUEE10+ | 文本超长时以跑马灯的方式展示。 | ## TextDecorationType @@ -505,25 +505,25 @@ | Thin | 轻薄材质模糊。 | | Regular | 普通厚度材质模糊。 | | Thick | 厚材质模糊。 | -| BackgroundThin | 近距景深模糊。 | -| BackgroundRegular | 中距景深模糊。 | -| BackgroundThick | 远距景深模糊。 | -| BackgroundUltraThick | 超远距景深模糊。 | +| BACKGROUND_THIN | 近距景深模糊。 | +| BACKGROUND_REGULAR | 中距景深模糊。 | +| BACKGROUND_THICK | 远距景深模糊。 | +| BACKGROUND_ULTRA_THICK | 超远距景深模糊。 | ## ThemeColorMode10+ | 名称 | 描述 | | ------ | ---------- | -| System | 跟随系统深浅色模式。 | -| Light | 固定使用浅色模式。 | -| Dark | 固定使用深色模式。 | +| SYSTEM | 跟随系统深浅色模式。 | +| LIGHT | 固定使用浅色模式。 | +| DARK | 固定使用深色模式。 | ## AdaptiveColor10+ | 名称 | 描述 | | ------- | ------------------------- | -| Default | 不使用取色模糊。使用默认的颜色作为蒙版颜色。 | -| Average | 使用取色模糊。将取色区域的颜色平均值作为蒙版颜色。 | +| DEFAULT | 不使用取色模糊。使用默认的颜色作为蒙版颜色。 | +| AVERAGE | 使用取色模糊。将取色区域的颜色平均值作为蒙版颜色。 | ## TextHeightAdaptivePolicy10+ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md deleted file mode 100644 index 4960a4ec7f300407af72a9d8a25eb00ab287100a..0000000000000000000000000000000000000000 --- a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md +++ /dev/null @@ -1,611 +0,0 @@ -# Lottie - -提供Lottie动画。 - -> **说明:** -> -> 从 API Version 8 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 - - - -## 导入模块 - -``` -import lottie from '@ohos/lottieETS' -``` - -> **说明:** -> -> 在第一次使用Lottie之前,需要在Terminal窗口运行 `ohpm install @ohos/lottieETS` 命令下载Lottie。 - - -## lottie.loadAnimation - -loadAnimation( - -path: string, container: object, render: string, loop: boolean, autoplay: boolean, name: string ): AnimationItem - -加载动画,须提前声明Animator('__lottie_ets')对象,并在Canvas完成布局后调用。可配合Canvas组件生命周期接口onReady()使用。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| -------------- | --------------------------- | ---- | ---------------------------------------- | -| path | string | 是 | HAP内动画资源文件路径,仅支持json格式。示例:path: "common/lottie/data.json" | -| container | object | 是 | canvas绘图上下文,声明范式需提前声明CanvasRenderingContext2D。 | -| render | string | 是 | 渲染类型,仅支持“canvas”。 | -| loop | boolean \| number | 否 | 动画播放结束后,是否循环播放,默认值true。值类型为number,且大于等于1时为设置的重复播放的次数。 | -| autoplay | boolean | 否 | 是否自动播放动画,默认值true。 | -| name | string | 否 | 开发者自定义的动画名称,后续支持通过该名称引用控制动画,默认为空。 | -| initialSegment | [number, number] | 否 | 指定动画播放的起始帧号,指定动画播放的结束帧号。 | - - -## lottie.destroy - -destroy(name: string): void - -销毁动画,页面退出时,必须调用。可配合Canvas组件生命周期接口使用,比如onDisappear()与onPageHide()。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | ---------------------------------------- | -| name | string | 是 | 被指定的动画名,同loadAnimation接口参数name, 缺省时销毁所有动画。 | - -**示例:** - ```ts - // xxx.ets - import lottie from '@ohos/lottieETS' - - @Entry - @Component - struct Index { - private controller: CanvasRenderingContext2D = new CanvasRenderingContext2D() - private animateName: string = "animate" - private animatePath: string = "common/lottie/data.json" - private animateItem: any = null - - onPageHide(): void { - console.log('onPageHide') - lottie.destroy() - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Canvas(this.controller) - .width('30%') - .height('20%') - .backgroundColor('#0D9FFB') - .onReady(() => { - console.log('canvas onAppear'); - this.animateItem = lottie.loadAnimation({ - container: this.controller, - renderer: 'canvas', - loop: true, - autoplay: true, - name: this.animateName, - path: this.animatePath, - }) - }) - - Animator('__lottie_ets') // declare Animator('__lottie_ets') when use lottie - Button('load animation') - .onClick(() => { - if (this.animateItem != null) { - this.animateItem.destroy() - this.animateItem = null - } - this.animateItem = lottie.loadAnimation({ - container: this.controller, - renderer: 'canvas', - loop: true, - autoplay: true, - name: this.animateName, - path: this.animatePath, - initialSegment: [10, 50], - }) - }) - - Button('destroy animation') - .onClick(() => { - lottie.destroy(this.animateName) - this.animateItem = null - }) - } - .width('100%') - .height('100%') - } - } - ``` - - ![zh-cn_image_0000001194352468](figures/zh-cn_image_0000001194352468.gif) - - -## lottie.play - -play(name: string): void - -播放指定动画。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | ---------------------------------------- | -| name | string | 是 | 被指定的动画名, 同loadAnimation接口参数name,缺省时播放所有动画。 | - -**示例:** - - ```ts - lottie.play(this.animateName) - ``` - - -## lottie.pause - -pause(name: string): void - -暂停指定动画,下次调用lottie.play()从当前帧开始。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | ---------------------------------------- | -| name | string | 是 | 被指定的动画名,同loadAnimation接口入参name,缺省时暂停所有动画。 | - -**示例:** - - ```ts - lottie.pause(this.animateName) - ``` - - -## lottie.togglePause - -togglePause(name: string): void - -暂停或播放指定动画,等效于lottie.play()与lottie.pause()切换调用。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | ---------------------------------------- | -| name | string | 是 | 被指定的动画名,同loadAnimation接口参数name,缺省时停止所有动画。 | - -**示例:** - - ```ts - lottie.togglePause(this.animateName) - ``` - - -## lottie.stop - -stop(name: string): void - -停止指定动画,下次调用lottie.play()从第一帧开始。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | ---------------------------------------- | -| name | string | 是 | 被指定的动画名,同loadAnimation接口参数name,缺省时停止所有动画。 | - -**示例:** - - ```ts - lottie.stop(this.animateName) - ``` - - -## lottie.setSpeed - -setSpeed(speed: number, name: string): void - -设置指定动画播放速度。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ----- | ------ | ---- | ---------------------------------------- | -| speed | number | 是 | 值为浮点类型, speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0/-1.0正常速度播放。 | -| name | string | 是 | 被指定的动画,同loadAnimation接口参数name,缺省时停止所有动画。 | - -**示例:** - - ```ts - lottie.setSpeed(5, this.animateName) - ``` - - -## lottie.setDirection - -setDirection(direction: AnimationDirection, name: string): void - -设置指定动画播放顺序。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| --------- | ------------------ | ---- | ---------------------------------------- | -| direction | AnimationDirection | 是 | 1为正向,-1为反向; 当设置为反向时,从当前播放进度开始回播直到首帧,loop值为true时可无限倒放;speed<0叠加时也是倒放。
AnimationDirection:1 \| -1 | -| name | string | 是 | 被指定的动画名,同loadAnimation接口参数name,缺省时设置所有动画方向。 | - -**示例:** - - ```ts - lottie.setDirection(-1, this.animateName) - ``` - - -## AnimationItem - -loadAnimation接口的返回对象,具有属性与接口。属性描述如下: - -| 参数名称 | 参数类型 | 参数描述 | -| ----------------- | ---------------------------------------- | ---------------------------------------- | -| name | string | 动画名称。 | -| isLoaded | boolean | 动画是否已加载。 | -| currentFrame | number | 当前播放的帧号, 默认精度为>=0.0的浮点数, 调用setSubframe(false)后精度为去小数点后的正整数。 | -| currentRawFrame | number | 当前播放帧数, 精度为>=0.0的浮点数。 | -| firstFrame | number | 当前播放片段的第一帧帧号。 | -| totalFrames | number | 当前播放片段的总帧数。 | -| frameRate | number | 帧率 (frame/s)。 | -| frameMult | number | 帧率 (frame/ms)。 | -| playSpeed | number | 值为浮点类型, speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0 \| -1.0正常速度播放。 | -| playDirection | number | 播放方向, 1为正放, -1为倒放。 | -| playCount | number | 动画完成播放的次数。 | -| isPaused | boolean | 当前动画是否已暂停, 值为true动画已暂停。 | -| autoplay | boolean | 加载动画后是否自动播放, 若值为false需要再调用play()接口开始播放。 | -| loop | boolean \| number | 类型为boolean时是否循环播放, 类型为number时播放次数。 | -| renderer | any | 动画渲染对象, 根据渲染类型而定。 | -| animationID | string | 动画ID。 | -| timeCompleted | number | 当前动画片段完成单次播放的帧数, 受AnimationSegment设置影响, 与totalFrames属性值相同。 | -| segmentPos | number | 当前动画片段序号, 值为>=0的正整数。 | -| isSubframeEnabled | boolean | 关联了currentFrame的精度是否为浮点数。 | -| segments | AnimationSegment \| AnimationSegment[] | 当前动画的播放片段。 | - - -## AnimationItem.play - -play(name?: string): void - -播放动画。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | --------------- | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - this.animateItem.play() - ``` - - -## AnimationItem.destroy - -destroy(name?: string): void - -销毁动画。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | --------------- | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - this.animateItem.destroy() - ``` - - -## AnimationItem.pause - -pause(name?: string): void - -暂停动画,下次调用play接口从当前帧开始播放。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | --------------- | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - this.animateItem.pause() - ``` - - -## AnimationItem.togglePause - -togglePause(name?: string): void - -暂停或播放动画,等效于play接口与pause接口之间轮换调用。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | --------------- | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - this.animateItem.togglePause() - ``` - - -## AnimationItem.stop - -stop(name?: string): void - -停止动画,下次调用play接口从第一帧开始播放。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | --------------- | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - this.animateItem.stop() - ``` - - -## AnimationItem.setSpeed - -setSpeed(speed: number): void - -设置动画播放速度。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ----- | ------ | ---- | ---------------------------------------- | -| speed | number | 是 | 值为浮点类型, speed>0正向播放, speed<0反向播放, speed=0暂停播放, speed=1.0 \| -1.0正常速度播放。 | - -**示例:** - - ```ts - this.animateItem.setSpeed(5); - ``` - - -## AnimationItem.setDirection - -setDirection(direction: AnimationDirection): void - -设置动画播放顺序。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| --------- | ------------------ | ---- | ---------------------------------------- | -| direction | AnimationDirection | 是 | 1为正向,-1为反向; 当设置为反向时,从当前播放进度开始回播直到首帧,loop值为true时可无限倒放;speed<0叠加时也是倒放。
AnimationDirection:1 \| -1。 | - -**示例:** - - ```ts - this.animateItem.setDirection(-1) - ``` - - -## AnimationItem.goToAndStop - -goToAndStop(value: number, isFrame?: boolean): void - -设置动画停止在指定帧或时间进度。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ------- | ------- | ---- | ---------------------------------------- | -| value | number | 是 | 帧号(值大于等于0)或时间进度(ms)。 | -| isFrame | boolean | 否 | true: 按指定帧控制,false:按指定时间控制,缺省默认false。 | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - // 按帧号控制 - this.animateItem.goToAndStop(25, true) - // 按时间进度控制 - this.animateItem.goToAndStop(300, false, this.animateName) - ``` - - -## AnimationItem.goToAndPlay - -goToAndPlay(value: number, isFrame: boolean, name?: string): void - -设置动画从指定帧或时间进度开始播放。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ------- | ------- | ---- | ---------------------------------------- | -| value | number | 是 | 帧号(值大于等于0)或时间进度(ms) | -| isFrame | boolean | 是 | true:按指定帧控制, false:按指定时间控制,缺省默认false。 | -| name | string | 否 | 被指定的动画名,缺省默认为空。 | - -**示例:** - - ```ts - // 按帧号控制 - this.animateItem.goToAndPlay(25, true) - // 按时间进度控制 - this.animateItem.goToAndPlay(300, false, this.animateName) - ``` - - -## AnimationItem.playSegments - -playSegments(segments: AnimationSegment | AnimationSegment[], forceFlag: boolean): void - -设置动画仅播放指定片段。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| --------- | ---------------------------------------- | ---- | ---------------------------------------- | -| segments | AnimationSegment = [number, number] \| AnimationSegment[] | 是 | 片段或片段列表;
如果片段列表全部播放完毕后,下轮循环播放仅播放最后一个片段 | -| forceFlag | boolean | 是 | true:即时生效播放,false:延迟到下轮循环播放再生效 | - -**示例:** - - ```ts - // 指定播放片段 - this.animateItem.playSegments([10, 20], false) - // 指定播放片段列表 - this.animateItem.playSegments([[0, 5], [20, 30]], true) - ``` - - -## AnimationItem.resetSegments - -resetSegments(forceFlag: boolean): void - -重置动画播放片段,播放全帧。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| --------- | ------- | ---- | ------------------------------ | -| forceFlag | boolean | 是 | true:即时生效播放,false:延迟到下轮循环播放再生效 | - -**示例:** - - ```ts - this.animateItem.resetSegments(true) - ``` - - -## AnimationItem.resize - -resize(): void - -刷新动画布局。 - -**示例:** - - ```ts - this.animateItem.resize() - ``` - - -## AnimationItem.setSubframe - -setSubframe(useSubFrame: boolean): void - -设置属性currentFrame的精度显示浮点数。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ------------ | ------- | ---- | ---------------------------------------- | -| useSubFrames | boolean | 是 | currentFrame属性默认显示浮点数,该接口参数将影响currentFrame属性的精度。
true:属性currentFrame显示浮点。
false:属性currentFrame去浮点数显示整数。 | - -**示例:** - - ```ts - this.animateItem.setSubframe(false) - ``` - - -## AnimationItem.getDuration - -getDuration(inFrames?: boolean): void - -获取动画单次完整播放的时间(与播放速度无关)或帧数, 与Lottie.loadAnimation接口入参initialSegment有关。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| -------- | ------- | ---- | ---------------------------------------- | -| inFrames | boolean | 否 | true:获取帧数, false:获取时间(单位ms),缺省默认false。 | - -**示例:** - - ```ts - this.animateItem.getDuration(true) - ``` - - -## AnimationItem.addEventListener - -addEventListener<T = any>(name: AnimationEventName, callback: AnimationEventCallback<T>): () => void - -添加侦听事件, 事件完成后会触发指定回调函数。返回可删除该侦听事件的函数对象。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| -------- | ------------------------------- | ---- | ---------------------------------------- | -| name | AnimationEventName | 是 | 指定动画事件类型,Lottie内置动画事件类型AnimationEventName:
'enterFrame'、'loopComplete'、'complete'、'segmentStart'、'destroy'、'config_ready'、'data_ready'、'DOMLoaded'、'error'、'data_failed'、'loaded_images' | -| callback | AnimationEventCallback<T> | 是 | 用户自定义回调函数 | - -**示例:** - - ```ts - private callbackItem: any = function() { - console.log("grunt loopComplete") - } - let delFunction = this.animateItem.addEventListener('loopComplete', this.animateName) - - // 删除侦听 - delFunction() - ``` - - -## AnimationItem.removeEventListener - -removeEventListener<T = any>(name: AnimationEventName, callback?: AnimationEventCallback<T>): void - -删除侦听事件。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| -------- | ------------------------------- | ---- | ---------------------------------------- | -| name | AnimationEventName | 是 | 指定动画事件类型,Lottie内置动画事件类型AnimationEventName:
'enterFrame'、'loopComplete'、'complete'、'segmentStart'、'destroy'、'config_ready'、'data_ready'、'DOMLoaded'、'error'、'data_failed'、'loaded_images' | -| callback | AnimationEventCallback<T> | 否 | 用户自定义回调函数;缺省为空时,删除此事件的所有回调函数。 | - -**示例:** - - ```ts - this.animateItem.removeEventListener('loopComplete', this.animateName) - ``` - - -## AnimationItem.triggerEvent - -triggerEvent<T = any>(name: AnimationEventName, args: T): void - -直接触发指定事件的所有已设置的回调函数。 - -**参数:** - -| 参数 | 类型 | 必填 | 描述 | -| ---- | ------------------ | ---- | --------- | -| name | AnimationEventName | 是 | 指定动画事件类型 | -| args | any | 是 | 用户自定义回调参数 | - -**示例:** - - ```ts - private triggerCallBack: any = function(item) { - console.log("trigger loopComplete, name:" + item.name) - } - - this.animateItem.addEventListener('loopComplete', this.triggerCallBack) - this.animateItem.triggerEvent('loopComplete', this.animateItem) - this.animateItem.removeEventListener('loopComplete', this.triggerCallBack) - ``` diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md index 129851a67c806ea1bd52c3574cedf07e5f72e171..1231f6a60dc197e0188325973422d73c11fc2018 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -53,8 +53,8 @@ Swiper(controller?: SwiperController) | 名称 | 描述 | | ----------- | ------------------------------------------ | -| Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。| -| AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。| +| Stretch(deprecated) | Swiper滑动一页的宽度为Swiper组件自身的宽度。
从API verdion 10开始不再维护,建议使用STRETCH代替。| +| AutoLinear(deprecated) | Swiper滑动一页的宽度为子组件宽度中的最大值。
从API verdion 10开始不再维护,建议使用AUTO_LINEAR代替。| ## SwiperController diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-datepicker-dialog.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-datepicker-dialog.md index d030996ca9f31318746d168ffeacd8578e78a2e4..8ca789e9fe32e96d252cc97a63afdbd0d44035ff 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-datepicker-dialog.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-datepicker-dialog.md @@ -86,3 +86,5 @@ struct DatePickerDialogExample { } } ``` + +![DataPickerDialog](figures/DataPickerDialog.gif) \ No newline at end of file diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-textpicker-dialog.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-textpicker-dialog.md index de3b2269c510f5752275bf79cfadce5e4d3e35cc..80fd20ab7be1278a0a798568d5c6594e0fb75fc4 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-textpicker-dialog.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-textpicker-dialog.md @@ -56,7 +56,7 @@ struct TextPickerDialogExample { selected: this.select, onAccept: (value: TextPickerResult) => { // 设置select为按下确定按钮时候的选中项index,这样当弹窗再次弹出时显示选中的是上一次确定的选项 - this.select[0] = value.index + this.select = value.index console.info("TextPickerDialog:onAccept()" + JSON.stringify(value)) }, onCancel: () => { @@ -72,3 +72,5 @@ struct TextPickerDialogExample { } } ``` + +![TextPickerDialog](figures/TextPickerDialog.gif) \ No newline at end of file diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md index 0d73440792d2293684f97dc406dbdd62bf44bab8..5c4fede524c07beaa9ca3d558ad1f58398a1a25e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md @@ -77,3 +77,5 @@ struct TimePickerDialogExample { } } ``` + +![TimetPickerDialog](figures/TimePickerDialog.gif) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-types.md b/zh-cn/application-dev/reference/arkui-ts/ts-types.md index 0145dee8b2c2e54395be64db0ff8e6c800fda524..160a51f896ad13bb8ee587084393c266d0101d5e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-types.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-types.md @@ -245,9 +245,9 @@ | 名称 | 描述 | | ------- | ------------ | -| None | 全屏模态无转场动画。 | -| Default | 全屏模态上下切换动画。 | -| Alpha | 全屏模态透明度渐变动画。 | +| NONE | 全屏模态无转场动画。 | +| DEFAULT | 全屏模态上下切换动画。 | +| ALPHA | 全屏模态透明度渐变动画。 | ## Dimension10+ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md index 9f0ed6aa050edc2188f3c0e6bb235e802dddeb9e..48bd785c9b686526445a0a42ad08730e91f78930 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md @@ -44,12 +44,12 @@ | 名称 | 描述 | | ------ | -------------------------------------- | -| OuterDefaultXS | 超小阴影。 | -| OuterDefaultSM | 小阴影。 | -| OuterDefaultMD | 中阴影。 | -| OuterDefaultLG | 大阴影。 | -| OuterFloatingSM | 浮动小阴影。 | -| OuterFloatingMD | 浮动中阴影。 | +| OUTER_DEFAULT_XS | 超小阴影。 | +| OUTER_DEFAULT_SM | 小阴影。 | +| OUTER_DEFAULT_MD | 中阴影。 | +| OUTER_DEFAULT_LG | 大阴影。 | +| OUTER_FLOATING_SM | 浮动小阴影。 | +| OUTER_FLOATING_MD | 浮动中阴影。 | ## 示例 diff --git a/zh-cn/application-dev/ui/arkts-drawing-customization-on-canvas.md b/zh-cn/application-dev/ui/arkts-drawing-customization-on-canvas.md index e80a0c2f438821d28758ceb675ad4553c990c939..8b5a4fec310fb92973f81d6fbaf19ec404b97f10 100644 --- a/zh-cn/application-dev/ui/arkts-drawing-customization-on-canvas.md +++ b/zh-cn/application-dev/ui/arkts-drawing-customization-on-canvas.md @@ -89,11 +89,7 @@ Canvas提供画布组件,用于自定义绘制图形,开发者使用CanvasRe import lottie from '@ohos/lottie' ``` - 具体接口参考[Lottie](../reference/arkui-ts/ts-components-canvas-lottie.md),具体实例请参考[Lottie动画](#相关实例)。 - - >**说明:** - > - >在第一次使用Lottie之前,需要在Terminal窗口运行ohpm install \@ohos/lottieETS命令下载Lottie。 + 具体接口请参考[Lottie](https://gitee.com/openharmony-tpc/lottieETS)。 ## 初始化画布组件 diff --git a/zh-cn/application-dev/website.md b/zh-cn/application-dev/website.md index 7a3b7c7da86a3f767de24b838b728fc44bac6a97..a6ef8f8762e43c0ccbc63b382d7dc263bc847aca 100644 --- a/zh-cn/application-dev/website.md +++ b/zh-cn/application-dev/website.md @@ -721,12 +721,8 @@ - [触摸热区设置](reference/arkui-ts/ts-universal-attributes-touch-target.md) - [多态样式](reference/arkui-ts/ts-universal-attributes-polymorphic-style.md) - [触摸测试控制](reference/arkui-ts/ts-universal-attributes-hit-test-behavior.md) - - [组件背景模糊](reference/arkui-ts/ts-universal-attributes-backgroundBlurStyle.md) - [分布式迁移标识](reference/arkui-ts/ts-universal-attributes-restoreId.md) - [前景色设置](reference/arkui-ts/ts-universal-attributes-foreground-color.md) - - [图像球面效果](reference/arkui-ts/ts-universal-attributes-sphericalEffect.md) - - [图像渐亮效果](reference/arkui-ts/ts-universal-attributes-lightUpEffect.md) - - [图像边缘像素扩展效果](reference/arkui-ts/ts-universal-attributes-pixelStretchEffect.md) - 模态转场设置 - [全屏模态转场](reference/arkui-ts/ts-universal-attributes-modal-transition.md) - [半模态转场](reference/arkui-ts/ts-universal-attributes-sheet-transition.md) @@ -837,7 +833,6 @@ - [Matrix2D](reference/arkui-ts/ts-components-canvas-matrix2d.md) - [OffscreenCanvasRenderingContext2D对象](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) - [Path2D对象](reference/arkui-ts/ts-components-canvas-path2d.md) - - [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md) - 动画 - [属性动画](reference/arkui-ts/ts-animatorproperty.md) - [显式动画](reference/arkui-ts/ts-explicit-animation.md) diff --git a/zh-cn/release-notes/OpenHarmony-v3.1-beta.md b/zh-cn/release-notes/OpenHarmony-v3.1-beta.md index b9c359af741f32e7d1997b10549a66058afe5be3..2d4fe6da6ad046caf3f71d087ab359dd15c9e0e0 100644 --- a/zh-cn/release-notes/OpenHarmony-v3.1-beta.md +++ b/zh-cn/release-notes/OpenHarmony-v3.1-beta.md @@ -183,12 +183,9 @@ _[Changelog](api-diff/v3.1-beta/changelog-v3.1-beta.md)_ | [分布式手写板(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/DistributeDatabaseDrawEts) | 基于分布式能力,实现多设备同步书写互动。 | ArkTS | | [分布式数据库](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData) | 基于分布式数据接口,实现多种设备上一致的数据访问体验。 | JS | | [关系型数据库](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData) | 基于关系型数据库和数据管理能力,实现数据库相关应用服务的快速开发。 | JS | -| [极简声明式UI范式(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts) | 基于OpenHarmony ArkUI,实现一个图库应用。 | ArkTS | -| [一次开发多端部署(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/Multi_device) | 基于OpenHarmony ArkUI,实现一次布局,多端部署。 | ArkTS | | [购物应用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/ShoppingEts) | 基于OpenHarmony ArkUI丰富的组件实现购物商城应用。 | ArkTS | | [转场动画的使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/TransitionAnimation) | 基于OpenHarmony ArkUI转场动画,实现了页面间转场、组件内转场以及共享元素转场。 | ArkTS | | [基础组件Slider的使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SliderExample) | 基于OpenHarmony eTS UI,使用slider组件,实现可调节风车大小和转速的动画效果。 | ArkTS | -| [流式布局(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/FlowLayoutEts) | 基于OpenHarmony ArkUI,实现流式布局效果。 | ArkTS | | [弹窗(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/CustomDialogEts) | 基于OpenHarmony ArkUI,实现警告弹窗和自定义弹窗。 | ArkTS | diff --git a/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md b/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md index e156dad5e3cdca1dd967da9fbed7127f27d05e71..cc61538199c922949cbdd55b7b9c723c97527357 100644 --- a/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md +++ b/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md @@ -139,7 +139,7 @@ ArkUI适配了根据资源名称获取资源的能力。 从本版本起,仅发布Public SDK,开发者可从镜像站点获取或通过DevEco Studio下载Public SDK用于应用开发。 -包含系统接口的全量SDK(Full SDK)需下载全量代码后编译构建出SDK文件,并在DevEco Studio中替换。通过源码编译Full SDK的指导请参见[Full-SDK编译指南](../application-dev/quick-start/full-sdk-compile-guide.md)。 +包含系统接口的全量SDK(Full SDK)需下载全量代码后编译构建出SDK文件,并在DevEco Studio中替换。通过源码编译Full SDK的指导请参见[Full-SDK编译指南](../application-dev/faqs/full-sdk-compile-guide.md)。 ### 特性变更 @@ -162,7 +162,7 @@ ArkUI适配了根据资源名称获取资源的能力。 | 文件存储 | - 新增应用文件统一URI处理能力。
- 新增支持公共数据的临时授权和统一的打开入口。
主要涉及以下需求:
I687C8【新增能力】支持应用文件统一URI处理能力
I64U8W【基础能力】支持公共数据的临时授权和统一open入口 | NA | | 元能力 | - 新增常驻进程重启优化。
- 支持卡片数据库切换。
- 支持异步onConnected等能力。
主要涉及以下需求:
I65M3F 【基础能力】执行ShellCommand命令管控
I65V83 【基础能力】ServiceExtensionAbility支持异步onConnected生命周期
I61H21 【基础能力】卡片本地数据库切换
I63UJ5 【元能力】【ability_runtime】API8及以前API 支持异常处理
I6BDCW 【基础能力】应用加载禁止加载data目录下的代码
I6BDDU 【基础能力】FA模型默认启动方式为Standard
I6BDE2 【基础能力】常驻应用异常频繁重启保护 | NA | -API变更清单请参考:[API差异报告](api-change/v3.2-beta5/Readme.md) +API变更清单请参考:[API差异报告](api-diff/v3.2-beta5/Readme-CN.md) 各子系统API详细变更说明请参考:[变更说明](changelogs/v3.2-beta5/Readme.md) diff --git a/zh-cn/release-notes/Readme.md b/zh-cn/release-notes/Readme.md index 2f06c2b0a9db5d2816df9bc6340aa0ce9219a363..66be6c562d6b8ce7d5ff7e1efc9dfc6f95845d39 100644 --- a/zh-cn/release-notes/Readme.md +++ b/zh-cn/release-notes/Readme.md @@ -2,7 +2,7 @@ ## OpenHarmony 4.x Releases -- [OpenHarmony v4.0 Release (2023-06-03)](OpenHarmony-v4.0-beta1.md) +- [OpenHarmony v4.0 Beta1 (2023-06-03)](OpenHarmony-v4.0-beta1.md) ## OpenHarmony 3.x Releases diff --git a/zh-cn/website.md b/zh-cn/website.md index 6ec0b9b1ce49c194675f59ec27e934ae5182e1a9..d99c26cb5c3305c95cebda7cf1e2171e3465e297 100644 --- a/zh-cn/website.md +++ b/zh-cn/website.md @@ -4,7 +4,7 @@ - [术语](glossary.md) - 版本说明 - OpenHarmony 4.x Releases - - [OpenHarmony v4.0 Release (2023-06-03)](release-notes/OpenHarmony-v4.0-beta1.md) + - [OpenHarmony v4.0 Beta1 (2023-06-03)](release-notes/OpenHarmony-v4.0-beta1.md) - OpenHarmony 3.x Releases - [OpenHarmony v3.2 Release (2023-04-09)](release-notes/OpenHarmony-v3.2-release.md) - [OpenHarmony v3.2.1 Release (2023-05-22)](release-notes/OpenHarmony-v3.2.1-release.md) @@ -357,3 +357,6 @@ - [写作规范](contribute/写作规范.md) - [社区沟通与交流](contribute/社区沟通与交流.md) - [FAQ](contribute/FAQ.md) + + + \ No newline at end of file