未验证 提交 395de097 编写于 作者: O openharmony_ci 提交者: Gitee

!19542 翻译完成:19157+19289 4.0beta1 RN+ API changes

Merge pull request !19542 from wusongqing/TR19157
# OpenHarmony 4.0 Beta1
## Version Description
The standard system capabilities of OpenHarmony 4.0 are continuously improved. ArkUI further improves component capabilities and effects. The application framework optimizes ExtensionAbilities. Application packages can be installed without decompression and shared across applications. The unified data management framework (UDMF) is provided for distributed data management. The audio, media playback, media control, and camera capabilities of the multimedia subsystem are further enhanced. Badge management is added to the common event and notification subsystem. More key management capabilities are provided for the security subsystem. ArkCompiler updates the tool versions related to the C++ toolchain. The capabilities of multiple tools in the test framework are enhanced.
OpenHarmony 4.0 Beta1 provides the first batch of API version 10 interfaces.
### Application Framework
- ExtensionAbilities adopt minimal management. APIs of the ExtensionAbilities are provided based on service scenarios to prevent calling of sensitive APIs.
- Temporary, URI-based authorization is provided for data or files. An application can grant the read and write permissions of its own files to other applications.
- UIExtensionAbilities are provided. The UI provided by a UIExtensionAbility can be embedded in the window of the invoker application for display. Currently, the following basic UIExtensionAbility capabilities have been built:
- Unified UIExtensionAbility template, with clear API definitions
- Display of the native default ExtensionAbility page, as well as UI customization
Templates such as Share and Picker will be gradually provided in later versions.
- Atomic services can be shared. You can use the **UIAbility.onShare()** lifecycle provided by the UIAbility component to set the data to share. Users can share atomic services and widgets to another device through the sharing box.
### ArkUI
Addition or enhancement of basic components:
- The ExtensionAbility component is provided so that you can embed the extended feature of an application into another application.
- The drawing components **\<Rect>**, **\<Circle>**, **\<Ellipse>**, **\<Line>**, **\<Polyline>**, **\<Polygon>**, **\<Path>**, **\<Rect>**, and **\<Shape>** support universal attributes such as translating, cropping, and masking.
- The mask color and animation can be customized for custom dialog boxes. For example, you can set parameters related to the animation effect.
- The **bindContextMenu** and **bindMenu** methods allow you to set menu positions.
- The divider set by the **\<ColumnSplit>** component can be dragged.
- The **\<Refresh>** component allows you to set the content to be displayed during pulling down to refresh.
- The width and height of the input string in the **\<Text>** component can be returned. If the string is not fully displayed, a dialog box showing the complete string is displayed when the mouse pointer is hovered over.
Addition or enhancement of the animation effect:
- Transition animation can be used for component attribute changes, for example, when the **\<Divider>** component is used to set the divider color and color attributes.
- You can set the spherical attributes, lower edge pixel stretching, adaptive color, G2 rounded corners, shadows, and gradient attributes for components to implement advanced animation effect.
Development efficiency improvement:
- You can hold the **\<Text>**, **\<Image>**, **\<Video>**, **\<ListItem>**, and **\<GridItem>** components and drag them to the desired position. You can also disable this feature so that no dragging will be triggered upon holding.
### Application Package Management
- Application packages can be installed without being decompressed, optimizing the system startup performance and application installation performance.
- Application packages can be shared across applications. System applications can provide their own capabilities to third-party applications. In addition, third-party applications do not need to integrate related content (including code, resources, and .so files) into their installation packages, reducing the integration and update costs.
- Enterprise applications can be installed. The installation permission of enterprise applications is verified to prevent unauthorized distribution and installation of enterprise applications. In addition, the enterprise application certificate information can be queried, facilitating the management and revocation of enterprise applications in the application market.
### Distributed Data Management
- System applications can silently access DataShareExtension data of other system applications through the data management service agent. That is, system applications can access DataShareExtension data of another system application without starting that application.
- System applications can access DataShareExtension data in single mode through the data management service agent.
- The DataShare client provides the capability of subscribing to DataShareExtension data changes by URI prefix. The DataShare client will be notified of any DataShareExtension data change under the subscribed URI prefix.
- The UDMF is added to support data standardization models, intra-device data dragging, UDMF data storage adaptation, permission management, and lifecycle management.
### File Management
- File category view management is supported. Gallery and other related applications manage media files in albums, indicating that images and videos do not need to pay attention to their storage locations. Functions such as adding and removing files in albums do not involve file I/O operations. Related APIs will be available in later versions.
- Enhanced file I/O access capabilities are provided, including **randomAccessFile**, **moveDir**, **copyDir**, and **watcher**.
- URI-based temporarily authorized file access and authorization revocation capabilities are supported, and cross-application local authorization or cross-device authorization are provided for files.
### Graphics & Window
**Graphics**
- Property animations with custom content are supported.
- Transition animation is provided when a component appears or disappears.
- The performance of the unified rendering mode is optimized, including IPC performance optimization (for example, transferring rendering resources in shared memory mode to reduce IPC traffic), component-level rendering optimization (only upper-layer components are rendered to reduce GPU rendering workload), and the use of hardware synthesizer.
- SVG decoding is supported for image encoding and decoding. Parameters, such as the total number of frames and time interval, are parsed for .gif files.
**Window**
- Listening for the focus status of a window is supported. In earlier versions, you can listen for the focus status of the window stage, but not that of system windows and application child windows. Now, you can register **'windowEvent'** to listen for the focused, out-of-focus, and hidden states of a window.
- The z-order of child windows can be adjusted to the top layer. In earlier versions, for multiple sub-windows created in an application, the system always displays the last window displayed at the top of all the other windows. In addition, a window that is last touched or clicked is displayed at the top by default. Now, by using the **aiseToAppTop** method of the window object, you can adjust any child window to the top of the child windows of the window stage.
- The immersive implementation mode is reconstructed to optimize the animation effect when an application is opened, exited, or redirected. In earlier versions, when an application is opened, the size of the full-screen application window does not contain the area of the status bar and navigation bar by default, unless the application calls **setWindowLayoutFullScreen** or **setSystemBarEnable** to enable immersive display. If an immersive application calls either APIs when it is being opened, the opening animation is displayed abnormally. In the new version, regardless of whether immersive display is enabled, the full-screen application window includes the status bar and navigation bar. The status bar and navigation bar of non-immersive applications are avoided by restricting the application display area through ArkUI.
- The **sourceMode** field is added to the **Screen** attribute so that the system application can determine whether the screen is used as the primary screen, mirror of the primary screen, or extended screen.
- The **stopMirror** and **stopExpand** APIs are added to the **Screen** module for you to stop screen mirroring or the extended mode.
### Multimedia
**Audio Capability**
- You can use native APIs to implement audio playback and recording.
- You can query and listen for the playback device with the highest priority.
- You can adjust the alarm volume independently.
- Audio focus is supported. When playing an audio, an application does not need to apply for the focus. Instead, the system automatically applies for the focus in the background and executes the focus policy (such as pause, fade-out, and fade-out recovery). The application only needs to register a listener to receive focus interruption events and update the status, for example, stopping the progress bar when the program is paused.
**Playback Control Framework**
- Custom media information can be transmitted between the media provider and controller. The application can extend the media content display mode. For example, the controller can require the provider to display songs and lyrics in a special form.
- The framework capability of the media playlist is supported. The provider provides the playlist content, and the controller obtains the playlist content and selects any media content to play.
- The framework capability of historical playback records is supported. The AVSession framework provides the list of historical playback applications, sorted by playback sequence (including the applications that are being played and the applications that have exited).
- A transmission channel is provided for custom media events, for example, a transmission channel for lyric content. Through this channel, the provider provides the lyric content, and the controller obtains the lyric content.
- A transmission channel is provided for custom control commands. Through this channel, the controller sends custom control commands to the provider, for example, to require the provider to display bullet comments.
**Media Playback**
- HLS-based live streaming and data source-based streaming playback are supported.
- HDI-based H.265 video hardware decoding and playback are supported.
- Audio playback attributes can be set. Users can select the output audio type when using the player.
- Automatic rotation is supported for videos with rotation angles.
**Camera**
- The error codes and exception handling mechanism of ArkTS APIs are optimized so that you can use error codes to locate error information.
- The front camera provides preview mirroring. By default, the preview image on the front camera is mirrored.
- You can query the main device attributes of a distributed camera, including the device name and type.
- More refined resolution query is supported. You can query the supported size, format, and frame rate by preview, photographing, and recording usage.
- The camera framework provides a horizontal coordinate system [0, 0, 1, 1]. All coordinate-related operations are performed based on this coordinate system.
- When different camera applications use the same physical camera, the camera framework use priority control and mutual exclusion policies.
### Common Event and Notification
- Applications can enable or disable static event subscription.
- System applications can remove sticky events that have been published.
- Applications can set badges that represent the number of notifications.
### Communication & Connectivity
- NFC eSE card emulation is supported.
- A random MAC address can be used for connection to an AP through Wi-Fi.
- A static IP address can be used for connection to an API through Wi-Fi.
### Security
- The following key management capabilities are provided:
- Deriving chip-level keys based on the GID
- Import of the Chinese cryptography key
- Fine-grained access control for secondary identity authentication
- NO HASH mode for key management signature
- Specifying key parameters during calculation
- The security levels of other devices can be queried on a small-system device.
- The RSA key signature digest and padding can be specified for signature and signature verification.
### Ability Access Control
- An application-specific permission management page can be opened.
- Identity verification is provided for system applications.
### ArkCompiler
- The task pool supports priority setting and automatic scaling algorithms.
- Hot reloading performance is optimized, and the multi-HAP scenario is supported.
- Multi-instance debugging is supported.
- CFG construction of abnormal functions is supported.
- The C++ compilation toolchain is updated as follows:
- The Clang/LLVM toolchain is upgraded to 15.0.4.
- The libc version is upgraded to 1.2.3. The interface performance of the libc library is optimized.
- The sigaction function provides the sigchain function.
### Kernel
- The HCK framework is supported.
- Hierarchical configuration is provided for the Linux kernel.
### Driver
- The display hardware synthesis driver is decoupled from the chip platform, VDIs are provided, and an independent hardware synthesis process is used.
- The display driver process provides the dead event listener to improve system fault recovery.
- Detection of hot swap events and obtaining of camera modules are provided for USB cameras.
- The preview drive capability is provided for USB cameras.
- APIs are provided for querying audio effect capabilities, obtaining audio effect descriptors, and creating and destroying audio effect instances.
- The capabilities of control flows and data flows are enhanced for sensors and motions.
### Power Supply
- The capability of querying and reporting the system power level is enhanced. The power level can be customized.
- Wired and wireless charging types, including standard charging, fast charging, and super fast charging, can be reported.
- The management mechanism of the running lock is enhanced, and the system power status and level are specified.
- You can set the wakeup source, which can be the power button, mouse, keyboard, touchpad, screen, stylus, or leather case.
- You can set the sleep source, which can be the power button, leather case, or auto-sleep upon timeout.
- Development guides are provided for the management of power, battery, display brightness, power consumption statistics, and thermal.
### Pan-Sensor
- You can query the preset vibration effects supported by a device and check whether a vibration effect (specified by **EffectID**) is supported by the device.
- An API is provided for stopping the vibrator in any mode, so that you do not need to find the vibration mode in use in order to stop the vibrator.
### Test Framework
**Test Framework arkXtest**
- The definition capability is provided in the automatic script test suite for more flexible script design.
- The object-level assertion capability is provided for test scripts.
- The simulation of Chinese input, mouse operations, and area screenshots is provided.
**Self-Test Execution Framework developer_test**
- Test task management is improved. Now you can execute historical tasks by task ID.
- The precise test capability is provided. Now you can filter and execute test cases at the subsystem, component, test suite, and test case levels.
- You can execute HATS test cases.
**Stability Test Tool wukong**
Rotation event injection is supported.
**Performance Development Tool smartperf_host**
- Frame timeline capture and display capabilities are provided for you to capture and display frame freezing and frame loss data.
- Scheduling analysis capture and display capabilities are provided for you to capture and display data related to CPU scheduling analysis and thread scheduling analysis.
- Call stack visualization is used to display the symbolic results of .so files compiled. The proportions of functions in different libraries are displayed in pie charts.
## Version Mapping
**Table 1** Version mapping of software and tools
| Software/Tool| Version| Remarks|
| -------- | -------- | -------- |
| OpenHarmony | 4.0 Beta1| NA |
| Public SDK | Ohos_sdk_public 4.0.7.5 (API Version 10 Beta1)| This toolkit is intended for application developers and does not contain system APIs that require system permissions. It is provided as standard in DevEco Studio.|
| (Optional) HUAWEI DevEco Studio| 4.0 Beta1| Recommended for developing OpenHarmony applications *To be released*|
| (Optional) HUAWEI DevEco Device Tool| 3.1 Release| Recommended for developing OpenHarmony smart devices|
## Source Code Acquisition
### Prerequisites
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. Run the following commands to install the **repo** tool:
```
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the permission, download the tool to another directory and configure it as an environment variable by running the chmod a+x /usr/local/bin/repo command.
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### Acquiring Source Code Using the repo Tool
**Method 1 (recommended)**
Use the **repo** tool to download the source code over SSH. (You must have an SSH public key for access to Gitee.)
- Obtain the source code from the version branch. You can obtain the latest source code of the version branch, which includes the code that has been incorporated into the branch up until the time you run the following commands:
```
repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-4.0-Beta1 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- Obtain the source code from the version tag, which is the same as that released with the version.
```
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v4.0-Beta1 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
**Method 2**
Use the **repo** tool to download the source code over HTTPS.
- Obtain the source code from the version branch. You can obtain the latest source code of the version branch, which includes the code that has been incorporated into the branch up until the time you run the following commands:
```
repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-4.0-Beta1 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- Obtain the source code from the version tag, which is the same as that released with the version.
```
repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v4.0-Beta1 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
### Acquiring Source Code from Mirrors
**Table 2** Mirrors for acquiring source code
| Source Code | Version| Mirror | SHA-256 Checksum | Software Package Size|
| --------------------------------------- | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- |
| Full code base (for mini, small, and standard systems) | 4.0 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/code-v4.0-Beta1.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/code-v4.0-Beta1.tar.gz.sha256) | 26.2 GB |
| Hi3861 solution (binary) | 4.0 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/hispark_pegasus.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/hispark_pegasus.tar.gz.sha256) | 25.1 MB |
| Hi3516 solution-LiteOS (binary)| 4.0 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/hispark_taurus_LiteOS.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/hispark_taurus_LiteOS.tar.gz.sha256) | 287.6 MB |
| Hi3516 solution-Linux (binary) | 4.0 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/hispark_taurus_Linux.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/hispark_taurus_Linux.tar.gz.sha256) | 186.4 MB |
| RK3568 standard system solution (binary) | 4.0 Beta1 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/dayu200_standard_arm32.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/dayu200_standard_arm32.tar.gz.sha256) | 4.5 GB |
| Public SDK package for the standard system (macOS) | 4.0.7.5 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/ohos-sdk-mac-public-20230605.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/ohos-sdk-mac-public-20230605.tar.gz.sha256) | 718.2 MB |
| Public SDK package for the standard system (macOS-M1) | 4.0.7.5 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/L2-SDK-MAC-M1-PUBLIC-20230605.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/L2-SDK-MAC-M1-PUBLIC-20230605.tar.gz.sha256) | 673.2 MB |
| Public SDK package for the standard system (Windows\Linux) | 4.0.7.5 | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/ohos-sdk-windows_linux-public-20230605.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/4.0-Beta1/ohos-sdk-windows_linux-public-20230605.tar.gz.sha256) | 1.8 GB |
## What's New
This version has the following updates to OpenHarmony 3.2 Release.
### APIs
For details about the API changes over OpenHarmony 3.2 Release, see [API Differences](/api-diff/v4.0-beta1/Readme-EN.md). A few API changes may affect applications developed using API version 9 or earlier. For details about the change impact and adaptation guide, see [Changelogs](changelogs/v4.0-beta1/Readme-EN.md).
### Feature Updates
[Version Description](#version-description)
### Chip and Development Board Adaptation
For details about the adaptation status, see [SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig_devboard/sig_devboard.md).
### Samples
**Table 3** New samples
| Subsystem| Name| Introduction| Programming Language|
| -------- | -------- | -------- | -------- |
| Multimedia| [AVSession - Controller](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-v4.0-Beta1/code/BasicFeature/Media/AVSession/MediaController) (for system applications only)| This sample shows the features of MediaController. It uses \@ohos.multimedia.avsession to implement custom information exchange between the provider and controller.| ArkTS |
| Multimedia| [AVSession - Provider](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-v4.0-Beta1/code/BasicFeature/Media/AVSession/MediaProvider)| This sample shows the features of MediaProvider. It uses \@ohos.multimedia.avsession to implement custom information exchange between the provider and controller.| ArkTS |
| Multimedia| [Audio Management](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-v4.0-Beta1/code/BasicFeature/Media/Audio)| This sample demonstrates audio-related features. It uses \@ohos.multimedia.audio to switch and query the audio device and implement audio interruption.| ArkTS |
| DFX | Application Recovery | This sample shows how to adapt fault recovery-related APIs in an application.| ArkTS |
For more information, visit [Samples](https://gitee.com/openharmony/applications_app_samples).
## Resolved Issues
**Table 4** Resolved issues
| Issue No.| Description|
| -------- | -------- |
| I70PRZ | The avoid area for non-immersive UI is invalid.|
| I72F9P | There is a high probability that the IPC_2_29472 thread in the ohos.samples.distributedcalc process causes a C++ crash in libwindow_native_kit.z.so.|
| I6W7ZX | Non-immersive windows penetrate the home screen.|
| I76QTN | There is a high probability that the IPC_0_18272 thread in the ohos.samples.distributedmusicplayer process causes a C++ crash in libruntime.z.so.|
| I71TCX | When a call is made without a SIM card, the call is not automatically disconnected after the CallUI is started.|
| I77PZK | There is a high probability that the RSRenderThread thread in the com.ohos.systemui process causes a C++ crash in libmali-bifrost-g52-g2p0-ohos.so.|
| I73CUZ | Competition exists in prepare_to_wait_event, leading to UAF.|
| I770WV | Preview images cannot be backed up.|
| I6ZDHJ | If **undefined** is passed in for an optional parameter of a globalization API, the default value is not used.|
| I71KZA | If **null** is passed in for an optional parameter of a globalization API, the default value is not used.|
| I6YT0U | There is a high probability that the libeventhandler.z.so stack encounters app freezing in the com.ohos.launcher process.|
| I6YSE5 | There is a high probability that the com.ohos.photos thread in the com.ohos.photos process causes a C++ crash in librender_service_base.z.so.|
| I77AUK | Calling **connectAbility** fails in distributed scheduling scenarios.|
| I78J10 | The home screen does not respond when a large folder is dragged repeatedly.|
| I7975U | When a user opens an image in a gallery application and returns to the previous page, a blank page is displayed.|
## Known Issues
**Table 5** Known issues
| Issue No.| Description| Impact| To Be Resolved By|
| -------- | -------- | -------- | -------- |
| I78CH7 | Memory leakage occurs in libace.z.so when applications are repeatedly added to or removed from the dock bar.| Each time a widget is moved to a valid area, 99 KB memory of the ArkUI module leaks. This operation scenario is uncommon, and the leak issue disappears after the application is restarted. The impact is controllable.| 2023-07-15|
| I78CBC | Memory leakage occurs in libace.z.so when a user touches an image folder in Gallery to browse images in grid form and then exits repeatedly.| Each time the user touches an image folder in Gallery to browse images in grid form and then exits, 19 KB memory of the ArkUI module leaks. When the user touches Back on the application, the leak issue disappears. The impact is controllable.| 2023-07-15|
| I78C9W | Memory leakage occurs in libace.z.so when a user touches an image in Gallery to maximize it and then exits repeatedly.| Each time the user touches an image in Gallery to maximize it and then exits, 10 KB memory of the ArkUI module leaks. When the user touches Back on the application, the leak issue disappears. The impact is controllable.| 2023-07-15|
| I6U4ZT | The first photo in Gallery cannot be opened when the power supply is disconnected immediately after the photo is taken.| This problem occurs only in the immediate power-off scenario. A new set of mediaLibrary APIs needs to be adapted. The impact is controllable.| 2023-06-30|
| I79752 | There is a medium probability that the .ohos.smartperf thread of the com.ohos.smartperf process causes a C++ crash in libark_jsruntime.so.| This issue neither occurs in core applications nor affects ARP indicators. The impact is controllable.| 2023-06-30|
| I79P3K | There is a low probability that the onDestroy stack encounters a JS crash in the com.ohos.callui process.| The application will be reinstalled after the JS crash. This issue does not affect the use of the Call application.| 2023-06-30|
| I79TCB | There is a low probability that the VizCompositorTh thread of the com.ohos.note process causes a C++ crash in libweb_engine.soTh.| The application will be reinstalled after the JS crash. This issue does not affect the use of the Note application.| 2023-06-30|
# OpenHarmony Release Notes
## OpenHarmony 4.x Releases
- [OpenHarmony v4.0 Beta1 (2023-06-03)](OpenHarmony-v4.0-beta1.md)
## OpenHarmony 3.x Releases
- [OpenHarmony v3.2 Release (2023-04-09)](OpenHarmony-v3.2-release.md)
- [OpenHarmony v3.2.1 Release (2023-05-22)](OpenHarmony-v3.2.1-release.md)
- [OpenHarmony v3.2.1 Release (2023-05-22)](OpenHarmony-v3.2.1-release.md)
- [OpenHarmony v3.2 Beta5 (2023-01-31)](OpenHarmony-v3.2-beta5.md)
- [OpenHarmony v3.2 Beta4 (2022-11-30)](OpenHarmony-v3.2-beta4.md)
- [OpenHarmony v3.2 Beta3 (2022-09-30)](OpenHarmony-v3.2-beta3.md)
- [OpenHarmony v3.2 Beta2 (2022-07-30)](OpenHarmony-v3.2-beta2.md)
- [OpenHarmony v3.2 Beta1 (2022-05-31)](OpenHarmony-v3.2-beta1.md)
- [OpenHarmony v3.1 Release (2022-03-30)](OpenHarmony-v3.1-release.md)
- [OpenHarmony v3.1.7 Release (2023-04-04)](OpenHarmony-v3.1.7-release.md)
- [OpenHarmony v3.1.6 Release (2023-02-06)](OpenHarmony-v3.1.6-release.md)
- [OpenHarmony v3.1.5 Release (2023-01-10)](OpenHarmony-v3.1.5-release.md)
- [OpenHarmony v3.1.4 Release (2022-11-02)](OpenHarmony-v3.1.4-release.md)
- [OpenHarmony v3.1.3 Release (2022-09-30)](OpenHarmony-v3.1.3-release.md)
- [OpenHarmony v3.1.2 Release (2022-08-24)](OpenHarmony-v3.1.2-release.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1.7 Release (2023-04-04)](OpenHarmony-v3.1.7-release.md)
- [OpenHarmony v3.1.6 Release (2023-02-06)](OpenHarmony-v3.1.6-release.md)
- [OpenHarmony v3.1.5 Release (2023-01-10)](OpenHarmony-v3.1.5-release.md)
- [OpenHarmony v3.1.4 Release (2022-11-02)](OpenHarmony-v3.1.4-release.md)
- [OpenHarmony v3.1.3 Release (2022-09-30)](OpenHarmony-v3.1.3-release.md)
- [OpenHarmony v3.1.2 Release (2022-08-24)](OpenHarmony-v3.1.2-release.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1 Beta (2021-12-31)](OpenHarmony-v3.1-beta.md)
- [OpenHarmony v3.0 LTS (2021-09-30)](OpenHarmony-v3.0-LTS.md)
- [OpenHarmony v3.0.8 LTS (2022-03-03)](OpenHarmony-v3.0.8-LTS.md)
- [OpenHarmony v3.0.7 LTS (2022-12-05)](OpenHarmony-v3.0.7-LTS.md)
- [OpenHarmony v3.0.6 LTS (2022-09-15)](OpenHarmony-v3.0.6-LTS.md)
- [OpenHarmony v3.0.5 LTS (2022-07-01)](OpenHarmony-v3.0.5-LTS.md)
- [OpenHarmony v3.0.3 LTS (2022-04-08)](OpenHarmony-v3.0.3-LTS.md)
- [OpenHarmony v3.0.2 LTS (2022-03-18)](OpenHarmony-v3.0.2-LTS.md)
- [OpenHarmony v3.0.1 LTS (2022-01-12)](OpenHarmony-v3.0.1-LTS.md)
- [OpenHarmony v3.0.8 LTS (2022-03-03)](OpenHarmony-v3.0.8-LTS.md)
- [OpenHarmony v3.0.7 LTS (2022-12-05)](OpenHarmony-v3.0.7-LTS.md)
- [OpenHarmony v3.0.6 LTS (2022-09-15)](OpenHarmony-v3.0.6-LTS.md)
- [OpenHarmony v3.0.5 LTS (2022-07-01)](OpenHarmony-v3.0.5-LTS.md)
- [OpenHarmony v3.0.3 LTS (2022-04-08)](OpenHarmony-v3.0.3-LTS.md)
- [OpenHarmony v3.0.2 LTS (2022-03-18)](OpenHarmony-v3.0.2-LTS.md)
- [OpenHarmony v3.0.1 LTS (2022-01-12)](OpenHarmony-v3.0.1-LTS.md)
## OpenHarmony 2.x Releases
......
# Readme
| Subsystem | Change Type | Change Description |
| :------------- | ------------ | ------------------------------------------------------------ |
| Common | Verification enhanced | [Permission verification enhanced for system APIs. Now only system applications are allowed to use system APIs. If third-party applications use a system API, error 202 is returned.](changelogs-common.md)|
| Ability framework | Behavior changed | [In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.](changelogs-ability.md)|
| Multi-language runtime subsystem| Parsing rule changed| [LLVM parsing format changed. When your code depends on the **version-script** or **-gcc-toolchain** option, parsing may fail if you continue to use the original LLVM 12 configuration file or options.](changelogs-arkcompiler.md)|
| Multi-language runtime subsystem| Verification enhanced | [New alarms are added and existing alarms are enhanced along with the upgrade from LLVM 12 to LLVM 15](changelogs-arkcompiler.md)|
| Multi-language runtime subsystem| Verification enhanced | [LLVM emu-tls is changed. If you use both LLVM 12 and LLVM 15, the emu-tls symbol cannot be found in libc++.so.](changelogs-arkcompiler.md)|
| Multi-language runtime subsystem| Verification enhanced | [New features and internal interface changes in the official release of LLVM 15 are inherited.](changelogs-arkcompiler.md)|
| Bundle management subsystem | Mechanism changed | [The HAP is no longer decompressed during HAP installation.](changelogs-bundlemanager.md)|
| Resource scheduler subsystem | Behavior changed | [The reminder agent allows you to customize buttons for system applications. Clicking a custom button will redirect you to the specified application page.](changelogs-resourceschedule.md)|
# Ability Framework 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** <sup>9+</sup>
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.
# Multi-language Runtime Subsystem Changelog
## cl.arkcompiler.1 New Alarms and Existing Alarm Enhancements for LLVM
**Change Impact**
By default, the **-Werror** option is disabled for the OpenHarmony NDK. If you have enabled the **-Werror** option, you are advised to correct the code based on the suggestions in the check result or mask the errors.
**Changes in Key Compilation Check Rules**
| New Check Item| Description| Suggestion|
| --- | --- | --- |
| Wunused-but-set-variable | An alarm is generated when the code contains unused variables (including the ++ operator).| Add the **maybe_unused** attribute when defining variables or use macros to distinguish variables.|
| Wdeprecated-non-prototype | An alarm is generated when a function without a prototype exists in the code.| Add a function prototype and specify the parameters.|
| Wunqualified-std-cast-call | An alarm is generated when **std::move** is incorrectly used in code.| Specify the use case of **std::move** and check the code.|
| Wdeprecated-builtins | An alarm is generated when a deprecated built-in function is used in the code.| Use the substitute function.|
| Warray-parameter | An alarm is generated when a function parameter contains an array that uses inconsistent forms.| Ensure the consistency of the function parameter.|
| Wbitwise-instead-of-logical | An alarm is generated when bitwise OR is used in Boolean operations.| Use logical OR in Boolean operations.|
| Wint-conversion | An alarm is generated when an int variable is converted to a pointer in the code.| Use a new implementation mode in the code.|
| Wdeprecated-declarations | An alarm is generated when a deprecated definition (including functions and variables) is used in code.| Use a new implementation mode in the code.|
| Wnull-pointer-subtraction | An alarm is generated when a null pointer is used in the subtraction operation.| Do not a null pointer in the subtraction operation.|
| Wunused-but-set-parameter | An alarm is generated when a function contains unused parameters.| Delete unused parameters.|
| Warray-bounds | An alarm is generated when out-of-bounds access to an array occurs in the code.| Modify the out-of-bounds access.|
| Wdeprecated-pragma | An alarm is generated when a deprecated macro is used in the code.| Delete the deprecated macro.|
| Wreserved-identifier | An alarm is generated when a variable starting with __ is used in the code.| Check the code to prevent variables starting with underscores (_) from being used externally.|
**Adaptation Guide**
1. For issues in the code that are not detected by LLVM 12, check and update the code.
2. Some old implementations are discarded during LLVM update. Adapt to the new rules and update the code.
3. If you believe a certain type of error can be masked, use the **-Wno-xxx** option to mask the error.
Defective code example
```
void Heap::Resume(TriggerGCType gcType)
{
if (mode_ != HeapMode::SPAWN &&
activeSemiSpace_->AdjustCapacity(inactiveSemiSpace_->GetAllocatedSizeSinceGC())) {
// If activeSpace capacity changes, oldSpace maximumCapacity should change too.
size_t multiple = 2;
// oldSpaceMaxLimit is assigned a value but is not used.
size_t oldSpaceMaxLimit = 0;
if (activeSemiSpace_->GetInitialCapacity() >= inactiveSemiSpace_->GetInitialCapacity()) {
size_t delta = activeSemiSpace_->GetInitialCapacity() - inactiveSemiSpace_->GetInitialCapacity();
oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() - delta * multiple;
} else {
size_t delta = inactiveSemiSpace_->GetInitialCapacity() - activeSemiSpace_->GetInitialCapacity();
oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() + delta * multiple;
}
inactiveSemiSpace_->SetInitialCapacity(activeSemiSpace_->GetInitialCapacity());
}
// irrelated code ...
}
```
The oldSpaceMaxLimit variable is not used, and the compiler reports an alarm.
```
../../arkcompiler/ets_runtime/ecmascript/mem/heap.cpp:247:16: error: variable 'oldSpaceMaxLimit' set but not used [-Werror,-Wunused-but-set-variable]
size_t oldSpaceMaxLimit = 0;
```
The error is rectified after the attribute is added.
```
void Heap::Resume(TriggerGCType gcType)
{
if (mode_ != HeapMode::SPAWN &&
activeSemiSpace_->AdjustCapacity(inactiveSemiSpace_->GetAllocatedSizeSinceGC())) {
// If activeSpace capacity changes, oldSpace maximumCapacity should change too.
size_t multiple = 2;
// Add the maybe_unused attribute and declare that the variable oldSpaceMaxLimit may not be used.
[[maybe_unused]] size_t oldSpaceMaxLimit = 0;
if (activeSemiSpace_->GetInitialCapacity() >= inactiveSemiSpace_->GetInitialCapacity()) {
size_t delta = activeSemiSpace_->GetInitialCapacity() - inactiveSemiSpace_->GetInitialCapacity();
oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() - delta * multiple;
} else {
size_t delta = inactiveSemiSpace_->GetInitialCapacity() - activeSemiSpace_->GetInitialCapacity();
oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() + delta * multiple;
}
inactiveSemiSpace_->SetInitialCapacity(activeSemiSpace_->GetInitialCapacity());
}
// irrelated code ...
}
```
## cl.arkcompiler.2 LLVM Parsing Format Changed
**Change Impact**
When your code depends on the **version-script** or **-gcc-toolchain** option, parsing may fail if you continue to use the original LLVM 12 configuration file or options.
**Changes in Key Compilation Rules**
1. The symbol representation is changed. In the new version, consecutive greater signs (>) are represented as ">>", which was represented as "> >" in the old version.
2. The -xx options are deprecated. For example, the **-gcc-toolchain** option is replaced by the **--gcc-toolchain** option. (This option has been marked as deprecated in versions later than Clang 3.4 and is officially deprecated in LLVM15.)
**Adaptation Guide**
If two consecutive greater signs (>) exist in the code (without considering the number of spaces in the middle), they will be parsed as "> >" in the older version and ">>" in the new version in version-script (due to mangling differences). In LLVM15, ">>" must be used.
Original configuration file
```
{
global:
extern "C++" {
"google::protobuf::TextFormat::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Message*)";
// In LLVM 12, "> >" can be parsed, but ">>" cannot.
"google::protobuf::TextFormat::PrintToString(google::protobuf::Message const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)";
};
local:
*;
}
```
Modified configuration file
```
{
global:
extern "C++" {
"google::protobuf::TextFormat::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, google::protobuf::Message*)";
// In LLVM 15, ">>" can be parsed.
"google::protobuf::TextFormat::PrintToString(google::protobuf::Message const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)";
};
local:
*;
}
```
## cl.arkcompiler.3 LLVM emu-tls Changed
**Change Impact**
If you use both LLVM 12 and LLVM 15 (this behavior is prohibited) for your code, the emu-tls symbol cannot be found in libc++.so.
**Key Library Dependency Changes**
In LLVM 15, the emu-tls symbol is extracted from the target binary file to libc++.so. That is, the __emutls_get_address attribute changes from an internal symbol to an externally visible symbol, which is included in libc++.so. As a result, the compiled dynamic library may depend on libc++.so.
**Adaptation Guide**
This symbol is also in libclang_rt.builtin.a. If you do not want the compiled dynamic library to depend on libc++.so, statically link the libclang_rt.builtin.a library.
## cl.arkcompiler.4 LLVM Official Release Notes
**Change Impact**
New features are added and internal interfaces are changed (such as IR in LLVM and compiler front-end modification). For details, see the official release notes.
**Key Documents**
https://releases.llvm.org/13.0.0/docs/ReleaseNotes.html
https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html
https://releases.llvm.org/15.0.0/docs/ReleaseNotes.html
**Adaptation Guide**
For details about the updates and adaptation guide, see the official documents.
# 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)
\ No newline at end of file
# Common Capability Changelog
## cl.common.1 System API Usage Rule Changed
When a system API is called, no verification is performed to check whether the caller is a system application or third-party application. As a result, a third-party application can switch to the full SDK to use system APIs, which brings security risks. To address this issue, application identity verification is added to OpenHarmony 4.0.2.1 and later versions.
**Change Impact**
System APIs are available only to 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.
**Adaptation Guide**
To use a system API, a third-party application must either request the system application permission or use a substitute API that is available for non-system applications.
# Resource Scheduler Subsystem Changelog
## cl.resourceschedule.reminderAgent.1
The reminder agent allows you to customize buttons for system applications. Clicking a custom button will redirect you to the specified application page.
**Change Impact**
For system applications developed based on OpenHarmony 4.0.7.1 and later SDK versions, you can set custom buttons for reminders.
**Key API/Component Changes**
| Module| Class| Method/Attribute/Enum/Constant| Change Type|
| -- | -- | -- | -- |
| reminderAgentManager | ActionButtonType | ACTION_BUTTON_TYPE_CUSTOM = 2 | Added|
| reminderAgentManager | ActionButton | wantAgent?: WantAgent | Added|
| reminderAgentManager | WantAgent | uri?: string | Added|
| reminderAgentManager | ReminderRequest | actionButton?: [ActionButton?, ActionButton?, ActionButton?] | Changed|
**Adaptation Guide**
```ts
import reminderAgentManager from '@ohos.reminderAgentManager';
let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = {
reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // The reminder type is alarm clock.
...
actionButton: [
{
title: 'Remind later',
type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE
},
{
title: 'Close',
type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE
},
{
title: 'Custom',
type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CUSTOM,
wantAgent: {
pkgName: "com.example.myapplication",
abilityName: "EntryAbility",
}
},
]
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册