ExtensionAbilityInfo

The module defines the ExtensionAbility information. An application can obtain its own ExtensionAbility information through bundleManager.getBundleInfoForSelf, with GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_EXTENSION_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.

Modules to Import

import { bundleManager } from '@kit.AbilityKit';

ExtensionAbilityInfo

System capability: SystemCapability.BundleManager.BundleFramework.Core

Name Type Read-Only Optional Description
bundleName string Yes No Bundle name.
Atomic service API: This API can be used in atomic services since API version 11.
moduleName string Yes No Name of the HAP file to which the ExtensionAbility belongs.
Atomic service API: This API can be used in atomic services since API version 11.
name string Yes No Name of the ExtensionAbility.
Atomic service API: This API can be used in atomic services since API version 11.
labelId number Yes No ID of the ExtensionAbility label.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionId number Yes No ID of the ExtensionAbility description.
Atomic service API: This API can be used in atomic services since API version 11.
iconId number Yes No ID of the ExtensionAbility icon.
Atomic service API: This API can be used in atomic services since API version 11.
exported boolean Yes No Whether the ExtensionAbility can be called by other applications. true if the ExtensionAbility can be called by other applications, false otherwise.
Atomic service API: This API can be used in atomic services since API version 11.
extensionAbilityType bundleManager.ExtensionAbilityType Yes No Type of the ExtensionAbility.
Atomic service API: This API can be used in atomic services since API version 11.
permissions Array<string> Yes No Permissions required for other bundles to call the ExtensionAbility.
Atomic service API: This API can be used in atomic services since API version 11.
applicationInfo ApplicationInfo Yes No Application configuration information . The information can be obtained by passing in GET_EXTENSION_ABILITY_INFO_WITH_APPLICATION to the extensionAbilityFlags parameter of queryExtensionAbilityInfo .
This field is not returned when the getBundleInfoForSelf or getBundleInfo is used to obtain ExtensionAbilityInfo information. You can obtain the related information by obtaining the bundleInfo.appInfo object.
Atomic service API: This API can be used in atomic services since API version 11.
metadata Array<Metadata> Yes No Metadata of the ExtensionAbility. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_EXTENSION_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.
enabled boolean Yes No Whether the ExtensionAbility is enabled. true if enabled, false otherwise.
Atomic service API: This API can be used in atomic services since API version 11.
readPermission string Yes No Permission required for reading data from the ExtensionAbility.
Atomic service API: This API can be used in atomic services since API version 11.
writePermission string Yes No Permission required for writing data to the ExtensionAbility.
Atomic service API: This API can be used in atomic services since API version 11.
extensionAbilityTypeName11+ string Yes No Type of the ExtensionAbility. For details about available values, see the type field under the extensionabilities tag.
Atomic service API: This API can be used in atomic services since API version 11.
skills12+ Array<Skill> Yes No Skills of the ExtensionAbility.
Atomic service API: This API can be used in atomic services since API version 12.
appIndex12+ number Yes No Index of an application clone. It takes effect only for cloned applications.