harmony 鸿蒙AbilityInfo

  • 2022-12-05
  • 浏览 (650)

AbilityInfo

The AbilityInfo module defines the ability information. A system application can obtain the ability information through bundleManager.queryAbilityInfo. The input parameter abilityFlags specifies the information to be contained in the returned AbilityInfo object.

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

Name Type Readable Writable Description
bundleName string Yes No Bundle name.
moduleName string Yes No Name of the HAP file to which the ability belongs.
name string Yes No Ability name.
label string Yes No Resource descriptor of the ability name visible to users. Example: “label”: “$string: mainability_description”.
labelId number Yes No ID of the ability label.
description string Yes No Ability description.
descriptionId number Yes No ID of the ability description.
icon string Yes No Resource descriptor of the ability icon. Example: “icon”: “$media:icon”.
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.
exported boolean Yes No Whether the ability can be called by other bundles.
type AbilityType Yes No Ability type.
This attribute can be used only in the FA model.
orientation DisplayOrientation Yes No Ability display orientation.
launchType LaunchType Yes No Ability launch mode.
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.
readPermission string Yes No Permission required for reading the ability data.
This attribute can be used only in the FA model.
writePermission string Yes No Permission required for writing data to the ability.
This attribute can be used only in the FA model.
uri string Yes No URI of the ability.
This attribute can be used only in the FA model.
deviceTypes Array<string> Yes No Device types supported by the ability.
applicationInfo ApplicationInfo Yes No Application information. The information can be obtained by passing in GET_ABILITY_INFO_WITH_APPLICATION to the abilityFlags parameter of bundleManager.queryAbilityInfo.
metadata Array<Metadata> 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.
enabled boolean Yes No Whether the ability is enabled.
supportWindowModes Array<SupportWindowMode> Yes No Window modes supported by the ability.
windowSize WindowSize Yes No Window size.

WindowSize

Describes the window size.

System capability: SystemCapability.BundleManager.BundleFramework.Core

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.
minWindowHeight number Yes No Minimum height of the window in free window mode. The unit is vp.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

0  赞