1# Bundle Manager Subsystem ChangeLog 2 3## cl.bundlemanager.1 Bundle Manager API Changes 4The 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. 5 6**Change Impacts** 7 8The 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. 9 10**Key API/Component Changes** 11 12The 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. 13 14For 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. 15 16| Original API (Deprecated) | New API (Added) | 17| ------------------------------------ | ------------------------------------------------------------ | 18| @ohos.bundle.d.ts | [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) | 19| @ohos.bundle.d.ts | [@ohos.bundle.freeInstall.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.freeInstall.d.ts) | 20| @ohos.bundle.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) | 21| @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) | 22| @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) | 23| @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) | 24| @ohos.distributedBundle.d.ts | [@ohos.bundle.distributedBundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.distributedBundleManager.d.ts) | 25| N/A | [@ohos.bundle.appControl.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.appControl.d.ts) | 26| @system.package.d.ts | N/A | 27 28**Adaptation Guide** 291. Call the bundle manager query API. 30``` 31import bundle form '@ohos.bundle.bundleManager' 32``` 332. Call the bundle manager installation and uninstallation API. 34``` 35import installer form '@ohos.bundle.installer' 36``` 373. Call the bundle manager installation-free API. 38``` 39import freeInstall form '@ohos.bundle.freeInstall' 40``` 414. Call the bundle manager launcher APIs. 42``` 43import launcherBundleManager form '@ohos.bundle.launcherBundleManager' 44import bundleMonitor form '@ohos.bundle.bundleMonitor' 45``` 466. Call the bundle manager API for the default application. 47``` 48import defaultAppManager form '@ohos.bundle.defaultAppManager' 49``` 507. Call the distributed bundle manager API. 51``` 52import distributedBundle form '@ohos.bundle.distributedBundle' 53``` 54In addition, exception handling is needed. For details, see the API reference for the new APIs. 55 56## cl.bundlemanager.1 Bundle Manager API Structure Changes 57The 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. 58 59**Change Impacts** 60 61The 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. 62 63**Key API/Component Changes** 64 65The 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. 66| Original Structure (Deprecated) | New Structure (Added) | 67| -------------------------------- | ------------------------------------------------------------ | 68| bundle/abilityInfo.d.ts | [bundleManager/AbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) | 69| bundle/applicationInfo.d.ts | [bundleManager/ApplicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) | 70| bundle/bundleInfo.d.ts | [bundleManager/BundleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundleInfo.d.ts) | 71| bundle/bundleInstaller.d.ts | [@ohos.bundle.installer.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.installer.d.ts) | 72| bundle/bundleStatusCallback.d.ts | [@ohos.bundle.bundleMonitor.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleMonitor.d.ts) | 73| bundle/customizeData.d.ts | [bundleManager/Metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/Metadata.d.ts) | 74| bundle/dispatchInfo.d.ts | [bundleManager/DispatchInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/DispatchInfo.d.ts) | 75| bundle/elementName.d.ts | [bundleManager/ElementName.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ElementName.d.ts) | 76| bundle/extensionAbilityInfo.d.ts | [bundleManager/ExtensionAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) | 77| bundle/hapModuleInfo.d.ts | [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) | 78| bundle/launcherAbilityInfo.d.ts | [bundleManager/LauncherAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/LauncherAbilityInfo.d.ts) | 79| bundle/metadata.d.ts | [bundleManager/Metadata.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/Metadata.d.ts) | 80| bundle/moduleInfo.d.ts | [bundleManager/HapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) | 81| bundle/PermissionDef.d.ts | [bundleManager/PermissionDef.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/PermissionDef.d.ts) | 82| bundle/remoteAbilityInfo.d.ts | [bundleManager/RemoteAbilityInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/RemoteAbilityInfo.d.ts) | 83| bundle/shortcutInfo.d.ts | [bundleManager/ShortcutInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ShortcutInfo.d.ts) | 84 85**Adaptation Guide** 861. Replace the code of original structures with the code of new ones. 872. 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. 88 89## cl.bundlemanager.3 Bundle Manager Query API Changes 90 91Bundle 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. 92 93API 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. 94 95The 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**. 96 97**Change Impacts** 98 99There 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. 100 101**Key API/Component Changes** 102 103The 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. 104 105| Original API (Deprecated) | New API (Changed or Added) | System API| New File Name | 106| ---------------------------- | ---------------------------- | --------- | ------------------------------- | 107| BundleFlag | BundleFlag | No | @ohos.bundle.bundleManager.d.ts | 108| N/A | ApplicationFlag | Yes | @ohos.bundle.bundleManager.d.ts | 109| N/A | AbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts | 110| ExtensionFlag | ExtensionAbilityFlag | Yes | @ohos.bundle.bundleManager.d.ts | 111| ColorMode | N/A | No | N/A | 112| GrantStatus | PermissionGrantState | No | @ohos.bundle.bundleManager.d.ts | 113| AbilityType | AbilityType | No | @ohos.bundle.bundleManager.d.ts | 114| AbilitySubType | N/A | No | N/A | 115| DisplayOrientation | DisplayOrientation | No | @ohos.bundle.bundleManager.d.ts | 116| LaunchMode | LaunchType | No | @ohos.bundle.bundleManager.d.ts | 117| ExtensionAbilityType | ExtensionAbilityType | Yes | @ohos.bundle.bundleManager.d.ts | 118| BundleOptions | N/A | No | N/A | 119| InstallErrorCode | N/A | No | N/A | 120| UpgradeFlag | UpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts | 121| SupportWindowMode | SupportWindowMode | No | @ohos.bundle.bundleManager.d.ts | 122| getBundleInfo | getBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts | 123| getBundleInstaller | getBundleInstaller | Yes | @ohos.bundle.installer.d.ts | 124| getAbilityInfo | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | 125| getApplicationInfo | getApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts | 126| queryAbilityByWant | queryAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | 127| getAllBundleInfo | getAllBundleInfo | Yes | @ohos.bundle.bundleManager.d.ts | 128| getAllApplicationInfo | getAllApplicationInfo | Yes | @ohos.bundle.bundleManager.d.ts | 129| getNameForUid | getBundleNameByUid | Yes | @ohos.bundle.bundleManager.d.ts | 130| getBundleArchiveInfo | getBundleArchiveInfo | Yes | @ohos.bundle.bundleManager.d.ts | 131| getLaunchWantForBundle | getLaunchWantForBundle | Yes | @ohos.bundle.bundleManager.d.ts | 132| cleanBundleCacheFiles | cleanBundleCacheFiles | Yes | @ohos.bundle.bundleManager.d.ts | 133| setApplicationEnabled | setApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts | 134| setAbilityEnabled | setAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts | 135| queryExtensionAbilityInfos | queryExtensionAbilityInfo | Yes | @ohos.bundle.bundleManager.d.ts | 136| getPermissionDef | getPermissionDef | Yes | @ohos.bundle.bundleManager.d.ts | 137| getAbilityLabel | getAbilityLabel | Yes | @ohos.bundle.bundleManager.d.ts | 138| getAbilityIcon | getAbilityIcon | Yes | @ohos.bundle.bundleManager.d.ts | 139| isAbilityEnabled | isAbilityEnabled | Yes | @ohos.bundle.bundleManager.d.ts | 140| isApplicationEnabled | isApplicationEnabled | Yes | @ohos.bundle.bundleManager.d.ts | 141| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | @ohos.bundle.freeInstall.d.ts | 142| isModuleRemovable | isHapModuleRemovable | Yes | @ohos.bundle.freeInstall.d.ts | 143| getBundlePackInfo | getBundlePackInfo | Yes | @ohos.bundle.freeInstall.d.ts | 144| getDispatcherVersion | getDispatchInfo | Yes | @ohos.bundle.freeInstall.d.ts | 145| getProfileByAbility | getProfileByAbility | No | @ohos.bundle.bundleManager.d.ts | 146| getProfileByExtensionAbility | getProfileByExtensionAbility | No | @ohos.bundle.bundleManager.d.ts | 147| setDisposedStatus | setDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | 148| getDisposedStatus | getDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | 149| N/A | deleteDisposedStatus | Yes | @ohos.bundle.appControl.d.ts | 150| getBundleInfoSync | getBundleInfoSync | Yes | @ohos.bundle.bundleManager.d.ts | 151| getApplicationInfoSync | getApplicationInfoSync | Yes | @ohos.bundle.bundleManager.d.ts | 152| N/A | getBundleInfoForSelf | No | @ohos.bundle.bundleManager.d.ts | 153 154**Adaptation Guide** 155 156Replace the original APIs with new ones of version 9 and import related modules. 157 158Old import module: 159``` 160import bundle form '@ohos.bundle' 161``` 162New import module: 163``` 164import bundle form '@ohos.bundle.bundleManager' 165import freeInstall form '@ohos.bundle.freeInstall' 166import installer form '@ohos.bundle.installer' 167import appControl form '@ohos.bundle.appControl' 168``` 169 170## cl.bundlemanager.4 BundleInfo Structure Changes 171 172All **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. 173 174**Change Impacts** 175 176There 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. 177 178**Key API/Component Changes** 179 180The 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. 181 182| Deprecated | Added or Changed in API Version 9 | Type | 183| --------------------- | --------------------- | ------------------------------------------ | 184| type | N/A | string | 185| appId | N/A | string | 186| N/A | signatureInfo | SignatureInfo | 187| uid | N/A | number | 188| abilityInfos | N/A | Array\<AbilityInfo> | 189| reqPermissions | N/A | Array<string> | 190| compatibleVersion | N/A | number | 191| isCompressNativeLibs | N/A | boolean | 192| entryModuleName | N/A | string | 193| cpuAbi | N/A | string | 194| isSilentInstallation | N/A | string | 195| entryInstallationFree | N/A | boolean | 196| reqPermissionStates | permissionGrantStates | Array\<bundleManager.PermissionGrantState> | 197| extensionAbilityInfo | N/A | Array\<ExtensionAbilityInfo> | 198| hapModuleInfos | hapModulesInfo | Array\<HapModuleInfo> | 199 200The **SignatureInfo** structure is added to API version 9 as follows. 201 202| Field | Type | 203| ----------- | ------ | 204| appId | string | 205| fingerprint | string | 206 207**Adaptation Guide** 208 209Use 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. 210 211``` 212import bundle form '@ohos.bundle.bundleManager' 213``` 214 215## cl.bundlemanager.5 ApplicationInfo Structure Changes 216The **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. 217 218**Change Impacts** 219 220There 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. 221 222**Key API/Component Changes** 223 224The 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. 225 226| Deprecated | Added or Changed in API Version 9| Type | 227| ---------------- | -------------- | ---------------------------------- | 228| systemApp | N/A | boolean | 229| labelId | N/A | string | 230| labelIndex | labelId | number | 231| iconId | N/A | string | 232| iconIndex | iconId | number | 233| supportedModes | N/A | number | 234| moduleSourceDirs | N/A | Array\<string> | 235| moduleInfos | N/A | Array\<ModuleInfo> | 236| metaData | N/A | Map\<string,Array\<CustomizeData>> | 237| entityType | N/A | string | 238| fingerprint | N/A | string | 239 240**Adaptation Guide** 241 242Use the **ApplicationInfo** structure of API version 9 for modules imported for bundle manager query. 243 244 245## cl.bundlemanager.6 HapModuleInfo Structure Changes 246 247The **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. 248 249**Change Impacts** 250 251There 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. 252 253**Key API/Component Changes** 254 255The 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. 256 257| Deprecated | Added or Changed in API Version 9 | Type | 258| -------------------- | ---------------------- | ---------------------------- | 259| abilityInfo | abilitiesInfo | Array<AbilityInfo> | 260| N/A | moduleSourceDir | string | 261| backgroundImg | N/A | string | 262| supportedModes | N/A | string | 263| reqCapabilities | N/A | Array\<string> | 264| moduleName | N/A | string | 265| mainAbilityName | N/A | string | 266| extensionAbilityInfo | extensionAbilitiesInfo | Array\<ExtensionAbilityInfo> | 267 268**Adaptation Guide** 269 270Use the **HapModuleInfo** structure of API version 9 for modules imported for bundle manager query. 271 272## cl.bundlemanager.7 ModuleInfo Structure Changes 273 274The 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. 275 276The **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). 277 278**Change Impacts** 279 280There 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**. 281 282**Key API/Component Changes** 283 284The **ModuleInfo** structure is deprecated and replaced by **HapModuleInfo**. 285 286**Adaptation Guide** 287 288Use the **HapModuleInfo** structure of API version 9. 289 290## cl.bundlemanager.8 AbilityInfo Structure Changes 291 292The **AbilityInfo** structure is changed. The original **bundle/abilityInfo.d.ts** file is deprecated and changed to **bundleManager/AbilityInfo.d.ts**, involving field type changes. 293 294**Change Impacts** 295 296There 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. 297 298**Key API/Component Changes** 299 300The 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. 301 302| Deprecated | Added or Changed in API Version 9 | Type | 303| ------------------ | ------------------ | --------------------- | 304| launchMode | launchType | number | 305| supportWindowMode | supportWindowModes | Array\<number> | 306| targetAbility | N/A | string | 307| backgroundModes | N/A | number | 308| formEnabled | N/A | boolean | 309| subType | N/A | AbilitySubType | 310| deviceCapabilities | N/A | Array\<string> | 311| metaData | N/A | Array\<CustomizeData> | 312| maxWindowRatio | N/A | number | 313| minWindowRatio | N/A | number | 314| maxWindowWidth | N/A | number | 315| minWindowWidth | N/A | number | 316| maxWindowHeight | N/A | number | 317| minWindowHeight | N/A | number | 318| N/A | windowSize | WindowSize | 319 320The fields of the new structure **WindowSize** of API version 9 are as follows. 321 322| Field | Type | 323| :-------------: | :----: | 324| maxWindowRatio | number | 325| minWindowRatio | number | 326| maxWindowWidth | number | 327| minWindowWidth | number | 328| maxWindowHeight | number | 329| minWindowHeight | number | 330 331**Adaptation Guide** 332 333Use the **AbilityInfo** structure of API version 9. 334 335## cl.bundlemanager.9 BundleFlag Changes 336 337**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. 338 339**Change Impacts** 340 341**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. 342 343**Key API/Component Changes** 344 345**BundleFlag** in the original **@ohos.bundle** is deprecated and replaced by **BundleFlag**, **ApplicationFlag**, and **AbilityFlag** in the new **@ohos.bundle.bundleManager**. 346 347The following table describes **BundleFlag** of API version 9. 348 349| BundleFlag | Value | Description | 350| ----------------------------------------- | ---------- | ------------------------------------------------------------ | 351| GET_BUNDLE_INFO_DEFAULT | 0x00000000 | Obtains the default **BundleInfo**. The obtained **BundleInfo** does not contain **signatureInfo**, **hapModuleInfo**, **appInfo**, **reqPermissionDetails**, or **permissionGrantStates**.| 352| GET_BUNDLE_INFO_WITH_APPLICATION | 0x00000001 | Obtains **appInfos** with the default **BundleInfo**. | 353| GET_BUNDLE_INFO_WITH_HAP_MODULE | 0x00000002 | Obtains **hapModulesInfo** with the default **BundleInfo**. | 354| 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.| 355| 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.| 356| GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains **reqPermissionDetails** and **permissionGrantStates** with the default **BundleInfo**. | 357| GET_BUNDLE_INFO_WITH_METADATA | 0x00000020 | Indicates whether the returned **ApplicationInfo**, **AbilityInfo**, and **ExtensionAbilityInfo** contain metadata. This flag cannot be used independently.| 358| GET_BUNDLE_INFO_WITH_DISABLE | 0x00000040 | Obtains **BundleInfo** of a disabled application and disabled ability information in **abilitiesInfo**.| 359| GET_BUNDLE_INFO_WITH_SIGNATURE_INFO | 0x00000080 | Obtains **signatureInfo** with the default **BundleInfo**. | 360 361The following table describes **ApplicationFlag** of API version 9. 362 363| ApplicationFlag | Value | Description | 364| ------------------------------------ | ---------- | ------------------------------------------------------------ | 365| GET_APPLICATION_INFO_DEFAULT | 0x00000000 | Obtains the default **ApplicationInfo**. The obtained **ApplicationInfo** does not contain permission or metadata information.| 366| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000001 | Obtains **permissions** with the default **ApplicationInfo**. | 367| GET_APPLICATION_INFO_WITH_METADATA | 0x00000002 | Obtains **metadata** with the default **ApplicationInfo**. | 368| GET_APPLICATION_INFO_WITH_DISABLE | 0x00000004 | Obtains disabled application information. | 369 370 371The following table describes **AbilityFlag** of API version 9. 372| AbilityFlag | Value | Description | 373| --------------------------------- | ---------- | ------------------------------------------------------------ | 374| GET_ABILITY_INFO_DEFAULT | 0x00000000 | Obtains the default **AbilityInfo**. The obtained **AbilityInfo** does not contain permission, metadata, or disabled ability information.| 375| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000001 | Obtains **AbilityInfo** with permission information. | 376| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000002 | Obtains **AbilityInfo** with the **ApplicationInfo** structure. | 377| GET_ABILITY_INFO_WITH_METADATA | 0x00000004 | Obtains **AbilityInfo** with metadata information. | 378| GET_ABILITY_INFO_WITH_DISABLE | 0x00000008 | Obtains all **AbilityInfo**, including disabled abilities. | 379| GET_ABILITY_INFO_ONLY_SYSTEM_APP | 0x00000010 | Obtains **AbilityInfo** for system applications. | 380 381**Adaptation Guide** 382 383Use various flags according to the called API in **@ohos.bundle.bundleManager.d.ts**. 384 385## cl.bundlemanager.10 ApplicationType Enumerated Value Changes in the Default Application Module 386For the **@ohos.bundle.defaultApp** module, both API functions and usage remain unchanged, but only the enumerated values of **ApplicationType** are changed. 387 388**Change Impacts** 389 390There 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. 391 392**Key API/Component Changes** 393 394The enumerated values of **ApplicationType** are changed as follows. 395 396| ApplicationType| Added or Changed in API Version 9 | API Version 8 and Earlier| 397| :-------------: | :-------------: | :--------: | 398| BROWSER | "Web Browser" | "BROWSER" | 399| IMAGE | "Image Gallery" | "IMAGE" | 400| AUDIO | "Audio Player" | "AUDIO" | 401| VIDEO | "Video Player" | "VIDEO" | 402| PDF | "PDF Viewer" | "PDF" | 403| WORD | "Word Viewer" | "WORD" | 404| EXCEL | "Excel Viewer" | "EXCEL" | 405| PPT | "PPT Viewer" | "PPT" | 406 407**Adaptation Guide** 408 409Import the default application module and call related APIs. 410 411``` 412import defaultApp form '@ohos.bundle.defaultAppManager' 413``` 414 415## cl.bundlemanager.11 Distributed Bundle Manager Changes 416API 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. 417 418**Change Impacts** 419 420Applications 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. 421 422**Key API/Component Changes** 423 424All 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. 425 426| Deprecated | Added or Changed in API Version 9 | System API| 427| --------------------- | -------------------- | --------- | 428| getRemoteAbilityInfos | getRemoteAbilityInfo | Yes | 429 430**Adaptation Guide** 431 432Import a new distributed module. 433 434``` 435import distributedBundle form '@ohos.bundle.distributedBundle' 436``` 437 438## cl.bundlemanager.12 Installation-Free Module and API Changes 439APIs 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**. 4401. The imported **@ohos.bundle** module needs to be changed to **@ohos.bundle.freeInstall**. 4412. The **setModuleUpgradeFlag** API is changed to **setHapModuleUpgradeFlag**. 4423. The **isModuleRemovable** API is changed to **isHapModuleRemovable**. 4434. The **getDispatcher** API is changed to **getDispatchInfo**. 444 445**Change Impacts** 446 447Applications using APIs earlier than version 9 are not affected. Applications using APIs of version 9 will fail to be compiled. 448 449**Key API/Component Changes** 450 451The 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. 452 453| Deprecated | Added or Changed in API Version 9 | System API| 454| -------------------- | ----------------------- | --------- | 455| setModuleUpgradeFlag | setHapModuleUpgradeFlag | Yes | 456| isModuleRemovable | isHapModuleRemovable | Yes | 457| getDispatcher | getDispatchInfo | Yes | 458 459**Adaptation Guide** 460 461To use installation-free APIs, import a new module and modify the APIs according to their mappings. 462 463``` 464import freeInstall from '@ohos.bundle.freeInstall' 465``` 466 467## cl.bundlemanager.13 Installation-Free Structure Field Changes 468The fields of the **DisPatchInfo**, **AbilityFormInfo**, **ModuleDistroInfo**, and **ModuleConfigInfo** structures are changed as follows: 4691. 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. 4702. The type of the **supportDimensions** field in the **AbilityFormInfo** structure is changed from **Array\<number>** to **Array\<string>**. 4713. The type of the **defaultDimension** field in the **AbilityFormInfo** structure is changed from **number** to **string**. 4724. The **mainAbility** field is deprecated in the **ModuleDistroInfo** structure and moved to the **ModuleConfigInfo** structure. 4735. The **mainAbility** field is added to the **ModuleConfigInfo** structure. 474 475**Change Impacts** 476 477Applications 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. 478 479**Key API/Component Changes** 480 4811. DispatchInfo 482 483| Deprecated | Added or Changed in API Version 9 | Type | 484| ----------- | ------------------ | ------ | 485| dispatchAPI | dispatchAPIVersion | string | 486 4872. AbilityFormInfo 488 489| Field | Type in API Version 9 | Original Type | 490| ----------------- | -------------- | -------------- | 491| supportDimensions | Array\<string> | Array\<number> | 492| defaultDimension | string | number | 493 4943. ModuleDistroInfo 495 496| Field | Added or Changed in API Version 9| Type | 497| ----------- | -------------- | ------ | 498| mainAbility | N/A | string | 499 5004. MooduleConfigInfo 501 502| Field| Added or Changed in API Version 9| Type | 503| ---- | -------------- | ------ | 504| N/A | mainAbility | string | 505 506**Adaptation Guide** 507 508To use installation-free APIs, import a new module and modify the structures according to their mappings. 509 510``` 511import freeInstall from '@ohos.bundle.freeInstall' 512``` 513 514## cl.bundlemanager.14 Structure Changes 515The structure **GrantStatus** is changed to **PermissionGrantState**. The enumeration type and values remain unchanged. 516 517**Change Impacts** 518 519Applications 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. 520 521**Key API/Component Changes** 522 523The **GrantStatus** structure indicating the authorization status is changed to **PermissionGrantState** in **@ohos.bundle.bundleManager.d.ts**. 524 525| Name | Value| 526| ------------------ | ------ | 527| PERMISSION_DENIED | -1 | 528| PERMISSION_GRANTED | 0 | 529 530**Adaptation Guide** 531 532Import a new module and change the structure name to **PermissionGrantState**. 533 534``` 535import bundle form '@ohos.bundle.bundleManager' 536``` 537## cl.bundlemanager.15 Bundle Manager ShortcutInfo Structure Field Changes 538Fields 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. 539 540**Change Impacts** 541 542Applications 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. 543 544**Key API/Component Changes** 545 546The **ShortcutInfo** and **ShortcutWant** structures are involved. To use the level-2 module export function, import the new module **@ohos.bundle.launcherBundleManager**. 547The following table lists the field changes of the **ShortcutInfo** structure. Fields that are not listed in the table still exist in API version 9. 548 549| Deprecated | Added or Changed in API Version 9| Type | 550| -------------- | -------------- | ------- | 551| disableMessage | N/A | string | 552| isStatic | N/A | boolean | 553| isHomeShortcut | N/A | boolean | 554| isEnabled | N/A | boolean | 555| disableMessage | N/A | boolean | 556 557The following table lists the field changes of the **ShortcutWant** structure. Fields that are not listed in the table still exist in API version 9. 558| Deprecated | Added or Changed in API Version 9| Type | 559| ----------- | -------------- | ------ | 560| targetClass | targetAbility | string | 561 562**Adaptation Guide** 563 564To use installation-free APIs, import a new module and modify the structures according to their mappings. 565 566``` 567import launcherBundleManager form '@ohos.bundle.launcherBundleManager' 568``` 569 570## cl.bundlemanager.16 getBundleInstaller API Changes 571The **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). 572The system capability is **SystemCapability.BundleManager.BundleFramework.Core**. 573 574**Change Impacts** 575 576Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs. 577 578**Key API/Component Changes** 5791. For **getBundleInstaller**, the import module is changed from **@ohos.bundle** to **@ohos.bundle.installer**. 580 581**Adaptation Guide** 582 583Import the new bundle manager installation module and call **getBundleInstaller**. 584 585``` 586import installer form '@ohos.bundle.installer' 587``` 588 589## cl.bundlemanager.17 Bundle Manager Installation API Changes 590The 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**. 591 592**Change Impacts** 593 594Applications using APIs earlier than version 9 are not affected. Applications that use APIs of version 9 need to adapt the new module and APIs. 595 596**Key API/Component Changes** 597 5981. 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. 5992. Fields are added to the **HashParam** structure as follows. 600 601| Added in API Version 9 | Type | 602| ---------- | ------ | 603| moduleName | string | 604| hashValue | string | 605 6063. Fields are added to the **InstallParam** structure as follows. 607 608| Added in API Version 9 | Type | 609| ----------------- | ----------------- | 610| userId | number | 611| installFlag | number | 612| isKeepData | boolean | 613| hashParams | Array\<HashParam> | 614| crowdtestDeadline | number | 615 6164. The **InstallStatus** structure is deprecated. 617 618**Adaptation Guide** 619 620Import the new bundle manager installation module and call **getBundleInstaller**. 621 622``` 623import installer form '@ohos.bundle.installer' 624``` 625 626## cl.bundlemanager.18 Bundle Manager Installation Function Changes 627The 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. 628 629**Change Impacts** 630 631Applications developed in earlier versions are affected. Applications can be successfully installed in the image of the new version only after adaptation. 632 633**Key API/Component Changes** 634 635N/A 636 637**Adaptation Guide** 638 639Configure device types in the application configuration file **config.json** or **module.json**. 640 641``` 642{ 643 "module": { 644 "name": "entry", 645 "type": "entry", 646 // ... 647 "deviceTypes":[ 648 // In this example, default and tablet are configured. In this case, the application can be installed on default and tablet. 649 "default", 650 "tablet" 651 ], 652 // ... 653 } 654``` 655## cl.bundlemanager.19 innerBundleManger Module API Changes 656**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**. 657 658**Change Impacts** 659 660There 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. 661 662**Key API/Component Changes** 663 664The 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**. 665 6661. getLauncherAbilityInfos<br> 6672. getAllLauncherAbilityInfos<br> 6683. getShortcutInfos 669 670**Adaptation Guide** 671 672Import the new module **@ohos.bundle.launcherBundleManage**. 673 674``` 675import launcherBundleManager form '@ohos.bundle.launcherBundleManage' 676``` 677 678## cl.bundlemanager.20 innerBundleManagr Module Changes 679**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**. 680 681**Change Impacts** 682 683There 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. 684 685**Key API/Component Changes** 686 687The **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: 688 689``` 690function on(type: BundleChangedEvent, callback: Callback<BundleChangedInfo>): void; 691function off(type: BundleChangedEvent, callback?: Callback<BundleChangedInfo>): void; 692``` 693**BundleChangedEvent**: 694 695``` 696type BundleChangedEvent = 'add' | 'update' | 'remove'; 697``` 698Callback function of **BundleChangedInfo**: 699``` 700 interface BundleChangedInfo { 701 readonly bundleName: string; 702 readonly userId: number; 703 } 704``` 705After obtaining **BundleChangedInfo**, perform related operations (that is, the **add**, **update**, and **remove** functions in **BundleStatusCallback** of the original API). 706 707**Adaptation Guide** 708 709Import the **bundleMonitor** module and call related APIs. 710 711``` 712import bundleMonitor form '@ohos.bundle.bundleMonitor' 713``` 714 715## cl.bundlemanager.21 bundleStatusCallback.d.ts API Changes 716The **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**. 717 718**Change Impacts** 719 720There 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. 721 722**Key API/Component Changes** 723 724All the following functions are deprecated. The **BundleChangedEvent** API is added to **@ohos.bundle.bundleMonitor.d.ts**. 725 7261. add 7272. update 7283. remove 729 730**Adaptation Guide** 731 732Import 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. 733 734``` 735import bundleMonitor form '@ohos.bundle.bundleMonitor' 736``` 737 738## cl.bundlemanager.22 Zlib Module API Changes 739The **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**. 740 741**Change Impacts** 742 743There 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. 744 745**Key API/Component Changes** 746 747The 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. 748 749| Deprecated | Added or Changed in API Version 9| System API| 750| --------- | -------------- | --------- | 751| zipFile | compressFile | Yes | 752| unzipFile | decompressFile | Yes | 753| ErrorCode | N/A | Yes | 754 755**Adaptation Guide** 756 757The import module does not change. The new API is directly used to adapt exception handling. 758 759``` 760import zlib form '@ohos.zlib' 761```