js-apis-bundle-AbilityInfo.md 5.4 KB
Newer Older
W
wusongqing 已提交
1 2
# AbilityInfo

3
Unless otherwise specified, ability information is obtained through **GET_BUNDLE_DEFAULT**.
W
wusongqing 已提交
4

W
wusongqing 已提交
5
> **NOTE**
6
>
W
wusongqing 已提交
7 8
> 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.

9
## AbilityInfo<sup>(deprecated)<sup>
W
wusongqing 已提交
10

11 12 13
> This API is deprecated since API version 9. You are advised to use [AbilityInfo](js-apis-bundleManager-abilityInfo.md) instead.

 **System capability**: SystemCapability.BundleManager.BundleFramework
W
wusongqing 已提交
14 15 16 17 18 19 20 21 22 23 24 25

| Name                 | Type                                                    | Readable| Writable| Description                                     |
| --------------------- | -------------------------------------------------------- | ---- | ---- | ----------------------------------------- |
| bundleName            | string                                                   | Yes  | No  | Bundle name of the application.                                 |
| 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  | Ability description ID.                          |
| iconId                | number                                                   | Yes  | No  | Ability icon ID.                          |
| moduleName            | string                                                   | Yes  | No  | Name of the HAP file to which the ability belongs.                 |
| process               | string                                                   | Yes  | No  | Process in which the ability runs. If this parameter is not set, the bundle name is used.|
26 27
| targetAbility         | string                                                   | Yes  | No  | Target ability that the ability alias points to.<br>This attribute can be used only in the FA model.|
| backgroundModes       | number                                                   | Yes  | No  | Background service mode of the ability.<br>This attribute can be used only in the FA model.    |
W
wusongqing 已提交
28
| isVisible             | boolean                                                  | Yes  | No  | Whether the ability can be called by other applications.        |
29
| formEnabled           | boolean                                                  | Yes  | No  | Whether the ability provides the service widget capability.<br>This attribute can be used only in the FA model.|
30
| type                  | AbilityType                                              | Yes  | No  | Ability type.<br>This attribute can be used only in the FA model. |
W
wusongqing 已提交
31 32
| orientation           | DisplayOrientation                                       | Yes  | No  | Ability display orientation.                        |
| launchMode            | LaunchMode                                               | Yes  | No  | Ability launch mode.                        |
33
| permissions           | Array\<string>                                           | Yes  | No  | Permissions required for other applications to call the ability.<br>The value is obtained by passing **GET_ABILITY_INFO_WITH_PERMISSION**.|
W
wusongqing 已提交
34 35
| deviceTypes           | Array\<string>                                           | Yes  | No  | Device types supported by the ability.                    |
| deviceCapabilities    | Array\<string>                                           | Yes  | No  | Device capabilities required for the ability.                    |
36 37 38 39
| readPermission        | string                                                   | Yes  | No  | Permission required for reading the ability data.<br>This attribute can be used only in the FA model.|
| writePermission       | string                                                   | Yes  | No  | Permission required for writing data to the ability.<br>This attribute can be used only in the FA model.|
| applicationInfo       | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md)     | Yes  | No  | Application configuration information.<br>The value is obtained by passing **GET_ABILITY_INFO_WITH_APPLICATION**.|
| uri                   | string                                                   | Yes  | No  | URI of the ability.<br>This attribute can be used only in the FA model.|
W
wusongqing 已提交
40
| labelId               | number                                                   | Yes  | No  | Ability label ID.                          |
41
| subType               | AbilitySubType                                           | Yes  | No  | Subtype of the template that can be used by the ability.<br>This attribute can be used only in the FA model.|
42
| metadata<sup>8+</sup> | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>           | Yes  | No  | Metadata of the ability.<br>The value is obtained by passing **GET_ABILITY_INFO_WITH_METADATA**.|
W
wusongqing 已提交
43
| enabled<sup>8+</sup>  | boolean                                                  | Yes  | No  | Whether the ability is enabled.                          |