openharmony 鸿蒙 js-apis-bundleManager-abilityInfo

2025-06-12 浏览 (1)

AbilityInfo

The AbilityInfo module defines the ability information. A third-party application can obtain its own ability information through bundleManager.getBundleInfoForSelf, with GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_ABILITY passed in to bundleFlags.

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

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
bundleNamestringYesNoBundle name.
Atomic service API: This API can be used in atomic services since API version 11.
moduleNamestringYesNoModule name to which the ability belongs.
Atomic service API: This API can be used in atomic services since API version 11.
namestringYesNoAbility name.
Atomic service API: This API can be used in atomic services since API version 11.
labelstringYesNoResource descriptor of the ability name visible to users. Example: "label": "$string: mainability_description".
Atomic service API: This API can be used in atomic services since API version 11.
labelIdnumberYesNoID of the ability label.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionstringYesNoAbility description.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionIdnumberYesNoID of the ability description.
Atomic service API: This API can be used in atomic services since API version 11.
iconstringYesNoResource descriptor of the ability icon. Example: "icon": "$media:icon".
Atomic service API: This API can be used in atomic services since API version 11.
iconIdnumberYesNoID of the ability icon.
Atomic service API: This API can be used in atomic services since API version 11.
processstringYesNoProcess name of the ability.
Atomic service API: This API can be used in atomic services since API version 11.
exportedbooleanYesNoWhether the ability can be called by other applications. The value true means that the ability can be called by other applications, and false means the opposite.
Atomic service API: This API can be used in atomic services since API version 11.
typebundleManager.AbilityTypeYesNoAbility type.
Model restriction: This API can be used only in the FA model.
orientationbundleManager.DisplayOrientationYesNoAbility display orientation.
Atomic service API: This API can be used in atomic services since API version 11.
launchTypebundleManager.LaunchTypeYesNoAbility launch mode.
Atomic service API: This API can be used in atomic services since API version 11.
permissionsArray<string>YesNoPermissions required for other applications to call the ability.
Atomic service API: This API can be used in atomic services since API version 11.
readPermissionstringYesNoPermission required for reading the ability data.
Model restriction: This API can be used only in the FA model.
writePermissionstringYesNoPermission required for writing data to the ability.
Model restriction: This API can be used only in the FA model.
uristringYesNoURI of the ability.
Model restriction: This API can be used only in the FA model.
deviceTypesArray<string>YesNoDevice types supported by the ability.
Atomic service API: This API can be used in atomic services since API version 11.
applicationInfoApplicationInfoYesNoApplication information. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITY, and GET_BUNDLE_INFO_WITH_APPLICATION to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
metadataArray<Metadata>YesNoMetadata of the ability. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITY, and GET_BUNDLE_INFO_WITH_METADATA to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
enabledbooleanYesNoWhether the ability is enabled. The value true means that the ability is enabled, and false means the opposite.
Atomic service API: This API can be used in atomic services since API version 11.
supportWindowModesArray<bundleManager.SupportWindowMode>YesNoWindow modes supported by the ability.
Atomic service API: This API can be used in atomic services since API version 11.
windowSizeWindowSizeYesNoWindow size.
Atomic service API: This API can be used in atomic services since API version 11.
excludeFromDock12+booleanYesNoWhether the ability icon can be hidden in the dock area. The value true means that the ability icon can be hidden in the dock area, and false means the opposite.
Atomic service API: This API can be used in atomic services since API version 12.
skills12+Array<Skill>YesNoSkills of the ability.
Atomic service API: This API can be used in atomic services since API version 12.
appIndex12+numberYesNoIndex of an application clone. It takes effect only for application clones.
orientationId14+numberYesNoResource ID of the ability display mode. If orientationId is set to a value other than 0, the current display mode is customized, and this ID must be used to obtain the corresponding resource from the resource manager module. If orientationId is set to 0, no resource is configured.
Atomic service API: This API can be used in atomic services since API version 14.

WindowSize

Describes the window size.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
maxWindowRationumberYesNoMaximum aspect ratio of the window in free window mode. The value ranges from 0 to 1. An example value is 0.12.
minWindowRationumberYesNoMinimum aspect ratio of the window in free window mode. The value ranges from 0 to 1. An example value is 0.5.
maxWindowWidthnumberYesNoMaximum width of the window in free window mode. The unit is vp.
minWindowWidthnumberYesNoMinimum width of the window in free window mode. The unit is vp.
maxWindowHeightnumberYesNoMaximum height of the window in free window mode. The unit is vp.
minWindowHeightnumberYesNoMinimum height of the window in free window mode. The unit is vp.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙AbilityAccessControl

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_access_control.h

harmony 鸿蒙ability_base_common.h

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/1HFPhQ