• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.bundle.innerBundleManager (innerBundleManager)
2
3The **innerBundleManager** module provides APIs for the **Home Screen** application.
4
5>
6> 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.
7> This module is deprecated since API version 9. You are advised to use [launcherBundleManager](js-apis-launcherBundleManager.md) and [bundleMonitor](js-apis-bundleMonitor.md) instead.
8
9## Modules to Import
10
11```typescript
12import innerBundleManager from '@ohos.bundle.innerBundleManager';
13```
14
15## System Capability
16
17SystemCapability.BundleManager.BundleFramework
18
19
20## innerBundleManager.getLauncherAbilityInfos<sup>(deprecated)</sup>
21
22getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback&lt;Array&lt;LauncherAbilityInfo&gt;&gt;) : void;
23
24Obtains the launcher ability information based on a given bundle name. This API uses an asynchronous callback to return the result.
25> This API is deprecated since API version 9. You are advised to use [launcherBundleManager.getLauncherAbilityInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetlauncherabilityinfo9) instead.
26
27**Required permissions**
28
29ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
30
31**System capability**
32
33SystemCapability.BundleManager.BundleFramework
34
35**System API**
36
37This is a system API and cannot be called by third-party applications.
38
39**Parameters**
40
41| Name    | Type                                                        | Mandatory| Description                                      |
42| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------ |
43| bundleName | string                                                       | Yes  | Bundle name.                  |
44| userId     | number                                                       | Yes  | User ID. The value must be greater than or equal to 0.             |
45| callback   | AsyncCallback\<Array<[LauncherAbilityInfo](js-apis-bundle-LauncherAbilityInfo.md)>> | Yes  | Callback used to return an array of the launcher ability information.|
46
47
48## innerBundleManager.getLauncherAbilityInfos<sup>(deprecated)</sup>
49
50getLauncherAbilityInfos(bundleName: string, userId: number) : Promise&lt;Array&lt;LauncherAbilityInfo&gt;&gt;
51
52Obtains the launcher ability information based on a given bundle name. This API uses a promise to return the result.
53> This API is deprecated since API version 9. You are advised to use [launcherBundleManager.getLauncherAbilityInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetlauncherabilityinfo9) instead.
54
55**Required permissions**
56
57ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
58
59**System capability**
60
61SystemCapability.BundleManager.BundleFramework
62
63**System API**
64
65This is a system API and cannot be called by third-party applications.
66
67**Parameters**
68
69| Name    | Type  | Mandatory| Description                         |
70| ---------- | ------ | ---- | ----------------------------- |
71| bundleName | string | Yes  | Bundle name.     |
72| userId     | number | Yes  | User ID. The value must be greater than or equal to 0.|
73
74**Return value**
75
76| Type                                                        | Description                     |
77| ------------------------------------------------------------ | ------------------------- |
78| Promise\<Array<[LauncherAbilityInfo](js-apis-bundle-LauncherAbilityInfo.md)>> | Promise used to return an array of the launcher ability information.|
79
80## innerBundleManager.on<sup>(deprecated)</sup>
81
82on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback&lt;string&gt;) : void;
83
84Registers a callback to receive bundle status changes. This API uses an asynchronous callback to return the result.
85> This API is deprecated since API version 9. You are advised to use [bundleMonitor.on](js-apis-bundleMonitor.md#bundlemonitoron) instead.
86
87**Required permissions**
88
89ohos.permission.LISTEN_BUNDLE_CHANGE
90
91**System capability**
92
93SystemCapability.BundleManager.BundleFramework
94
95**System API**
96
97This is a system API and cannot be called by third-party applications.
98
99**Parameters**
100
101| Name             | Type                 | Mandatory| Description                                              |
102| -------------------- | --------------------- | ---- | ---------------------------------------------------- |
103| type                 | string | Yes  | Event type. Only **BundleStatusChange** is supported.            |
104| bundleStatusCallback | [BundleStatusCallback](js-apis-Bundle-BundleStatusCallback.md) | Yes  | Callback to register.                                  |
105| callback             | AsyncCallback\<string> | Yes  | Callback used to return a successful result or error information.|
106
107## innerBundleManager.on<sup>(deprecated)</sup>
108
109on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback) : Promise&lt;string&gt;
110
111Registers a callback to receive bundle status changes. This API uses a promise to return the result.
112> This API is deprecated since API version 9. You are advised to use [bundleMonitor.on](js-apis-bundleMonitor.md#bundlemonitoron) instead.
113
114**Required permissions**
115
116ohos.permission.LISTEN_BUNDLE_CHANGE
117
118**System capability**
119
120SystemCapability.BundleManager.BundleFramework
121
122**System API**
123
124This is a system API and cannot be called by third-party applications.
125
126**Parameters**
127
128| Name              | Type                                                        | Mandatory| Description                                      |
129| -------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------ |
130| type                 | string                                                       | Yes  | Event type. Only **BundleStatusChange** is supported.|
131| bundleStatusCallback | [BundleStatusCallback](js-apis-Bundle-BundleStatusCallback.md) | Yes  | Callback to register.                        |
132
133**Return value**
134
135| Type           | Description                               |
136| --------------- | ----------------------------------- |
137| Promise\<string> | Promise used to return a successful result or error information.|
138
139## innerBundleManager.off<sup>(deprecated)</sup>
140
141off(type:"BundleStatusChange", callback: AsyncCallback&lt;string&gt;) : void;
142
143Deregisters the callback that receives bundle status changes. This API uses an asynchronous callback to return the result.
144> This API is deprecated since API version 9. You are advised to use [bundleMonitor.off](js-apis-bundleMonitor.md#bundlemonitoroff) instead.
145
146**Required permissions**
147
148ohos.permission.LISTEN_BUNDLE_CHANGE
149
150**System capability**
151
152SystemCapability.BundleManager.BundleFramework
153
154**System API**
155
156This is a system API and cannot be called by third-party applications.
157
158**Parameters**
159
160| Name | Type                 | Mandatory| Description                                              |
161| -------- | --------------------- | ---- | ---------------------------------------------------- |
162| type     | string | Yes  | Event type. Only **BundleStatusChange** is supported.              |
163| callback | AsyncCallback\<string> | Yes  | Callback used to return a successful result or error information.|
164
165## innerBundleManager.off<sup>(deprecated)</sup>
166
167off(type:"BundleStatusChange") : Promise&lt;string&gt;
168
169Deregisters the callback that receives bundle status changes. This API uses a promise to return the result.
170> This API is deprecated since API version 9. You are advised to use [bundleMonitor.off](js-apis-bundleMonitor.md#bundlemonitoroff) instead.
171
172**Required permissions**
173
174ohos.permission.LISTEN_BUNDLE_CHANGE
175
176**System capability**
177
178SystemCapability.BundleManager.BundleFramework
179
180**System API**
181
182This is a system API and cannot be called by third-party applications.
183
184**Parameters**
185
186| Name| Type  | Mandatory| Description                                      |
187| ------ | ------ | ---- | ------------------------------------------ |
188| type   | string | Yes  | Event type. Only **BundleStatusChange** is supported.|
189
190**Return value**
191
192| Type           | Description                               |
193| --------------- | ----------------------------------- |
194| Promise\<string> | Promise used to return a successful result or error information.|
195
196## innerBundleManager.getAllLauncherAbilityInfos<sup>(deprecated)</sup>
197
198getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback&lt;Array&lt;LauncherAbilityInfo&gt;&gt;) : void;
199
200Obtains the information about all launcher abilities. This API uses an asynchronous callback to return the result.
201> This API is deprecated since API version 9. You are advised to use [launcherBundleManager.getAllLauncherAbilityInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetalllauncherabilityinfo9) instead.
202
203**Required permissions**
204
205ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
206
207**System capability**
208
209SystemCapability.BundleManager.BundleFramework
210
211**System API**
212
213This is a system API and cannot be called by third-party applications.
214
215**Parameters**
216
217| Name  | Type                                                        | Mandatory| Description                                                 |
218| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- |
219| userId   | number                                                       | Yes  | User ID. The value must be greater than or equal to 0.|
220| callback | AsyncCallback\<Array<[LauncherAbilityInfo](js-apis-bundle-LauncherAbilityInfo.md)>> | Yes  | Callback used to return an array of the launcher ability information.           |
221
222## innerBundleManager.getAllLauncherAbilityInfos<sup>(deprecated)</sup>
223
224getAllLauncherAbilityInfos(userId: number) : Promise&lt;Array&lt;LauncherAbilityInfo&gt;&gt;
225
226Obtains the information about all launcher abilities. This API uses a promise to return the result.
227> This API is deprecated since API version 9. You are advised to use [launcherBundleManager.getAllLauncherAbilityInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetalllauncherabilityinfo9) instead.
228
229**Required permissions**
230
231ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
232
233**System capability**
234
235SystemCapability.BundleManager.BundleFramework
236
237**System API**
238
239This is a system API and cannot be called by third-party applications.
240
241**Parameters**
242
243| Name| Type  | Mandatory| Description                                                 |
244| ------ | ------ | ---- | ----------------------------------------------------- |
245| userId | number | Yes  | User ID. The value must be greater than or equal to 0.|
246
247**Return value**
248
249| Type                                                        | Description                     |
250| ------------------------------------------------------------ | ------------------------- |
251| Promise\<Array<[LauncherAbilityInfo](js-apis-bundle-LauncherAbilityInfo.md)>> | Promise used to return an array of the launcher ability information.|
252
253## innerBundleManager.getShortcutInfos<sup>(deprecated)</sup>
254
255getShortcutInfos(bundleName :string, callback: AsyncCallback&lt;Array&lt;ShortcutInfo&gt;&gt;) : void;
256
257Obtains the shortcut information based on a given bundle name. This API uses an asynchronous callback to return the result.
258> This API is deprecated since API version 9. You are advised to use [launcherBundleManager.getShortcutInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetshortcutinfo9) instead.
259
260**Required permissions**
261
262ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
263
264**System capability**
265
266SystemCapability.BundleManager.BundleFramework
267
268**System API**
269
270This is a system API and cannot be called by third-party applications.
271
272**Parameters**
273
274| Name    | Type                                                        | Mandatory| Description                                          |
275| ---------- | ------------------------------------------------------------ | ---- | ---------------------------------------------- |
276| bundleName | string                                                       | Yes  | Bundle name.                      |
277| callback   | AsyncCallback\<Array<[ShortcutInfo](js-apis-bundle-ShortcutInfo.md)>> | Yes  | Callback used to return an array of the shortcut information.|
278
279## innerBundleManager.getShortcutInfos<sup>(deprecated)</sup>
280
281getShortcutInfos(bundleName : string) : Promise&lt;Array&lt;ShortcutInfo&gt;&gt;
282
283Obtains the shortcut information based on a given bundle name. This API uses a promise to return the result.
284> This API is deprecated since API version 9. You are advised to use [launcherBundleManager.getShortcutInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetshortcutinfo9) instead.
285
286**Required permissions**
287
288ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
289
290**System capability**
291
292SystemCapability.BundleManager.BundleFramework
293
294**System API**
295
296This is a system API and cannot be called by third-party applications.
297
298**Parameters**
299
300| Name    | Type  | Mandatory| Description                    |
301| ---------- | ------ | ---- | ------------------------ |
302| bundleName | string | Yes  | Bundle name.|
303
304**Return value**
305
306| Type                                                    | Description                         |
307| -------------------------------------------------------- | ----------------------------- |
308| Promise\<Array<[ShortcutInfo](js-apis-bundle-ShortcutInfo.md)>> | Promise used to return an array of the shortcut information.|
309