harmony 鸿蒙ApplicationInfo

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

ApplicationInfo

The ApplicationInfo module defines the application information. A system application can obtain its own or others’ application information through bundleManager.getApplicationInfo. The input parameter appFlags specifies the information to be contained in the returned ApplicationInfo 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.

ApplicationInfo

System capability: SystemCapability.BundleManager.BundleFramework.Core

Name Type Readable Writable Description
name string Yes No Application name.
description string Yes No Description of the application, for example, “description”: $string: mainability_description”.
descriptionId number Yes No ID of the application description.
enabled boolean Yes No Whether the application is enabled. The default value is true.
label string Yes No Application name, for example, “label”: “$string: mainability_description”.
labelId number Yes No ID of the application label.
icon string Yes No Application icon, for example, “icon”: “$media:icon”.
iconId number Yes No ID of the application icon.
process string Yes No Process in which the application runs. If this parameter is not set, the bundle name is used.
permissions Array<string> Yes No Permissions required for accessing the application. The permissions can be obtained by passing in GET_APPLICATION_INFO_WITH_PERMISSION to the appFlags parameter of bundleManager.getApplicationInfo.
codePath string Yes No Installation directory of the application.
metadata(deprecated) Map<string, Array<Metadata>> Yes No Metadata of the application. The information can be obtained by passing in GET_APPLICATION_INFO_WITH_METADATA to the appFlags parameter of bundleManager.getApplicationInfo. NOTE
This field is deprecated since API version 10. You are advised to use metadataArray instead.
metadataArray10+ Array<ModuleMetadata> Yes No Metadata of the application. The information can be obtained by passing in GET_APPLICATION_INFO_WITH_METADATA to the appFlags parameter of bundleManager.getApplicationInfo.
removable boolean Yes No Whether the application is removable.
accessTokenId number Yes No Access token ID of the application.
uid number Yes No UID of the application.
iconResource Resource Yes No Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call getMediaContent in @ohos.resourceManager.d.ts to obtain the resource details.
labelResource Resource Yes No Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call getMediaContent in @ohos.resourceManager.d.ts to obtain the resource details.
descriptionResource Resource Yes No Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call getMediaContent in @ohos.resourceManager.d.ts to obtain the resource details.
appDistributionType string Yes No Distribution type of the application signing certificate. The options are app_gallery, enterprise, os_integration, and crowdtesting.
appProvisionType string Yes No Type of the application signing certificate file. The options are debug and release.
systemApp boolean Yes No Whether the application is a system application.
bundleType BundleType Yes No Bundle type, which can be APP (common application) or ATOMIC_SERVICE (atomic service).
debug10+ boolean Yes No Whether the application is in debugging mode. The default value is false.

ModuleMetadata10+

Describes the metadata of a module.

System capability: SystemCapability.BundleManager.BundleFramework.Core

Name Type Readable Writable Description
moduleName10+ string Yes No Module name.
metadata10+ Array<Metadata> Yes No Metadata list of the module.

你可能感兴趣的鸿蒙文章

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  赞