AbilityInfo
The module provides information about an ability. Unless otherwise specified, the information is obtained through bundle.getAbilityInfo.
NOTE
The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The APIs of this module have been deprecated since API version 9. You are advised to use bundleManager-AbilityInfo instead.
AbilityInfo(deprecated)
NOTE
This API has been supported since API version 7 and deprecated since API version 9. You are advised to use bundleManager-AbilityInfo instead.
System capability: SystemCapability.BundleManager.BundleFramework
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| bundleName | string | Yes | No | Bundle name. |
| name | string | Yes | No | Ability name. |
| label | string | Yes | No | Ability name visible to users. |
| description | string | Yes | No | Ability description. |
| icon | string | Yes | No | Index of the ability icon resource file. |
| descriptionId | number | Yes | No | ID of the ability description. |
| iconId | number | Yes | No | ID of the ability icon. |
| moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. |
| process | string | Yes | No | Process name of the ability. |
| targetAbility | string | Yes | No | Target ability that the ability alias points to. Model restriction: This API can be used only in the FA model. |
| backgroundModes | number | Yes | No | Background service mode of the ability. Model restriction: This API can be used only in the FA model. |
| isVisible | boolean | Yes | No | Whether the ability can be called by other applications. true if the ability can be called by other applications, false otherwise. |
| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. true if the ability provides the service widget capability, false otherwise. Model restriction: This API can be used only in the FA model. |
| type | bundle.AbilityType | Yes | No | Ability type. Model restriction: This API can be used only in the FA model. |
| orientation | bundle.DisplayOrientation | Yes | No | Ability display orientation. |
| launchMode | bundle.LaunchMode | Yes | No | Ability launch mode. |
| permissions | Array<string> | Yes | No | Permissions required for other applications to call the ability. The value is obtained by passing in GET_ABILITY_INFO_WITH_PERMISSION to bundle.getAbilityInfo. |
| deviceTypes | Array<string> | Yes | No | Device types supported by the ability. |
| deviceCapabilities | Array<string> | Yes | No | Device capabilities required for the ability. |
| readPermission | string | Yes | No | Permission required for reading the ability data. Model restriction: This API can be used only in the FA model. |
| writePermission | string | Yes | No | Permission required for writing data to the ability. Model restriction: This API can be used only in the FA model. |
| applicationInfo | ApplicationInfo | Yes | No | Application configuration information. The value is obtained by passing in GET_ABILITY_INFO_WITH_APPLICATION to bundle.getAbilityInfo. |
| uri | string | Yes | No | URI of the ability. Model restriction: This API can be used only in the FA model. |
| labelId | number | Yes | No | ID of the ability label. |
| subType | bundle.AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. Model restriction: This API can be used only in the FA model. |
| metaData8+ | Array<CustomizeData> | Yes | No | Metadata of the ability. The value is obtained by passing in GET_ABILITY_INFO_WITH_METADATA to bundle.getAbilityInfo. |
| enabled8+ | boolean | Yes | No | Whether the ability is enabled. true if enabled, false otherwise. |