• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.distributedBundle (Distributed Bundle Management) (System API)
2<!--Kit: Ability Kit-->
3<!--Subsystem: BundleManager-->
4<!--Owner: @wanghang904-->
5<!--Designer: @hanfeng6-->
6<!--Tester: @kongjing2-->
7<!--Adviser: @Brilliantry_Rui-->
8
9The distributedBundle module manages distributed bundles.
10
11> **NOTE**
12>
13> 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.
14>
15> The APIs of this module are deprecated since API version 9. You are advised to use [@ohos.bundle.distributedBundleManager](js-apis-distributedBundleManager-sys.md) instead.
16>
17> The APIs provided by this module are system APIs.
18
19## Modules to Import
20
21```
22import distributedBundle from '@ohos.distributedBundle';
23```
24
25## System Capability
26
27SystemCapability.BundleManager.DistributedBundleFramework
28
29## Required Permissions
30
31| Permission                                      | APL    | Description              |
32| ------------------------------------------ | ------------ | ------------------ |
33| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all applications.|
34
35For details about the APL, see [Basic Concepts in the Permission Mechanism](../../security/AccessToken/app-permission-mgmt-overview.md#basic-concepts-in-the-permission-mechanism).
36
37## distributedBundle.getRemoteAbilityInfo<sup>deprecated<sup>
38
39> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager-sys.md) instead.
40
41getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback&lt;RemoteAbilityInfo&gt;): void
42
43Obtains the information about the remote ability that matches the given element name. This API uses an asynchronous callback to return the result.
44
45**Required permissions**
46
47ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
48
49**System capability**
50
51SystemCapability.BundleManager.DistributedBundleFramework
52
53**System API**
54
55This is a system API.
56
57**Parameters**
58
59| Name     | Type                                                        | Mandatory| Description                                              |
60| ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- |
61| elementName | [ElementName](js-apis-bundle-ElementName.md)                 | Yes  | **ElementName**.                           |
62| callback    | AsyncCallback<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo-sys.md)> | Yes  | Callback used to return the remote ability information.|
63
64
65
66## distributedBundle.getRemoteAbilityInfo<sup>deprecated<sup>
67
68> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager-sys.md) instead.
69
70getRemoteAbilityInfo(elementName: ElementName): Promise&lt;RemoteAbilityInfo&gt;
71
72Obtains the information about the remote ability that matches the given element name. This API uses a promise to return the result.
73
74**Required permissions**
75
76ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
77
78**System capability**
79
80SystemCapability.BundleManager.DistributedBundleFramework
81
82**System API**
83
84This is a system API.
85
86**Parameters**
87
88| Name     | Type                                        | Mandatory| Description                   |
89| ----------- | -------------------------------------------- | ---- | ----------------------- |
90| elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes  | **ElementName**.|
91
92**Return value**
93
94| Type                                                        | Description                             |
95| ------------------------------------------------------------ | --------------------------------- |
96| Promise\<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo-sys.md)> | Promise used to return the remote ability information.|
97
98## distributedBundle.getRemoteAbilityInfos<sup>deprecated<sup>
99
100> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager-sys.md) instead.
101
102getRemoteAbilityInfos(elementNames: Array&lt;ElementName&gt;, callback: AsyncCallback&lt;Array&lt;RemoteAbilityInfo&gt;&gt;): void
103
104Obtains the information about remote abilities that match the given element names. This API uses an asynchronous callback to return the result.
105
106**Required permissions**
107
108ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
109
110**System capability**
111
112SystemCapability.BundleManager.DistributedBundleFramework
113
114**System API**
115
116This is a system API.
117
118**Parameters**
119
120| Name      | Type                                                        | Mandatory| Description                                              |
121| ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- |
122| elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)>          | Yes  | **ElementName** array, whose maximum length is 10.                  |
123| callback     | AsyncCallback< Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo-sys.md)>> | Yes  | Callback used to return an array of the remote ability information.|
124
125
126
127## distributedBundle.getRemoteAbilityInfos<sup>deprecated<sup>
128
129> This API is deprecated since API version 9. You are advised to use [getRemoteAbilityInfo(@ohos.bundle.distributedBundleManager)](js-apis-distributedBundleManager-sys.md) instead.
130
131getRemoteAbilityInfos(elementNames: Array&lt;ElementName&gt;): Promise&lt;Array&lt;RemoteAbilityInfo&gt;&gt;
132
133Obtains the information about remote abilities that match the given element names. This API uses a promise to return the result.
134
135**Required permissions**
136
137ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
138
139**System capability**
140
141SystemCapability.BundleManager.DistributedBundleFramework
142
143**System API**
144
145This is a system API.
146
147**Parameters**
148
149| Name     | Type                                               | Mandatory| Description                 |
150| ------------ | --------------------------------------------------- | ---- | ----------------------- |
151| elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | Yes  | **ElementName** array, whose maximum length is 10.|
152
153**Return value**
154
155| Type                                                        | Description                             |
156| ------------------------------------------------------------ | --------------------------------- |
157| Promise\<Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo-sys.md)>> | Promise used to return an array of the remote ability information.|
158