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

  • 2025-06-12
  • 浏览 (4)

@ohos.distributedBundle (Distributed Bundle Management) (System API)

The distributedBundle module manages distributed bundles.

NOTE

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

The APIs of this module are deprecated since API version 9. You are advised to use @ohos.bundle.distributedBundleManager instead.

The APIs provided by this module are system APIs.

Modules to Import

import distributedBundle from '@ohos.distributedBundle';

System Capability

SystemCapability.BundleManager.DistributedBundleFramework

Required Permissions

Permission APL Description
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED system_basic Permission to query information about all applications.

For details about the APL, see Basic Concepts in the Permission Mechanism.

distributedBundle.getRemoteAbilityInfodeprecated

This API is deprecated since API version 9. You are advised to use getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager) instead.

getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback<RemoteAbilityInfo>): void

Obtains the information about the remote ability that matches the given element name. This API uses an asynchronous callback to return the result.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.DistributedBundleFramework

System API

This is a system API.

Parameters

Name Type Mandatory Description
elementName ElementName Yes ElementName.
callback AsyncCallback<RemoteAbilityInfo> Yes Callback used to return the remote ability information.

distributedBundle.getRemoteAbilityInfodeprecated

This API is deprecated since API version 9. You are advised to use getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager) instead.

getRemoteAbilityInfo(elementName: ElementName): Promise&lt;RemoteAbilityInfo&gt;

Obtains the information about the remote ability that matches the given element name. This API uses a promise to return the result.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.DistributedBundleFramework

System API

This is a system API.

Parameters

Name Type Mandatory Description
elementName ElementName Yes ElementName.

Return value

Type Description
Promise<RemoteAbilityInfo> Promise used to return the remote ability information.

distributedBundle.getRemoteAbilityInfosdeprecated

This API is deprecated since API version 9. You are advised to use getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager) instead.

getRemoteAbilityInfos(elementNames: Array&lt;ElementName&gt;, callback: AsyncCallback&lt;Array&lt;RemoteAbilityInfo&gt;&gt;): void

Obtains the information about remote abilities that match the given element names. This API uses an asynchronous callback to return the result.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.DistributedBundleFramework

System API

This is a system API.

Parameters

Name Type Mandatory Description
elementNames Array<ElementName> Yes ElementName array, whose maximum length is 10.
callback AsyncCallback< Array<RemoteAbilityInfo>> Yes Callback used to return an array of the remote ability information.

distributedBundle.getRemoteAbilityInfosdeprecated

This API is deprecated since API version 9. You are advised to use getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager) instead.

getRemoteAbilityInfos(elementNames: Array&lt;ElementName&gt;): Promise&lt;Array&lt;RemoteAbilityInfo&gt;&gt;

Obtains the information about remote abilities that match the given element names. This API uses a promise to return the result.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.DistributedBundleFramework

System API

This is a system API.

Parameters

Name Type Mandatory Description
elementNames Array<ElementName> Yes ElementName array, whose maximum length is 10.

Return value

Type Description
Promise<Array<RemoteAbilityInfo>> Promise used to return an array of the remote ability information.

你可能感兴趣的鸿蒙文章

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

0  赞