harmony 鸿蒙@ohos.distributedBundle (分布式包管理)(系统接口)

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

@ohos.distributedBundle (分布式包管理)(系统接口)

本模块提供分布式包的管理。

说明:

本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

从API Version 9开始,该模块不再维护,建议使用@ohos.bundle.distributedBundleManager替代。

本模块为系统接口。

导入模块

import distributedBundle from '@ohos.distributedBundle';

系统能力

SystemCapability.BundleManager.DistributedBundleFramework

权限列表

权限 权限等级 描述
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED system_basic 可查询所有应用信息。

权限等级参考权限APL等级说明

distributedBundle.getRemoteAbilityInfodeprecated

从API version 9开始不再维护,建议使用getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)替代。

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

根据给定的ElementName获取有关远程设备AbilityInfo信息,使用callback异步回调。

需要权限:

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

系统能力:

SystemCapability.BundleManager.DistributedBundleFramework

系统接口:

此接口为系统接口。

参数:

参数名 类型 必填 说明
elementName ElementName 获得的ElementName信息。
callback AsyncCallback<RemoteAbilityInfo> 程序启动作为入参的回调函数,返回远程基本能力信息。

distributedBundle.getRemoteAbilityInfodeprecated

从API version 9开始不再维护,建议使用getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)替代。

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

根据给定的ElementName获取有关远程设备AbilityInfo信息,使用Promise异步回调。

需要权限:

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

系统能力:

SystemCapability.BundleManager.DistributedBundleFramework

系统接口:

此接口为系统接口。

参数:

参数名 类型 必填 说明
elementName ElementName 获得的ElementName信息。

返回值:

类型 说明
Promise<RemoteAbilityInfo> Promise形式返回远程基本能力信息。

distributedBundle.getRemoteAbilityInfosdeprecated

从API version 9开始不再维护,建议使用getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)替代。

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

根据给定的ElementName获取有关远程设备AbilityInfos信息,使用callback异步回调。

需要权限:

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

系统能力:

SystemCapability.BundleManager.DistributedBundleFramework

系统接口:

此接口为系统接口。

参数:

参数名 类型 必填 说明
elementNames Array<ElementName> ElementName信息,最大数组长度为10。
callback AsyncCallback< Array<RemoteAbilityInfo>> 程序启动作为入参的回调函数,返回远程基本能力信息。

distributedBundle.getRemoteAbilityInfosdeprecated

从API version 9开始不再维护,建议使用getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)替代。

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

根据给定的ElementName获取有关远程设备AbilityInfos信息,使用Promise异步回调。

需要权限:

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

系统能力:

SystemCapability.BundleManager.DistributedBundleFramework

系统接口:

此接口为系统接口。

参数:

参数名 类型 必填 说明
elementNames Array<ElementName> ElementName信息,最大数组长度为10。

返回值:

类型 说明
Promise<Array<RemoteAbilityInfo>> Promise形式返回远程基本能力信息。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit(程序框架服务)

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_base_common.h

harmony 鸿蒙ability_runtime_common.h

harmony 鸿蒙application_context.h

0  赞