1e41f4b71Sopenharmony_ci# Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## Bundle Management Framework 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciThe privilege control capability is added for preset applications. The capability can be divided into two parts: permission control for preset applications and configuration of preset applications. 6e41f4b71Sopenharmony_ciApplication privileges are high-level capabilities of an application, for example, restricting an application from being uninstalled or restricting application data from being deleted. 7e41f4b71Sopenharmony_ciOpenHarmony provides both general and device-specific application privileges. The latter can be configured by device vendors for applications on different devices. OpenHarmony supports differentiated configuration of preset applications on different devices. In addition, OpenHarmony provides **GetCfgDirList** for your application to obtain the preset directories, such as **system**, **chipset**, **sys_prod**, and **chip_prod**, in ascending order of priority. For example, the priority of **chip_prod** is higher than that of **system**. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci### Changed Installation Mode for Preset Applications 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciIn earlier versions, preset applications are installed by automatically scanning and installing HAP files in the **/system/app** directory. From this version, preset applications are configured based on the trustlist. Specifically, only the HAP file configured with **app-dir** in the **install_list.json** file can be automatically installed as a preset application. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci**Change Impacts** 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciJS and native APIs are not involved, and application development is not affected. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Key API/Component Changes** 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciN/A 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Adaptation Guide** 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciConfigure related fields in the [/system/etc/app/install_list.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list.json) file. The **app_dir** field specifies the directory where the HAP file is located, and **removable** specifies whether the HAP file can be uninstalled after being installed. 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciExample: 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci```json 28e41f4b71Sopenharmony_ci{ 29e41f4b71Sopenharmony_ci "install_list" : [ 30e41f4b71Sopenharmony_ci { 31e41f4b71Sopenharmony_ci "app_dir" : "/system/app/com.ohos.systemui", 32e41f4b71Sopenharmony_ci "removable" : false 33e41f4b71Sopenharmony_ci }, 34e41f4b71Sopenharmony_ci { 35e41f4b71Sopenharmony_ci "app_dir" : "/system/app/demo.hap", 36e41f4b71Sopenharmony_ci "removable" : true 37e41f4b71Sopenharmony_ci } 38e41f4b71Sopenharmony_ci ] 39e41f4b71Sopenharmony_ci} 40e41f4b71Sopenharmony_ci``` 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci### Changes in General Application Privilege Control 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ciFor a specific application, the general application privileges remain unchanged on all types of devices. The general application privileges are as follows: 45e41f4b71Sopenharmony_ci| Permission| Description | 46e41f4b71Sopenharmony_ci| ---------------- | ------------------------------------------------------------ | 47e41f4b71Sopenharmony_ci| AllowAppDataNotCleared | Allows application data to be deleted.| 48e41f4b71Sopenharmony_ci| AllowAppMultiProcess | Allows the application to run on multiple processes.| 49e41f4b71Sopenharmony_ci| AllowAppDesktopIconHide | Allows the application icon to be hidden from the home screen.| 50e41f4b71Sopenharmony_ci| AllowAbilityPriorityQueried | Allows an ability to configure and query the priority. | 51e41f4b71Sopenharmony_ci| AllowAbilityExcludeFromMissions | Allows an ability to be hidden in the mission stack.| 52e41f4b71Sopenharmony_ci| AllowAppUsePrivilegeExtension | Allows the application to use ServiceExtensionAbilities and DataExtensionAbilities.| 53e41f4b71Sopenharmony_ci| AllowFormVisibleNotify | Allows a widget to be visible on the home screen.| 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ciIn earlier versions, these privileges are configured in the **config.json** or **module.json** file and distinguished based on the application type (preset or system application). From this version, the privileges are configured based on the signing certificate and preset trustlist. 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci**Change Impacts** 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ciJS and native APIs are not involved. If your application needs to use any of these privileges, apply for it. For details about how to apply for and configure the privileges, see [Application Privilege Configuration](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md). 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ci**Key API/Component Changes** 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ciN/A 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ci**Adaptation Guide** 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ciSee [Application Privilege Configuration](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md). 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ci```json 70e41f4b71Sopenharmony_ci{ 71e41f4b71Sopenharmony_ci "version-name": "1.0.0", 72e41f4b71Sopenharmony_ci ... 73e41f4b71Sopenharmony_ci "bundle-info": { 74e41f4b71Sopenharmony_ci "developer-id": "OpenHarmony", 75e41f4b71Sopenharmony_ci ... 76e41f4b71Sopenharmony_ci }, 77e41f4b71Sopenharmony_ci "issuer": "pki_internal", 78e41f4b71Sopenharmony_ci "app-privilege-capabilities": ["AllowAppDataNotCleared", "AllowAppDesktopIconHide"] // The application data cannot be deleted, and the icon can be hidden on the home screen. 79e41f4b71Sopenharmony_ci} 80e41f4b71Sopenharmony_ci``` 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci### Changes in Device-specific Application Privilege Control 83e41f4b71Sopenharmony_ciIn addition to general application privileges, device vendors can define device-specific privileges for an application, as described in the table below. 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci| Permission | Type | Default Value| Description | 86e41f4b71Sopenharmony_ci| --------------------- | -------- | ------ | ------------------------------------------------- | 87e41f4b71Sopenharmony_ci| removable | bool | true | Allows the application to be uninstalled. This permission takes effect only for preset applications. | 88e41f4b71Sopenharmony_ci| keepAlive | bool | false | Allows the application to remain resident in the background. | 89e41f4b71Sopenharmony_ci| singleton | bool | false | Allows the application to be installed for a single user (User 0). | 90e41f4b71Sopenharmony_ci| allowCommonEvent | string[] | - | Allows the application to be started by a static broadcast. | 91e41f4b71Sopenharmony_ci| associatedWakeUp | bool | false | Allows the application in the FA model to be woken up by an associated application. | 92e41f4b71Sopenharmony_ci| runningResourcesApply | bool | false | Allows the application to request running resources, such as CPU, event notifications, and Bluetooth.| 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_ciIn earlier versions, these privileges are configured in the **config.json** or **module.json** file and distinguished based on the application type (preset or system application). From this version, the privileges can be configured based on the preset trustlist. For details, see [install_list_capability.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_capability.json). 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ci**Change Impacts** 97e41f4b71Sopenharmony_ci 98e41f4b71Sopenharmony_ciJS and native APIs are not involved. If your application needs to use any of these privileges, apply for it. For details, see [Configuration Mode](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-1). 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci**Key API/Component Changes** 101e41f4b71Sopenharmony_ci 102e41f4b71Sopenharmony_ciN/A 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_ci**Adaptation Guide** 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_ciSee [Configuration Mode](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-1). 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci```json 109e41f4b71Sopenharmony_ci{ 110e41f4b71Sopenharmony_ci "install_list": [ 111e41f4b71Sopenharmony_ci { 112e41f4b71Sopenharmony_ci "bundleName": "com.example.kikakeyboard", 113e41f4b71Sopenharmony_ci "singleton": true, // The application is installed for a single user. 114e41f4b71Sopenharmony_ci "keepAlive": true, // The application remains resident in the background. 115e41f4b71Sopenharmony_ci "runningResourcesApply": true, // The application can apply for running resources such as CPU, event notifications, and Bluetooth. 116e41f4b71Sopenharmony_ci "associatedWakeUp": true, // The application in the FA model can be woken up by an associated application. 117e41f4b71Sopenharmony_ci "app_signature": ["8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC"], // The setting takes effect only when the configured certificate fingerprint is the same as the HAP certificate fingerprint. 118e41f4b71Sopenharmony_ci "allowCommonEvent": ["usual.event.SCREEN_ON", "usual.event.THERMAL_LEVEL_CHANGED"] 119e41f4b71Sopenharmony_ci } 120e41f4b71Sopenharmony_ci} 121e41f4b71Sopenharmony_ci``` 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ci### Fingerprint Verification for Pre-authorization Trustlist 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ciThe pre-authorization file [install_list_permissions.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json) is moved from **system/etc/permission** to **system/etc/app/** on the development board. The **app_signature** field is added to specify the fingerprint of the HAP file. Multiple fingerprints can be configured. Authorization can be performed only when the fingerprint is matched. 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci**Change Impacts** 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ciJS and native APIs are not involved. If your application uses pre-authorization, add the fingerprint to the pre-authorization file. 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ci**Key API/Component Changes** 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ciN/A 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci**Adaptation Guide** 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ciRefer to the following code: 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci```json 140e41f4b71Sopenharmony_ci{ 141e41f4b71Sopenharmony_ci[ 142e41f4b71Sopenharmony_ci { 143e41f4b71Sopenharmony_ci "bundleName" : "com.ohos.screenshot", 144e41f4b71Sopenharmony_ci "app_signature" : ["8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"], 145e41f4b71Sopenharmony_ci "permissions" : [ 146e41f4b71Sopenharmony_ci { 147e41f4b71Sopenharmony_ci "name" : "ohos.permission.MEDIA_LOCATION", 148e41f4b71Sopenharmony_ci "userCancellable" : true 149e41f4b71Sopenharmony_ci }, 150e41f4b71Sopenharmony_ci { 151e41f4b71Sopenharmony_ci "name" : "ohos.permission.READ_MEDIA", 152e41f4b71Sopenharmony_ci "userCancellable" : true 153e41f4b71Sopenharmony_ci }, 154e41f4b71Sopenharmony_ci { 155e41f4b71Sopenharmony_ci "name" : "ohos.permission.WRITE_MEDIA", 156e41f4b71Sopenharmony_ci "userCancellable" : true 157e41f4b71Sopenharmony_ci } 158e41f4b71Sopenharmony_ci ] 159e41f4b71Sopenharmony_ci } 160e41f4b71Sopenharmony_ci} 161e41f4b71Sopenharmony_ci``` 162e41f4b71Sopenharmony_ci 163e41f4b71Sopenharmony_ci## ArkUI Development Framework 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci### Rectified Variable Sharing Issue of the Common Module in Release HAP Mode During Building in the FA Model 166e41f4b71Sopenharmony_ci 167e41f4b71Sopenharmony_ciAssume that two pages depend on the same object (foodData) of a file. If page A modifies the object, page B obtains the new value when reading the object. This implements object sharing for the common module. 168e41f4b71Sopenharmony_ci 169e41f4b71Sopenharmony_ci**Change Impacts** 170e41f4b71Sopenharmony_ci 171e41f4b71Sopenharmony_ciApplication compilation is not affected, and no interface adaptation is required. 172e41f4b71Sopenharmony_ci 173e41f4b71Sopenharmony_ci**Key API/Component Changes** 174e41f4b71Sopenharmony_ci 175e41f4b71Sopenharmony_ciN/A 176e41f4b71Sopenharmony_ci 177e41f4b71Sopenharmony_ci### Restrictions on Declaring Multiple Data Types of State Variables 178e41f4b71Sopenharmony_ci 179e41f4b71Sopenharmony_ciIf a **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variable supports multiple data types, they must be all simple data types or references at one time. 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ciExample: 182e41f4b71Sopenharmony_ci 183e41f4b71Sopenharmony_ci```ts 184e41f4b71Sopenharmony_ci@Entry 185e41f4b71Sopenharmony_ci@Component 186e41f4b71Sopenharmony_cistruct Index { 187e41f4b71Sopenharmony_ci // Incorrect: @State message: string | Resource = 'Hello World' 188e41f4b71Sopenharmony_ci @State message: string = 'Hello World' 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ci build() { 191e41f4b71Sopenharmony_ci Row() { 192e41f4b71Sopenharmony_ci Column() { 193e41f4b71Sopenharmony_ci Text(`${ this.message }`) 194e41f4b71Sopenharmony_ci .fontSize(50) 195e41f4b71Sopenharmony_ci .fontWeight(FontWeight.Bold) 196e41f4b71Sopenharmony_ci } 197e41f4b71Sopenharmony_ci .width('100%') 198e41f4b71Sopenharmony_ci } 199e41f4b71Sopenharmony_ci .height('100%') 200e41f4b71Sopenharmony_ci } 201e41f4b71Sopenharmony_ci} 202e41f4b71Sopenharmony_ci``` 203e41f4b71Sopenharmony_ci 204e41f4b71Sopenharmony_ci**Change Impacts** 205e41f4b71Sopenharmony_ci 206e41f4b71Sopenharmony_ciWhen the defined state variable type contains both the simple data types and references, an error is reported during compilation. 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci**Key API/Component Changes** 209e41f4b71Sopenharmony_ci 210e41f4b71Sopenharmony_ciIf the defined state variable type contains both the simple data types and references, change the type to one of them, as shown in the preceding sample code. 211e41f4b71Sopenharmony_ci 212e41f4b71Sopenharmony_ci## Globalization Subsystem 213e41f4b71Sopenharmony_ci 214e41f4b71Sopenharmony_ci### Added Validity Verification for Color Values in Color.json 215e41f4b71Sopenharmony_ci 216e41f4b71Sopenharmony_ciValidity verification is added for color values in the **color.json** file. The verification rules are as follows: 217e41f4b71Sopenharmony_ci 218e41f4b71Sopenharmony_ci- The hexadecimal color code is used in any of the following formats: 219e41f4b71Sopenharmony_ci - #rgb: red(0-f) green(0-f) blue(0-f) 220e41f4b71Sopenharmony_ci - #argb: transparency(0-f) red(0-f) green(0-f) blue(0-f) 221e41f4b71Sopenharmony_ci - #rrggbb: red(00-ff) green(00-ff) blue(00-ff) 222e41f4b71Sopenharmony_ci - #aarrggbb: transparency(00-ff) red(00-ff) green(00-ff) blue(00-ff) 223e41f4b71Sopenharmony_ci- The dollar sign ($) is used to reference resources defined in the application. The format is as follows: 224e41f4b71Sopenharmony_ci - $color:xxx 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ci**Change Impacts** 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ciIf the verification rules are not met, an error is reported during compilation. 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ci**Key API/Component Changes** 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ciN/A 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci## Power Management Subsystem 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_ci### File Name Changed 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ciThe name of the API declaration file is changed from **@ohos.batteryinfo.d.ts** to **@ohos.batteryInfo.d.ts**. 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ci**Change Impacts** 241e41f4b71Sopenharmony_ci 242e41f4b71Sopenharmony_ciWhen you reference the statement in a JS or TS file, use **import batteryInfo from '@ohos.batteryInfo';** instead of **import batteryInfo from '@ohos.batteryinfo'**. 243e41f4b71Sopenharmony_ci 244e41f4b71Sopenharmony_ci**Key API/Component Changes** 245e41f4b71Sopenharmony_ci 246e41f4b71Sopenharmony_ciN/A 247e41f4b71Sopenharmony_ci 248e41f4b71Sopenharmony_ci### File Name Changed 249e41f4b71Sopenharmony_ci 250e41f4b71Sopenharmony_ciThe name of the API declaration file is changed from **@ohos.runninglock.d.ts** to **@ohos.runningLock.d.ts**. 251e41f4b71Sopenharmony_ci 252e41f4b71Sopenharmony_ci**Change Impacts** 253e41f4b71Sopenharmony_ci 254e41f4b71Sopenharmony_ciWhen you reference the statement in a JS or TS file, use **import runningLock from '@ohos.runningLock';** instead of **import runningLock from '@ohos.runninglock';**. 255e41f4b71Sopenharmony_ci 256e41f4b71Sopenharmony_ci**Key API/Component Changes** 257e41f4b71Sopenharmony_ci 258e41f4b71Sopenharmony_ciN/A 259