• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit MDMKit
19 */
20
21import type { AsyncCallback } from './@ohos.base';
22import type Want from './@ohos.app.ability.Want';
23
24/**
25 * This module provides the capability to manage the bundles of the enterprise devices.
26 *
27 * @namespace bundleManager
28 * @syscap SystemCapability.Customization.EnterpriseDeviceManager
29 * @since 10
30 */
31declare namespace bundleManager {
32  /**
33   * Provides parameters required for installing an application.
34   *
35   * @typedef InstallParam
36   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
37   * @StageModelOnly
38   * @since 12
39   */
40  interface InstallParam {
41    /**
42     * Indicates the user id
43     *
44     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
45     * @StageModelOnly
46     * @since 12
47     */
48    userId?: number;
49
50    /**
51     * Indicates the install flag, which 0 for first install, 1 for cover install
52     *
53     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
54     * @StageModelOnly
55     * @since 12
56     */
57    installFlag?: number;
58  }
59
60  /**
61   * Add appid list of bundles that can be installed in the device.
62   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
63   *
64   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
65   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
66   *                         The admin must have the corresponding permission.
67   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
68   *                                   setting cannot be greater than 200.
69   * @param { AsyncCallback<void> } callback - the callback of addAllowedInstallBundles.
70   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
71   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
72   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
73   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
74   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
75   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
76   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
77   * @systemapi
78   * @StageModelOnly
79   * @since 10
80   */
81  function addAllowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
82
83  /**
84   * Add appid list of bundles that can be installed in the device.
85   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
86   *
87   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
88   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
89   *                         The admin must have the corresponding permission.
90   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
91   *                                   setting cannot be greater than 200.
92   * @param { number } userId - userId indicates the user ID.
93   * @param { AsyncCallback<void> } callback - the callback of addAllowedInstallBundles.
94   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
95   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
96   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
97   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
98   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
99   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
100   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
101   * @systemapi
102   * @StageModelOnly
103   * @since 10
104   */
105  function addAllowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
106
107  /**
108   * Add appid list of bundles that can be installed in the device.
109   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
110   *
111   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
112   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
113   *                         The admin must have the corresponding permission.
114   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
115   *                                   setting cannot be greater than 200.
116   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
117   * @returns { Promise<void> } the promise returned by the addAllowedInstallBundles.
118   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
119   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
120   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
121   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
122   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
123   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
124   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
125   * @systemapi
126   * @StageModelOnly
127   * @since 10
128   */
129  function addAllowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
130
131  /**
132   * Add appid list of bundles that can be installed in the device.
133   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
134   *
135   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
136   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
137   *                         The admin must have the corresponding permission.
138   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
139   *                                   setting cannot be greater than 200.
140   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
141   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
142   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
143   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
144   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
145   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
146   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
147   * @StageModelOnly
148   * @since 12
149   */
150  function addAllowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
151
152  /**
153   * Remove appid list of bundles that can be installed in the device.
154   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
155   *
156   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
157   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
158   *                         The admin must have the corresponding permission.
159   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
160   *                                   setting cannot be greater than 200.
161   * @param { AsyncCallback<void> } callback - the callback of removeAllowedInstallBundles.
162   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
163   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
164   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
165   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
166   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
167   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
168   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
169   * @systemapi
170   * @StageModelOnly
171   * @since 10
172   */
173  function removeAllowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
174
175  /**
176   * Remove appid list of bundles that can be installed in the device.
177   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
178   *
179   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
180   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
181   *                         The admin must have the corresponding permission.
182   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
183   *                                   setting cannot be greater than 200.
184   * @param { number } userId - userId indicates the user ID.
185   * @param { AsyncCallback<void> } callback - the callback of removeAllowedInstallBundles.
186   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
187   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
188   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
189   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
190   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
191   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
192   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
193   * @systemapi
194   * @StageModelOnly
195   * @since 10
196   */
197  function removeAllowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
198
199  /**
200   * Remove appid list of bundles that can be installed in the device.
201   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
202   *
203   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
204   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
205   *                         The admin must have the corresponding permission.
206   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
207   *                                   setting cannot be greater than 200.
208   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
209   * @returns { Promise<void> } the promise returned by the removeAllowedInstallBundles.
210   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
211   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
212   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
213   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
214   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
215   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
216   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
217   * @systemapi
218   * @StageModelOnly
219   * @since 10
220   */
221  function removeAllowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
222
223  /**
224   * Remove appid list of bundles that can be installed in the device.
225   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
226   *
227   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
228   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
229   *                         The admin must have the corresponding permission.
230   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
231   *                                   setting cannot be greater than 200.
232   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
233   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
234   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
235   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
236   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
237   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
238   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
239   * @StageModelOnly
240   * @since 12
241   */
242  function removeAllowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
243
244  /**
245   * Get the appid list of bundles that can be installed in the device.
246   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
247   *
248   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
249   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
250   *                         The admin must have the corresponding permission.
251   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
252   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
253   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
254   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
255   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
256   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
257   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
258   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
259   * @systemapi
260   * @StageModelOnly
261   * @since 10
262   */
263  function getAllowedInstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void;
264
265  /**
266   * Get the appid list of bundles that can be installed in the device.
267   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
268   *
269   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
270   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
271   *                         The admin must have the corresponding permission.
272   * @param { number } userId - userId indicates the user ID.
273   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
274   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
275   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
276   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
277   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
278   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
279   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
280   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
281   * @systemapi
282   * @StageModelOnly
283   * @since 10
284   */
285  function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void;
286
287  /**
288   * Get appid list of bundles that can be installed in the device.
289   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
290   *
291   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
292   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
293   *                         The admin must have the corresponding permission.
294   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
295   * @returns { Promise<Array<string>> } the promise that contains the appid list.
296   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
297   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
298   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
299   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
300   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
301   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
302   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
303   * @systemapi
304   * @StageModelOnly
305   * @since 10
306   */
307  function getAllowedInstallBundles(admin: Want, userId?: number): Promise<Array<string>>;
308
309  /**
310   * Get appid list of bundles that can be installed in the device.
311   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
312   *
313   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
314   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
315   *                         The admin must have the corresponding permission.
316   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
317   * @returns { Array<string> } ids of the bundle that can be installed.
318   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
319   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
320   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
321   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
322   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
323   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
324   * @StageModelOnly
325   * @since 12
326   */
327  function getAllowedInstallBundlesSync(admin: Want, accountId?: number): Array<string>;
328
329  /**
330   * Add appid list of bundles that can not be installed in the device.
331   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
332   *
333   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
334   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
335   *                         The admin must have the corresponding permission.
336   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
337   *                                   setting cannot be greater than 200.
338   * @param { AsyncCallback<void> } callback - the callback of addDisallowedInstallBundles.
339   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
340   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
341   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
342   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
343   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
344   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
345   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
346   * @systemapi
347   * @StageModelOnly
348   * @since 10
349   */
350  function addDisallowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
351
352  /**
353   * Add appid list of bundles that can not be installed in the device.
354   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
355   *
356   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
357   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
358   *                         The admin must have the corresponding permission.
359   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
360   *                                   setting cannot be greater than 200.
361   * @param { number } userId - userId indicates the user ID.
362   * @param { AsyncCallback<void> } callback - the callback of addDisallowedInstallBundles.
363   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
364   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
365   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
366   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
367   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
368   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
369   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
370   * @systemapi
371   * @StageModelOnly
372   * @since 10
373   */
374  function addDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
375
376  /**
377   * Add appid list of bundles that can not be installed in the device.
378   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
379   *
380   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
381   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
382   *                         The admin must have the corresponding permission.
383   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
384   *                                   setting cannot be greater than 200.
385   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
386   * @returns { Promise<void> } the promise returned by the addDisallowedInstallBundles.
387   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
388   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
389   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
390   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
391   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
392   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
393   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
394   * @systemapi
395   * @StageModelOnly
396   * @since 10
397   */
398  function addDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
399
400  /**
401   * Add appid list of bundles that can not be installed in the device.
402   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
403   *
404   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
405   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
406   *                         The admin must have the corresponding permission.
407   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
408   *                                   setting cannot be greater than 200.
409   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
410   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
411   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
412   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
413   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
414   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
415   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
416   * @StageModelOnly
417   * @since 12
418   */
419  function addDisallowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
420
421  /**
422   * Remove appid list of bundles that can not be installed in the device.
423   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
424   *
425   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
426   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
427   *                         The admin must have the corresponding permission.
428   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
429   *                                   setting cannot be greater than 200.
430   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedInstallBundles.
431   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
432   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
433   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
434   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
435   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
436   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
437   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
438   * @systemapi
439   * @StageModelOnly
440   * @since 10
441   */
442  function removeDisallowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
443
444  /**
445   * Remove appid list of bundles that can not be installed in the device.
446   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
447   *
448   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
449   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
450   *                         The admin must have the corresponding permission.
451   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
452   *                                   setting cannot be greater than 200.
453   * @param { number } userId - userId indicates the user ID.
454   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedInstallBundles.
455   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
456   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
457   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
458   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
459   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
460   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
461   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
462   * @systemapi
463   * @StageModelOnly
464   * @since 10
465   */
466  function removeDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
467
468  /**
469   * Remove appid list of bundles that can not be installed in the device.
470   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
471   *
472   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
473   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
474   *                         The admin must have the corresponding permission.
475   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
476   *                                   setting cannot be greater than 200.
477   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
478   * @returns { Promise<void> } the promise returned by the removeDisallowedInstallBundles.
479   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
480   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
481   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
482   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
483   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
484   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
485   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
486   * @systemapi
487   * @StageModelOnly
488   * @since 10
489   */
490  function removeDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
491
492  /**
493   * Remove appid list of bundles that can not be installed in the device.
494   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
495   *
496   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
497   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
498   *                         The admin must have the corresponding permission.
499   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
500   *                                   setting cannot be greater than 200.
501   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
502   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
503   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
504   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
505   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
506   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
507   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
508   * @StageModelOnly
509   * @since 12
510   */
511  function removeDisallowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
512
513  /**
514   * Get the appid list of bundles that can not be installed in the device.
515   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
516   *
517   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
518   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
519   *                         The admin must have the corresponding permission.
520   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
521   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
522   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
523   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
524   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
525   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
526   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
527   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
528   * @systemapi
529   * @StageModelOnly
530   * @since 10
531   */
532  function getDisallowedInstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void;
533
534  /**
535   * Get the appid list of bundles that can not be installed in the device.
536   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
537   *
538   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
539   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
540   *                         The admin must have the corresponding permission.
541   * @param { number } userId - userId indicates the user ID.
542   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
543   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
544   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
545   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
546   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
547   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
548   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
549   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
550   * @systemapi
551   * @StageModelOnly
552   * @since 10
553   */
554  function getDisallowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void;
555
556  /**
557   * Get appid list of bundles that can not be installed in the device.
558   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
559   *
560   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
561   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
562   *                         The admin must have the corresponding permission.
563   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
564   * @returns { Promise<Array<string>> } the promise that contains the appid list.
565   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
566   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
567   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
568   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
569   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
570   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
571   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
572   * @systemapi
573   * @StageModelOnly
574   * @since 10
575   */
576  function getDisallowedInstallBundles(admin: Want, userId?: number): Promise<Array<string>>;
577
578  /**
579   * Get appid list of bundles that can not be installed in the device.
580   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
581   *
582   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
583   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
584   *                         The admin must have the corresponding permission.
585   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
586   * @returns { Array<string> } ids of the bundle that can not be installed.
587   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
588   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
589   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
590   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
591   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
592   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
593   * @StageModelOnly
594   * @since 12
595   */
596  function getDisallowedInstallBundlesSync(admin: Want, accountId?: number): Array<string>;
597
598  /**
599   * Add appid list of bundles that can not be uninstalled in the device.
600   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
601   *
602   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
603   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
604   *                         The admin must have the corresponding permission.
605   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
606   *                                   setting cannot be greater than 200.
607   * @param { AsyncCallback<void> } callback - the callback of addDisallowedUninstallBundles.
608   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
609   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
610   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
611   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
612   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
613   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
614   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
615   * @systemapi
616   * @StageModelOnly
617   * @since 10
618   */
619  function addDisallowedUninstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
620
621  /**
622   * Add appid list of bundles that can not be uninstalled in the device.
623   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
624   *
625   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
626   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
627   *                         The admin must have the corresponding permission.
628   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
629   *                                   setting cannot be greater than 200.
630   * @param { number } userId - userId indicates the user ID.
631   * @param { AsyncCallback<void> } callback - the callback of addDisallowedUninstallBundles.
632   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
633   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
634   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
635   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
636   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
637   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
638   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
639   * @systemapi
640   * @StageModelOnly
641   * @since 10
642   */
643  function addDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
644
645  /**
646   * Add appid list of bundles that can not be uninstalled in the device.
647   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
648   *
649   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
650   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
651   *                         The admin must have the corresponding permission.
652   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
653   *                                   setting cannot be greater than 200.
654   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
655   * @returns { Promise<void> } the promise returned by the addDisallowedUninstallBundles.
656   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
657   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
658   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
659   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
660   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
661   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
662   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
663   * @systemapi
664   * @StageModelOnly
665   * @since 10
666   */
667  function addDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
668
669  /**
670   * Add appid list of bundles that can not be uninstalled in the device.
671   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
672   *
673   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
674   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
675   *                         The admin must have the corresponding permission.
676   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
677   *                                   setting cannot be greater than 200.
678   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
679   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
680   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
681   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
682   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
683   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
684   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
685   * @StageModelOnly
686   * @since 12
687   */
688  function addDisallowedUninstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
689
690  /**
691   * Remove appid list of bundles that can not be uninstalled in the device.
692   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
693   *
694   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
695   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
696   *                         The admin must have the corresponding permission.
697   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
698   *                                   setting cannot be greater than 200.
699   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedUninstallBundles.
700   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
701   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
702   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
703   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
704   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
705   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
706   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
707   * @systemapi
708   * @StageModelOnly
709   * @since 10
710   */
711  function removeDisallowedUninstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
712
713  /**
714   * Remove appid list of bundles that can not be uninstalled in the device.
715   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
716   *
717   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
718   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
719   *                         The admin must have the corresponding permission.
720   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
721   *                                   setting cannot be greater than 200.
722   * @param { number } userId - userId indicates the user ID.
723   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedUninstallBundles.
724   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
725   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
726   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
727   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
728   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
729   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
730   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
731   * @systemapi
732   * @StageModelOnly
733   * @since 10
734   */
735  function removeDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
736
737  /**
738   * Remove appid list of bundles that can not be uninstalled in the device.
739   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
740   *
741   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
742   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
743   *                         The admin must have the corresponding permission.
744   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
745   *                                   setting cannot be greater than 200.
746   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
747   * @returns { Promise<void> } the promise returned by the removeDisallowedUninstallBundles.
748   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
749   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
750   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
751   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
752   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
753   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
754   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
755   * @systemapi
756   * @StageModelOnly
757   * @since 10
758   */
759  function removeDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
760
761  /**
762   * Remove appid list of bundles that can not be uninstalled in the device.
763   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
764   *
765   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
766   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
767   *                         The admin must have the corresponding permission.
768   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
769   *                                   setting cannot be greater than 200.
770   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
771   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
772   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
773   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
774   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
775   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
776   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
777   * @StageModelOnly
778   * @since 12
779   */
780  function removeDisallowedUninstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
781
782  /**
783   * Get the appid list of bundles that can not be uninstalled in the device.
784   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
785   *
786   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
787   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
788   *                         The admin must have the corresponding permission.
789   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
790   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
791   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
792   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
793   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
794   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
795   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
796   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
797   * @systemapi
798   * @StageModelOnly
799   * @since 10
800   */
801  function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void;
802
803  /**
804   * Get the appid list of bundles that can not be uninstalled in the device.
805   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
806   *
807   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
808   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
809   *                         The admin must have the corresponding permission.
810   * @param { number } userId - userId indicates the user ID.
811   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
812   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
813   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
814   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
815   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
816   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
817   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
818   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
819   * @systemapi
820   * @StageModelOnly
821   * @since 10
822   */
823  function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void;
824
825  /**
826   * Get appid list of bundles that can not be uninstalled in the device.
827   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
828   *
829   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
830   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
831   *                         The admin must have the corresponding permission.
832   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
833   * @returns { Promise<Array<string>> } the promise that contains the appid list.
834   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
835   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
836   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
837   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
838   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
839   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
840   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
841   * @systemapi
842   * @StageModelOnly
843   * @since 10
844   */
845  function getDisallowedUninstallBundles(admin: Want, userId?: number): Promise<Array<string>>;
846
847  /**
848   * Get appid list of bundles that can not be uninstalled in the device.
849   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
850   *
851   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
852   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
853   *                         The admin must have the corresponding permission.
854   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
855   * @returns { Array<string> } ids of the bundle that can not be uninstalled.
856   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
857   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
858   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
859   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
860   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
861   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
862   * @StageModelOnly
863   * @since 12
864   */
865  function getDisallowedUninstallBundlesSync(admin: Want, accountId?: number): Array<string>;
866
867  /**
868   * Uninstall an application.
869   *
870   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
871   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
872   *                         The admin must have the corresponding permission.
873   * @param { string } bundleName - indicates the bundle name of the application to be uninstalled.
874   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
875   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
876   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
877   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
878   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
879   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
880   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
881   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
882   * @systemapi
883   * @StageModelOnly
884   * @since 10
885   */
886  function uninstall(admin: Want, bundleName: string, callback: AsyncCallback<void>): void;
887
888  /**
889   * Uninstall an application.
890   *
891   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
892   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
893   *                         The admin must have the corresponding permission.
894   * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
895   * @param { number } userId - userId indicates the user ID or do not pass user ID.
896   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
897   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
898   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
899   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
900   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
901   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
902   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
903   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
904   * @systemapi
905   * @StageModelOnly
906   * @since 10
907   */
908  function uninstall(admin: Want, bundleName: string, userId: number, callback: AsyncCallback<void>): void;
909
910  /**
911   * Uninstall an application.
912   *
913   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
914   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
915   *                         The admin must have the corresponding permission.
916   * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
917   * @param { boolean } isKeepData - isKeepData indicates whether keep the data.
918   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
919   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
920   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
921   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
922   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
923   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
924   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
925   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
926   * @systemapi
927   * @StageModelOnly
928   * @since 10
929   */
930  function uninstall(admin: Want, bundleName: string, isKeepData: boolean, callback: AsyncCallback<void>): void;
931
932  /**
933   * Uninstall an application.
934   *
935   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
936   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
937   *                         The admin must have the corresponding permission.
938   * @param { string } bundleName - indicates the bundle name of the application to be uninstalled.
939   * @param { number } userId - userId indicates the user ID or do not pass user ID.
940   * @param { boolean } isKeepData - isKeepData indicates whether keep the data.
941   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
942   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
943   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
944   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
945   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
946   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
947   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
948   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
949   * @systemapi
950   * @StageModelOnly
951   * @since 10
952   */
953  function uninstall(admin: Want, bundleName: string, userId: number, isKeepData: boolean, callback: AsyncCallback<void>): void;
954
955  /**
956   * Uninstall an application.
957   *
958   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
959   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
960   *                         The admin must have the corresponding permission.
961   * @param { string } bundleName - indicates the bundle name of the application to be uninstalled.
962   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
963   * @param { boolean } [isKeepData] - isKeepData indicates whether keep the data.
964   * @returns { Promise<void> } the promise of uninstalling application result.
965   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
966   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
967   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
968   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
969   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
970   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
971   * @StageModelOnly
972   * @since 12
973   */
974  function uninstall(admin: Want, bundleName: string, userId?: number, isKeepData?: boolean): Promise<void>;
975
976  /**
977   * Install an application.
978   *
979   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
980   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
981   *                         The admin must have the corresponding permission.
982   * @param { Array<string> } hapFilePaths - indicates the path of the application to be installed.
983   * @param { AsyncCallback<void> } callback - the callback of installing application result.
984   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
985   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
986   * @throws { BusinessError } 9201002 - Failed to install the application.
987   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
988   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
989   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
990   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
991   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
992   * @systemapi
993   * @StageModelOnly
994   * @since 10
995   */
996  function install(admin: Want, hapFilePaths: Array<string>, callback: AsyncCallback<void>): void;
997
998  /**
999   * Install an application.
1000   *
1001   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1002   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1003   *                         The admin must have the corresponding permission.
1004   * @param { Array<string> } hapFilePaths - indicates the path of the application to be installed.
1005   * @param { InstallParam } installParam - installParam indicates the installation parameters.
1006   *                                        It may contain two fields: userId and installFlag.
1007   *                                        The flag can only be one of correct flags.
1008   * @param { AsyncCallback<void> } callback - the callback of installing application result.
1009   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1010   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1011   * @throws { BusinessError } 9201002 - Failed to install the application.
1012   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1013   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1014   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1015   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1016   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1017   * @systemapi
1018   * @StageModelOnly
1019   * @since 10
1020   */
1021  function install(admin: Want, hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void;
1022
1023  /**
1024   * Install an application.
1025   *
1026   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1027   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1028   *                         The admin must have the corresponding permission.
1029   * @param { Array<string> } hapFilePaths - indicates the path of the application to be installed.
1030   * @param { InstallParam } [installParam] - installParam indicates the installation parameters.
1031   *                                        It may contain two fields: userId and installFlag.
1032   *                                        The flag can only be one of correct flags.
1033   * @returns { Promise<void> } the promise of installing application result.
1034   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1035   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1036   * @throws { BusinessError } 9201002 - Failed to install the application.
1037   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1038   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1039   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1040   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1041   * @StageModelOnly
1042   * @since 12
1043   */
1044  function install(admin: Want, hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>;
1045}
1046
1047export default bundleManager;
1048