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

!15540 翻译完成: 14587+14343+14454+15241+15346+14321 ability+bundleManager changelog

Merge pull request !15540 from wusongqing/TR14587
# ChangeLog of JS API Changes of the Ability Subsystem
# Ability Subsystem Changelog
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(Mr) has the following API changes in the ability subsystem:
Compared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(MR) has the following API changes in the ability subsystem:
## cl.ability.1 API Migration
The **requestPermissionsFromUser** API of **UIAbilityContext** is migrated from the ability subsystem to the security subsystem.
Previously, the permission popup was implemented based on **UIAbility**, which used the **startAbilityForResult** API of **UIAbilityContext** to return the permission authorization result to the caller. Therefore, **requestPermissionsFromUser** was temporarily placed in **UIAbilityContext**. The permission popup is now implemented based on **ServiceExtensionAbility**, which no longer requires **startAbilityForResult** of **UIAbilityContext**. Therefore, **requestPermissionsFromUser** is migrated to the security subsystem.
You need to adapt your applications based on the following information:
You need to adapt your application.
**Change Impacts**
**Change Impact**
JS APIs in API version 9 are affected. The application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version.
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enumeration/Constant | Change Type|
| ---------------------------- | ---------------- | ------------------------------------------------------------ | -------- |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array<string>, requestCallback: AsyncCallback<PermissionRequestResult>): void; | Deleted |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array<string>): Promise<PermissionRequestResult>; | Deleted |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array<Permissions>, requestCallback: AsyncCallback<PermissionRequestResult>) : void; | Added |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array<Permissions>) : Promise<PermissionRequestResult>; | Added |
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array<string>, requestCallback: AsyncCallback<PermissionRequestResult>): void; | Deleted |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array<string>): Promise<PermissionRequestResult>; | Deleted |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array<Permissions>, requestCallback: AsyncCallback<PermissionRequestResult>) : void; | Added |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array<Permissions>) : Promise<PermissionRequestResult>; | Added |
**Adaptation Guide**
......@@ -51,7 +52,7 @@ onWindowStageCreate() {
In the [Ability Exception Rectification](../OpenHarmony_3.2.8.3/changelogs-ability.md) document, some APIs in API version 9 have been marked as deprecated. According to API specifications of OpenHarmony, these APIs should be deleted.
**Change Impacts**
**Change Impact**
The application developed based on earlier versions needs to use new APIs to replace the deleted ones. Otherwise, the application compilation will be affected.
......@@ -76,46 +77,50 @@ API files are deleted.
APIs or attributes are deleted:
- @ohos.application.Configuration.d.ts
- **direction**, **screenDensity**, **displayId**, and **hasPointerDevice** of **Configuration** are deleted. Replace it with **Configuration** of **@ohos.app.ability.Configuration.d.ts**.
- **direction**, **screenDensity**, **displayId**, and **hasPointerDevice** of **Configuration** are deleted. Use **Configuration** of **@ohos.app.ability.Configuration.d.ts**.
- @ohos.application.ConfigurationConstant.d.ts
- **Direction** and **ScreenDensity** are deleted. Replace them with **Direction** and **ScreenDensity** of **@ohos.app.ability.ConfigurationConstant.d.ts**.
- **Direction** and **ScreenDensity** are deleted. Use **Direction** and **ScreenDensity** of **@ohos.app.ability.ConfigurationConstant.d.ts**.
- @ohos.application.abilityManager.d.ts
- **getExtensionRunningInfos** and **getTopAbility** are deleted. Replace them with synonymous methods of **@ohos.app.ability.abilityManager.d.ts**.
- **getExtensionRunningInfos** and **getTopAbility** are deleted. Use the APIs with the same name in **@ohos.app.ability.abilityManager.d.ts**.
- @ohos.application.appManager.d.ts
- **ApplicationState** and **ProcessState** are deleted. Replace them with **ApplicationState** and **ProcessState** of **@ohos.app.ability.appManager.d.ts**.
- **registerApplicationStateObserver** and **getProcessRunningInformation** are deleted. Replace them with synonymous methods of **@ohos.app.ability.appManager.d.ts**.
- **ApplicationState** and **ProcessState** are deleted. Use **ApplicationState** and **ProcessState** of **@ohos.app.ability.appManager.d.ts**.
- **registerApplicationStateObserver** and **getProcessRunningInformation** are deleted. Use the APIs with the same name in **@ohos.app.ability.appManager.d.ts**.
- @ohos.application.formHost.d.ts
- **shareForm** and **notifyFormsPrivacyProtected** are deleted. Replace them with synonymous methods of **@ohos.app.form.formHost.d.ts**.
- **shareForm** and **notifyFormsPrivacyProtected** are deleted. Use the APIs with the same name in **@ohos.app.form.formHost.d.ts**.
- @ohos.application.formInfo.d.ts
- **eTS** of **FormType** is deleted. Replace it with **eTS** of **FormType** in **@ohos.app.form.formInfo.d.ts**.
- **IDENTITY_KEY**, **BUNDLE_NAME_KEY**, **ABILITY_NAME_KEY**, and **DEVICE_ID_KEY** of **FormParam** are deleted. Replace them with synonymous enumerations of **@ohos.app.form.formInfo.d.ts**.
- **FormInfoFilter** is deleted. Replace it with **FormInfoFilter** of **@ohos.app.form.formInfo.d.ts**.
- **FormDimension** is deleted. Replace it with **FormDimension** of **@ohos.app.form.formInfo.d.ts**.
- **VisibilityType** is deleted. Replace it with **VisibilityType** of **@ohos.app.form.formInfo.d.ts**.
- **eTS** of **FormType** is deleted. Use **eTS** of **FormType** in **@ohos.app.form.formInfo.d.ts**.
- **IDENTITY_KEY**, **BUNDLE_NAME_KEY**, **ABILITY_NAME_KEY**, and **DEVICE_ID_KEY** of **FormParam** are deleted. Use the enums with the same name in **@ohos.app.form.formInfo.d.ts**.
- **FormInfoFilter** is deleted. Use **FormInfoFilter** of **@ohos.app.form.formInfo.d.ts**.
- **FormDimension** is deleted. Use **FormDimension** of **@ohos.app.form.formInfo.d.ts**.
- **VisibilityType** is deleted. Use **VisibilityType** of **@ohos.app.form.formInfo.d.ts**.
- @ohos.wantAgent.d.ts
- **trigger** and **getOperationType** are deleted. Replace them with synonymous methods of **@ohos.app.ability.wantAgent.d.ts**.
- **trigger** and **getOperationType** are deleted. Use the APIs with the same name in **@ohos.app.ability.wantAgent.d.ts**.
- application/ApplicationContext.d.ts
- **registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback** are deleted. Replace them with **on** and **off**.
- **registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback** are deleted. Use **on** and **off**.
- application/ServiceExtensionContext.d.ts
- **connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility** are deleted. Replace them with **connectServiceExtensionAbility**, **connectServiceExtensionAbilityWithAccount**, and **disconnectServiceExtensionAbility**.
- @ohos.application.ExtensionAbility.d.ts
- **onCreate**, **onCastToNormal**, **onUpdate**, **onVisibilityChange**, **onEvent**, **onDestroy**, **onAcquireFormState**, and **onShare** are deleted. Replace them with the following lifecycle methods of **@ohos.app.form.FormExtensionAbility.d.ts**: **onAddForm**, **onCastToNormalForm**, **onUpdateForm**, **onChangeFormVisibility**, **onFormEvent**, **onRemoveForm**, **onAcquireFormState**, and **onShareForm**.
- **connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility** are deleted. Use **connectServiceExtensionAbility**, **connectServiceExtensionAbilityWithAccount**, and **disconnectServiceExtensionAbility**.
- @ohos.application.FormExtension.d.ts
- **onCreate**, **onCastToNormal**, **onUpdate**, **onVisibilityChange**, **onEvent**, **onDestroy**, **onAcquireFormState**, and **onShare** are deleted. Use the following lifecycle methods of **@ohos.app.form.FormExtensionAbility.d.ts**: **onAddForm**, **onCastToNormalForm**, **onUpdateForm**, **onChangeFormVisibility**, **onFormEvent**, **onRemoveForm**, **onAcquireFormState**, and **onShareForm**.
- @ohos.application.abilityDelegatorRegistry.d.ts
- **AbilityDelegator**, **AbilityDelegatorArgs**, **AbilityMonitor**, and **ShellCmdResult** are deleted. Replace them with synonymous classes of **@ohos.app.ability.abilityDelegatorRegistry.d.ts**.
- **AbilityDelegator**, **AbilityDelegatorArgs**, **AbilityMonitor**, and **ShellCmdResult** are deleted. Use the classes with the same name in **@ohos.app.ability.abilityDelegatorRegistry.d.ts**.
- @ohos.application.abilityManager.d.ts
- **AbilityRunningInfo** and **ExtensionRunningInfo** are deleted. Replace them with synonymous classes of **@ohos.app.ability.abilityManager.d.ts**.
- **AbilityRunningInfo** and **ExtensionRunningInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.abilityManager.d.ts**.
- @ohos.application.appManager.d.ts
- **AbilityStateData**, **AppStateData**, **ApplicationStateObserver**, **ProcessRunningInfo**, and **ProcessRunningInformation** are deleted. Replace them with synonymous classes of **@ohos.app.ability.appManager.d.ts**.
- **AbilityStateData**, **AppStateData**, **ApplicationStateObserver**, **ProcessRunningInfo**, and **ProcessRunningInformation** are deleted. Use the classes with the same name in **@ohos.app.ability.appManager.d.ts**.
- @ohos.application.missionManager.d.ts
- **MissionInfo**, **MissionListener**, and **MissionSnapshot** are deleted. Replace them with synonymous classes of **@ohos.app.ability.missionManager.d.ts**.
- **MissionInfo**, **MissionListener**, and **MissionSnapshot** are deleted. Use the classes with the same name in **@ohos.app.ability.missionManager.d.ts**.
- @ohos.wantAgent.d.ts
- **TriggerInfo** and **WantAgentInfo** are deleted. Replace them with synonymous classes of **@ohos.app.ability.wantAgent.d.ts**.
- **TriggerInfo** and **WantAgentInfo** are deleted. Use the classes with the same name in **@ohos.app.ability.wantAgent.d.ts**.
**Adaptation Guide**
As mentioned above, only several APIs have their names changed in terms of, for example, the registration callbacks (**registerAbilityLifecycleCallback**, **unregisterAbilityLifecycleCallback**, **registerEnvironmentCallback**, and **unregisterEnvironmentCallback**) and connection and disconnection **ServiceExtensionAbility** (**connectAbility**, **connectAbilityWithAccount**, and **disconnectAbility**). For such APIs, replace their names with those of their corresponding new APIs in the lifecycle callbacks.
Most APIs are moved to the new namespace. Therefore, you can modify **import** for adaption.
Most APIs are moved to the new namespace. Therefore, you can modify **import** for adaptation.
For example, the original API uses **@ohos.application.Ability**:
......@@ -129,4 +134,4 @@ You can directly modify **import** to switch to the new namespace:
import Ability from '@ohos.app.ability.UIAbility';
```
In addition, exception processing is needed. For details, see the API reference for the new APIs.
In addition, exception handling is needed. For details, see the API reference for the new APIs.
# Bundle Manager Subsystem ChangeLog
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Field Change of the ApplicationInfo Structure in API Version 9
## cl.bundlemanager.1 Field Change of the ApplicationInfo Struct in API Version 9
The **ApplicationInfo** structure [[bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/applicationInfo.d.ts)] in API version 9 has field changes, with the **systemApp** field being added and the **entryDir** field being deleted.
**Change Impacts**
The **ApplicationInfo** struct [bundleManager/applicationInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts) in API version 9 has field changes, with the **systemApp** field being added and the **entryDir** field being deleted.
**Change Impact**<br>
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
**Key API/Component Changes**
The following table describes the changed fields in the **ApplicationInfo** structure.
| Deleted Field | Added or Changed Field in API Version 9| Type |
| -------- | -------------- | ------- |
| None | systemApp | boolean |
| entryDir | None | string |
**Adaptation Guide**
**Key API/Component Changes**<br>
The following table describes the changed fields in the **ApplicationInfo** struct.
| Deleted Field| Added or Changed Field in API Version 9| Type|
| --- | --- | --- |
| N/A| systemApp | boolean |
| entryDir | N/A | string |
Import the bundle manager query module and use the **systemApp** field in the **ApplicationInfo** structure of API version 9. If the **entryDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
**Adaptation Guide**<br>
Import the bundle manager query module and use the **systemApp** field in the **ApplicationInfo** struct of API version 9. If the **entryDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
## cl.bundlemanager.2 Field Change of the HapModuleInfo Structure in API Version 9
## cl.bundlemanager.2 Field Change of the HapModuleInfo Struct in API Version 9
The **moduleSourceDir** field is deleted from the **HapModuleInfo** structure [[bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/hapModuleInfo.d.ts)] in API version 9.
**Change Impacts**
The **moduleSourceDir** field is deleted from the **HapModuleInfo** struct [bundleManager/hapModuleInfo.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts) in API version 9.
**Change Impact**<br>
There is no impact on applications that use the APIs of versions earlier than 9. The applications that use the APIs of version 9 need to adapt new modules and APIs.
**Key API/Component Changes**
The following table describes the changed fields in the **HapModuleInfo** structure.
| Deleted Field | Added or Changed Field in API Version 9| Type |
| --------------- | -------------- | ------ |
| moduleSourceDir | None | string |
**Adaptation Guide**
**Key API/Component Changes**<br>
The following table describes the changed fields in the **HapModuleInfo** struct.
| Deleted Field| Added or Changed Field in API Version 9| Type|
| --- | --- | --- |
| moduleSourceDir | N/A | string |
Import the bundle manager query module and do not use the **moduleSourceDir** field in the **HapModuleInfo** structure of API version 9. If the **moduleSourceDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
**Adaptation Guide**<br>
Import the bundle manager query module and do not use the **moduleSourceDir** field in the **HapModuleInfo** struct of API version 9. If the **moduleSourceDir** field is used, change the field because it is redundant in features where HAP decompression is not required.
......@@ -9,7 +9,7 @@ If the value of **bundle-name** is different from the value of **bundleName** in
error: verify signature failed.
```
**Change Impacts**
**Change Impact**
For applications using system images of 3.2.10.5 or later, if the **bundle-name** field in the signing certificate profile is different from the bundle name of the application, application installation fails. This change has no impact on applications using system images earlier than 3.2.10.5.
......@@ -18,19 +18,20 @@ For applications using system images of 3.2.10.5 or later, if the **bundle-name*
No API or component change is involved.
**Adaptation Guide**
If "error: verify signature failed" is displayed, change **bundle-name** in the signing certificate profile to the bundle name of the application, generate a new signing certificate (with the file name extension .p7b), and sign the application again.
If "error: verify signature failed" is displayed, change **bundle-name** in the signing certificate profile to the bundle name of the application, generate a new signing certificate (with the file name extension .p7b), and sign the application again. For details about how to use the signing tool and generate a signing certificate, see [hapsigner Guide](../../../application-dev/security/hapsigntool-guidelines.md).
For details about how to use the signing tool and generate a signing certificate, see [hapsigner Guide](../../../application-dev/security/hapsigntool-guidelines.md).
## cl.bundlemanager.2 Changed Underlying Capability by Adding Control over Applications Without Entry Icons
If no entry icon is configured for an application that has not requested the **AllowHideDesktopIcon** privilege, a default icon is displayed on the home screen. Any click on the icon redirects to the application details page. An application is determined to have no entry icon in either of the following scenarios:
1. The **abilities** field is not configured for the application.
2. The **abilities** field is configured for the application, but the **skills** field under the ability of any page type does not contain both **action.system.home** and **entity.system.home**, as follows:
2. The **abilities** field is configured for the application, but the **skills** field under the ability of any page type does not contain both **ohos.want.action.home** and **entity.system.home**, as follows:
```json
"skills": [
{
"actions": [
"action.system.home"
"ohos.want.action.home"
],
"entities": [
"entity.system.home"
......@@ -42,9 +43,9 @@ If the application installation mode is **hdc_std install** or **bm install**, a
If your application does not need an icon to be displayed on the home screen, request the **AllowHideDesktopIcon** privilege and configure it in the signing certificate or trustlist (**install_list_capability.json**). For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **action.system.home** and **entity.system.home**.
If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **ohos.want.action.home** and **entity.system.home**.
**Change Impacts**
**Change Impact**
For applications using system images of 3.2.10.5 and later versions, if no entry icon is configured for an application, the default icon is displayed on the home screen when the application is installed using the CLI. This change has no impact on applications using system images earlier than 3.2.10.5.
......@@ -56,7 +57,7 @@ No API or component change is involved.
If your application does not need an icon to be displayed on the home screen, request the **AllowHideDesktopIcon** privilege and configure it in the signing certificate or trustlist (**install_list_capability.json**). For details, see [Application Privilege Configuration Guide](../../../device-dev/subsystems/subsys-app-privilege-config-guide.md).
If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **action.system.home** and **entity.system.home**.
If your application needs an icon to be displayed on the home screen, select an ability from **abilities** and configure its **skills** field to contain both **ohos.want.action.home** and **entity.system.home**.
## cl.bundlemanager.3 Changed Underlying Capability by Restricting AllowAppUsePrivilegeExtension, AllowAppMultiProcess, and AllowFormVisibleNotify from Being Configured in the Signing Certificate
......@@ -71,7 +72,7 @@ For the XTS or local debugging demo, if the **install_list_capability.json** fil
The **AllowAppUsePrivilegeExtension** privilege is requested by configuring it under the **extensionAbilities** field, with the **type** attribute set to **dataShare** or **service**, in the application configuration file. If this privilege is not configured, the installation fails.
**Change Impacts**
**Change Impact**
For applications using system images of 3.2.10.5 or later, if the required privileges are not requested using the trustlist (**install_list_capability.json**), application installation may fail. This change has no impact on applications using system images earlier than 3.2.10.5.
......@@ -93,7 +94,7 @@ For the XTS or local debugging demo, if the **install_list_capability.json** fil
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 Impacts**
**Change Impact**
If the application uses a combined path to access a resource file, the access fails. It must use the resource management interface.
......
# Ability Subsystem Changelog
## cl.ability.1 AreaMode APIs Changed
Duplicate **AreaMode** APIs are deleted.
**Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.app.ability.common.d.ts | common.AreaMode | | Deleted |
| application/Context.d.ts | AreaMode | | Deleted |
**Adaptation Guide**
Use **AreaMode** in **@ohos.app.ability.contextConstant.d.ts**.
```ts
import contextConstant from '@ohos.app.ability.contextConstant';
let area: contextConstant.AreaMode = contextConstant.AreaMode.EL1;
```
## cl.ability.2 killProcessesBySelf Renamed
The **killProcessesBySelf** API is renamed **killAllProcesses**.
**Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ------------------------------ | ------------------ | ----------------------------------------------------- | -------- |
| application/ApplicationContext | ApplicationContext | killProcessesBySelf(): Promise\<void\>; | Deleted |
| application/ApplicationContext | ApplicationContext | killProcessesBySelf(callback: AsyncCallback\<void\>); | Deleted |
| application/ApplicationContext | ApplicationContext | killAllProcesses(): Promise\<void\>; | Added |
| application/ApplicationContext | ApplicationContext | killAllProcesses(callback: AsyncCallback\<void\>); | Added |
**Adaptation Guide**
The following code snippet shows how to call **killProcessesBySelf** in an application.
Code before the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.killProcessesBySelf()
```
Code after the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.killAllProcesses()
```
## cl.ability.3 getProcessRunningInformation Renamed
The **getProcessRunningInformation** API is renamed **getRunningProcessInformation**.
**Change Impact**
JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version.
**Key API/Component Changes**
| Module | Class | Method/Attribute/Enum/Constant | Change Type|
| ----------------------------------- | ------------------ | ------------------------------------------------------------ | -------- |
| @ohos.app.ability.appManager.d.ts | appManager | function getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation\>\>; | Deleted |
| @ohos.app.ability.appManager.d.ts | appManager | function getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInformation\>\>): void; | Deleted |
| @ohos.app.ability.appManager.d.ts | appManager | function getRunningProcessInformation(): Promise\<Array\<ProcessInformation\>\>; | Added |
| @ohos.app.ability.appManager.d.ts | appManager | function getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation\>\>): void; | Added |
| application/ApplicationContext.d.ts | ApplicationContext | getProcessRunningInformation(): Promise\<Array\<ProcessRunningInformation\>\>; | Deleted |
| application/ApplicationContext.d.ts | ApplicationContext | getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInformation\>\>): void; | Deleted |
| application/ApplicationContext.d.ts | ApplicationContext | getRunningProcessInformation(): Promise\<Array\<ProcessInformation\>\>; | Added |
| application/ApplicationContext.d.ts | ApplicationContext | getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation\>\>): void; | Added |
**Adaptation Guide**
The following code snippet shows how to call **getProcessRunningInformation** in an application.
Code before the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.getProcessRunningInformation()
```
Code after the change:
```ts
let context: common.UIAbilityContext = globalThis.abilityContext;
let appContext = context.getApplicationContext();
appContext.getRunningProcessInformation()
```
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Deleted getAbilityIcon
The **getAbilityIcon** API in [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is deleted. The **getMediaContent** API in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) can be used instead.
**Change Impact**<br>
The **getAbilityIcon** API does not take effect.
**Key API/Component Changes**<br>
The **getAbilityIcon** API is deleted from **@ohos.bundle.bundleManager.d.ts**.
**Adaptation Guide**<br>
If your application uses **getAbilityIcon** in **@ohos.bundle.bundleManager.d.ts**, replace it with **getMediaContent** in **@ohos.resourceManager.d.ts**. You need to obtain the icon ID in advance. For details, see [Usage Guide](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9).
## cl.bundlemanager.2 Added Error Code 202
Error code 202 is added to the bundle manager subsystem. If a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem, error code 202 is returned.
**Change Impact**<br>
Error code 202 is returned when a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem.
**Key API/Component Changes**<br>
If a non-system application calls a system API of API version 9 or later provided by the bundle manager subsystem, error code 202 is returned.
**Adaptation Guide**<br>
No adaptation is required.
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Bottom-Layer Capability Changed So That Only the System Resource HAP Supports Custom Permissions
Only the system resource HAP supports custom permissions. During HAP parsing, the bundle manager module parses the **definePermissions** field only in the configuration file of the resource HAP (bundle name: **ohos.global.systemres**), but not this field in other HAPs. This field is used to define permissions.
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
**Change Impact**<br>
After an upgrade to the new version image, the custom permission of the application does not take effect, and the authorization fails.
**Key API/Component Changes**<br>
The bottom-layer capability of the bundle manager module is changed. Only the system resource HAP supports custom permissions.
**Adaptation Guide**<br>
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
## cl.bundlemanager.2 Level-2 Module File Names Changed
The level-2 module file names of the bundle manager module are changed to their respective API names in the file, as listed below.
| Original File Name|New File Name|
|----|----|
| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts |
| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts |
| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts |
| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts |
| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts |
| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts |
| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts |
| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts |
| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts |
| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts |
| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts |
| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts |
| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts |
To sum up, except **packInfo**, which is changed to **BundlePackInfo**, the other file names are changed to start with uppercase letters.
**Change Impact**<br>
The change of the level-2 module file names does not affect the use of the level-1 module. If a level-2 module interface under **bundleManager** is directly imported to the .ts file and an error is reported during compilation on DevEco Studio, you must change the name of the imported file.
**Key API/Component Changes**<br>
The .d.ts file names in the **bundleManager** folder are changed to their respective API names in the file.
**Adaptation Guide**<br>
Generally, no adaptation is required. If a file in the **bundleManager** folder is directly imported to the application, you must change the imported file name as follows:
**Before change:**
```ts
import {AbilityInfo} from 'bundleManger/abilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/packInfo';
```
**After change:**
```ts
import {AbilityInfo} from 'bundleManger/AbilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/BundlePackInfo';
```
## cl.bundlemanager.3 LaunchType Enum Type Name Changed from STANDARD to MULTITON
The enum type name of [LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is changed from **STANDARD** to **MULTITON**. The enum value remains unchanged, indicating the multi-instance type.
**Change Impact**<br>
The **LaunchType.STANDARD** type does not take effect.
**Key API/Component Changes**<br>
The enum type name of **LaunchType** is changed from **STANDARD** to **MULTITON**.
**Adaptation Guide**<br>
Change **LaunchType.STANDARD** to **LaunchType.MULTITON** for your application.
## cl.bundlemanager.4 Changed the isVisible Field in the AbilityInfo Struct to exported
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.5 Changed the isVisible Field in the ExtensionAbilityInfo Struct to exported
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.6 Changed the visible Field in the ModuleAbilityInfo Struct to exported
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **visible** field does not take effect.
**Key API/Component Changes**<br>
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **visible** to **exported** for your application.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册