js-apis-bundleManager-abilityInfo.md 6.2 KB
Newer Older
1 2
# AbilityInfo

G
Gloria 已提交
3
The **AbilityInfo** module defines the ability information. A system application can obtain the ability information through [bundleManager.queryAbilityInfo](js-apis-bundleManager.md#bundlemanagerqueryabilityinfo). The input parameter [abilityFlags](js-apis-bundleManager.md#abilityflag) specifies the information to be contained in the returned [AbilityInfo](js-apis-bundleManager-abilityInfo.md) object.
4 5 6 7 8 9 10

> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

## AbilityInfo

G
Gloria 已提交
11
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
12 13

| Name                 | Type                                                    | Readable| Writable| Description                                     |
G
Gloria 已提交
14 15 16
| --------------------- | -------------------------------------------------------- | ---- | ---- | ------------------------------------------ |
| bundleName            | string                                                   | Yes  | No  | Bundle name.                           |
| moduleName            | string                                                   | Yes  | No  | Name of the HAP file to which the ability belongs.                   |
17 18
| name                  | string                                                   | Yes  | No  | Ability name.                              |
| label                 | string                                                   | Yes  | No  | Ability name visible to users.                  |
G
Gloria 已提交
19
| labelId               | number                                                   | Yes  | No  | ID of the ability label.                      |
20 21 22 23 24
| description           | string                                                   | Yes  | No  | Ability description.                            |
| descriptionId         | number                                                   | Yes  | No  | ID of the ability description.                      |
| icon                  | string                                                   | Yes  | No  | Index of the ability icon resource file.                |
| iconId                | number                                                   | Yes  | No  | ID of the ability icon.                      |
| process               | string                                                   | Yes  | No  | Process in which the ability runs. If this parameter is not set, the bundle name is used.|
G
Gloria 已提交
25
| exported             | boolean                                                  | Yes  | No  | Whether the ability can be called by other bundles.        |
G
Gloria 已提交
26
| type                  | [AbilityType](js-apis-bundleManager.md#abilitytype)      | Yes  | No  | Ability type.<br>This attribute can be used only in the FA model.|
27 28
| orientation           | [DisplayOrientation](js-apis-bundleManager.md#displayorientation)  | Yes  | No  | Ability display orientation.                        |
| launchType            | [LaunchType](js-apis-bundleManager.md#launchtype)        | Yes  | No  | Ability launch mode.                        |
G
Gloria 已提交
29
| permissions           | Array\<string>                                           | Yes  | No  | Permissions required for other applications to call the ability. The permissions can be obtained by passing in **GET_ABILITY_INFO_WITH_PERMISSION** to the **abilityFlags** parameter of [bundleManager.queryAbilityInfo](js-apis-bundleManager.md#bundlemanagerqueryabilityinfo).|
30 31 32 33
| 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.|
| uri                   | string                                                   | Yes  | No  | URI of the ability.<br>This attribute can be used only in the FA model.|
| deviceTypes           | Array\<string>                                           | Yes  | No  | Device types supported by the ability.                    |
G
Gloria 已提交
34 35
| applicationInfo       | [ApplicationInfo](js-apis-bundleManager-applicationInfo.md)     | Yes  | No  | Application information. The information can be obtained by passing in **GET_ABILITY_INFO_WITH_APPLICATION** to the **abilityFlags** parameter of [bundleManager.queryAbilityInfo](js-apis-bundleManager.md#bundlemanagerqueryabilityinfo).|
| metadata              | Array\<[Metadata](js-apis-bundleManager-metadata.md)>           | Yes  | No  | Metadata of the ability. The information can be obtained by passing in **GET_ABILITY_INFO_WITH_METADATA** to the **abilityFlags** parameter of [bundleManager.queryAbilityInfo](js-apis-bundleManager.md#bundlemanagerqueryabilityinfo).|
36 37 38 39 40 41 42 43
| enabled               | boolean                                                  | Yes  | No  | Whether the ability is enabled.                          |
| supportWindowModes    | Array\<[SupportWindowMode](js-apis-bundleManager.md#supportwindowmode)> | Yes  | No  | Window modes supported by the ability.                     |
| windowSize|[WindowSize](#windowsize)                                            |    Yes  | No  | Window size.|

## WindowSize

Describes the window size.

G
Gloria 已提交
44
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
45 46 47 48 49 50 51 52

| Name              | Type   | Readable| Writable| Description                              |
| -------------------| ------- | ---- | ---- | ---------------------------------- |
| maxWindowRatio     | number  | Yes  | No  | Maximum aspect ratio of the window in free window mode. The value ranges from 0 to 1.|
| minWindowRatio     | number  | Yes  | No  | Minimum aspect ratio of the window in free window mode. The value ranges from 0 to 1.|
| maxWindowWidth     | number  | Yes  | No  | Maximum width of the window in free window mode. The unit is vp.|
| minWindowWidth     | number  | Yes  | No  | Minimum width of the window in free window mode. The unit is vp.|
| maxWindowHeight    | number  | Yes  | No  | Maximum height of the window in free window mode. The unit is vp.|
G
Gloria 已提交
53
| minWindowHeight    | number  | Yes  | No  | Minimum height of the window in free window mode. The unit is vp.|