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