• 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     * Indicates parameters
63     *
64     * @type { ?Record<string, string> }
65     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
66     * @stagemodelonly
67     * @since 19
68     */
69    parameters?: Record<string, string>;
70  }
71
72  /**
73   * Contains resource descriptor information.
74   *
75   * @typedef Resource
76   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
77   * @stagemodelonly
78   * @since 20
79   */
80  interface Resource {
81    /**
82     * Bundle name in hap
83     *
84     * @type { string }
85     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
86     * @stagemodelonly
87     * @since 20
88     */
89    bundleName: string;
90
91    /**
92     * Module name in hap
93     *
94     * @type { string }
95     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
96     * @stagemodelonly
97     * @since 20
98     */
99    moduleName: string;
100
101    /**
102     * Resource id in hap
103     *
104     * @type { number }
105     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
106     * @stagemodelonly
107     * @since 20
108     */
109    id: number;
110  }
111
112  /**
113   * Obtains configuration information about a bundle
114   *
115   * @typedef BundleInfo
116   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
117   * @stagemodelonly
118   * @since 20
119   */
120  interface BundleInfo {
121    /**
122     * Indicates the name of this bundle
123     *
124     * @type { string }
125     * @readonly
126     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
127     * @stagemodelonly
128     * @since 20
129     */
130    readonly name: string;
131
132    /**
133     * Indicates the bundle vendor
134     *
135     * @type { string }
136     * @readonly
137     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
138     * @stagemodelonly
139     * @since 20
140     */
141    readonly vendor: string;
142
143    /**
144     * Indicates the version code of the bundle
145     *
146     * @type { number }
147     * @readonly
148     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
149     * @stagemodelonly
150     * @since 20
151     */
152    readonly versionCode: number;
153
154    /**
155     * Indicates the version name of the bundle
156     *
157     * @type { string }
158     * @readonly
159     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
160     * @stagemodelonly
161     * @since 20
162     */
163    readonly versionName: string;
164
165    /**
166     * Indicates the minimum version compatible with the bundle
167     *
168     * @type { number }
169     * @readonly
170     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
171     * @stagemodelonly
172     * @since 20
173     */
174    readonly minCompatibleVersionCode: number;
175
176    /**
177     * Indicates the target version number of the bundle
178     *
179     * @type { number }
180     * @readonly
181     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
182     * @stagemodelonly
183     * @since 20
184     */
185    readonly targetVersion: number;
186
187    /**
188     * Obtains configuration information about an application
189     *
190     * @type { ApplicationInfo }
191     * @readonly
192     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
193     * @stagemodelonly
194     * @since 20
195     */
196    readonly appInfo: ApplicationInfo;
197
198    /**
199     * Indicates the SignatureInfo of the bundle
200     *
201     * @type { SignatureInfo }
202     * @readonly
203     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
204     * @stagemodelonly
205     * @since 20
206     */
207    readonly signatureInfo: SignatureInfo;
208
209    /**
210     * Indicates the hap install time
211     *
212     * @type { number }
213     * @readonly
214     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
215     * @stagemodelonly
216     * @since 20
217     */
218    readonly installTime: number;
219
220    /**
221     * Indicates the hap update time
222     *
223     * @type { number }
224     * @readonly
225     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
226     * @stagemodelonly
227     * @since 20
228     */
229    readonly updateTime: number;
230
231    /**
232     * Indicates the appIndex of application, only work in appClone mode
233     *
234     * @type { number }
235     * @readonly
236     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
237     * @stagemodelonly
238     * @since 20
239     */
240    readonly appIndex: number;
241
242    /**
243     * Indicates the hap first install time
244     *
245     * @type { ?number }
246     * @readonly
247     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
248     * @stagemodelonly
249     * @since 20
250     */
251    readonly firstInstallTime?: number;
252  }
253
254  /**
255   * Indicates SignatureInfo
256   *
257   * @typedef SignatureInfo
258   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
259   * @stagemodelonly
260   * @since 20
261   */
262  interface SignatureInfo {
263    /**
264     * Indicates the ID of the application to which this bundle belongs
265     * The application ID uniquely identifies an application. It is determined by the bundle name and signature
266     *
267     * @type { string }
268     * @readonly
269     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
270     * @stagemodelonly
271     * @since 20
272     */
273    readonly appId: string;
274
275    /**
276     * Indicates the fingerprint of the certificate
277     *
278     * @type { string }
279     * @readonly
280     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
281     * @stagemodelonly
282     * @since 20
283     */
284    readonly fingerprint: string;
285
286    /**
287     * Globally unique identifier of an application, which is allocated by the cloud.
288     * AppIdentifier does not change along the application lifecycle, including version updates, certificate changes,
289     * public and private key changes, and application transfer.
290     *
291     * @type { string }
292     * @readonly
293     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
294     * @stagemodelonly
295     * @since 20
296     */
297    readonly appIdentifier: string;
298
299    /**
300     * Indicates the certificate
301     *
302     * @type { ?string }
303     * @readonly
304     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
305     * @stagemodelonly
306     * @since 20
307     */
308    readonly certificate?: string;
309  }
310
311  /**
312   * Obtains configuration information about an application
313   *
314   * @typedef ApplicationInfo
315   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
316   * @stagemodelonly
317   * @since 20
318   */
319  interface ApplicationInfo {
320    /**
321     * Indicates the application name, which is the same as {@code bundleName}
322     *
323     * @type { string }
324     * @readonly
325     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
326     * @stagemodelonly
327     * @since 20
328     */
329    readonly name: string;
330
331    /**
332     * Description of application
333     *
334     * @type { string }
335     * @readonly
336     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
337     * @stagemodelonly
338     * @since 20
339     */
340    readonly description: string;
341
342    /**
343     * Indicates the description id of the application
344     *
345     * @type { number }
346     * @readonly
347     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
348     * @stagemodelonly
349     * @since 20
350     */
351    readonly descriptionId: number;
352
353    /**
354     * Indicates whether or not this application may be instantiated
355     *
356     * @type { boolean }
357     * @readonly
358     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
359     * @stagemodelonly
360     * @since 20
361     */
362    readonly enabled: boolean;
363
364    /**
365     * Indicates the label of the application
366     *
367     * @type { string }
368     * @readonly
369     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
370     * @stagemodelonly
371     * @since 20
372     */
373    readonly label: string;
374
375    /**
376     * Indicates the label id of the application
377     *
378     * @type { number }
379     * @readonly
380     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
381     * @stagemodelonly
382     * @since 20
383     */
384    readonly labelId: number;
385
386    /**
387     * Indicates the icon of the application
388     *
389     * @type { string }
390     * @readonly
391     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
392     * @stagemodelonly
393     * @since 20
394     */
395    readonly icon: string;
396
397    /**
398     * Indicates the icon id of the application
399     *
400     * @type { number }
401     * @readonly
402     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
403     * @stagemodelonly
404     * @since 20
405     */
406    readonly iconId: number;
407
408    /**
409     * Process of application, if user do not set it ,the value equal bundleName
410     *
411     * @type { string }
412     * @readonly
413     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
414     * @stagemodelonly
415     * @since 20
416     */
417    readonly process: string;
418
419    /**
420     * Indicates the application source code path
421     *
422     * @type { string }
423     * @readonly
424     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
425     * @stagemodelonly
426     * @since 20
427     */
428    readonly codePath: string;
429
430    /**
431     * Indicates whether or not this application may be removable
432     *
433     * @type { boolean }
434     * @readonly
435     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
436     * @stagemodelonly
437     * @since 20
438     */
439    readonly removable: boolean;
440
441    /**
442     * Indicates the access token of the application
443     *
444     * @type { number }
445     * @readonly
446     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
447     * @stagemodelonly
448     * @since 20
449     */
450    readonly accessTokenId: number;
451
452    /**
453     * Indicates the uid of the application
454     *
455     * @type { number }
456     * @readonly
457     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
458     * @stagemodelonly
459     * @since 20
460     */
461    readonly uid: number;
462
463    /**
464     * Indicates icon resource of the application
465     *
466     * @type { Resource }
467     * @readonly
468     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
469     * @stagemodelonly
470     * @since 20
471     */
472    readonly iconResource: Resource;
473
474    /**
475     * Indicates label resource of the application
476     *
477     * @type { Resource }
478     * @readonly
479     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
480     * @stagemodelonly
481     * @since 20
482     */
483    readonly labelResource: Resource;
484
485    /**
486     * Indicates description resource of the application
487     *
488     * @type { Resource }
489     * @readonly
490     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
491     * @stagemodelonly
492     * @since 20
493     */
494    readonly descriptionResource: Resource;
495
496    /**
497     * Indicates the appDistributionType of the application
498     *
499     * @type { string }
500     * @readonly
501     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
502     * @stagemodelonly
503     * @since 20
504     */
505    readonly appDistributionType: string;
506
507    /**
508     * Indicates the appProvisionType of the application
509     *
510     * @type { string }
511     * @readonly
512     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
513     * @stagemodelonly
514     * @since 20
515     */
516    readonly appProvisionType: string;
517
518    /**
519     * Indicates whether the application is a system application
520     *
521     * @type { boolean }
522     * @readonly
523     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
524     * @stagemodelonly
525     * @since 20
526     */
527    readonly systemApp: boolean;
528
529    /**
530     * Indicates whether the application is in debug mode.
531     *
532     * @type { boolean }
533     * @readonly
534     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
535     * @stagemodelonly
536     * @since 20
537     */
538    readonly debug: boolean;
539
540    /**
541     * Indicates whether the application data is unclearable, that is, whether the application data cannot be cleared.
542     *
543     * @type { boolean }
544     * @readonly
545     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
546     * @stagemodelonly
547     * @since 20
548     */
549    readonly dataUnclearable: boolean;
550
551    /**
552     * Indicates native library path.
553     *
554     * @type { string }
555     * @readonly
556     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
557     * @stagemodelonly
558     * @since 20
559     */
560    readonly nativeLibraryPath: string;
561
562    /**
563     * Indicates the index of the bundle
564     *
565     * @type { number }
566     * @readonly
567     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
568     * @stagemodelonly
569     * @since 20
570     */
571    readonly appIndex: number;
572
573    /**
574     * Indicates sources to install the app
575     *
576     * @type { string }
577     * @readonly
578     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
579     * @stagemodelonly
580     * @since 20
581     */
582    readonly installSource: string;
583
584    /**
585     * Indicates the release type of the app
586     *
587     * @type { string }
588     * @readonly
589     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
590     * @stagemodelonly
591     * @since 20
592     */
593    readonly releaseType: string;
594  }
595
596  /**
597   * Add appid list of bundles that can be installed in the device.
598   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
599   *
600   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
601   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
602   *                         The admin must have the corresponding permission.
603   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
604   *                                   setting cannot be greater than 200.
605   * @param { AsyncCallback<void> } callback - the callback of addAllowedInstallBundles.
606   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
607   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
608   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
609   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
610   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
611   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
612   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
613   * @systemapi
614   * @StageModelOnly
615   * @since 10
616   */
617  function addAllowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
618
619  /**
620   * Add appid list of bundles that can be installed in the device.
621   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
622   *
623   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
624   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
625   *                         The admin must have the corresponding permission.
626   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
627   *                                   setting cannot be greater than 200.
628   * @param { number } userId - userId indicates the user ID.
629   * @param { AsyncCallback<void> } callback - the callback of addAllowedInstallBundles.
630   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
631   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
632   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
633   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
634   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
635   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
636   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
637   * @systemapi
638   * @StageModelOnly
639   * @since 10
640   */
641  function addAllowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
642
643  /**
644   * Add appid list of bundles that can be installed in the device.
645   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
646   *
647   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
648   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
649   *                         The admin must have the corresponding permission.
650   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
651   *                                   setting cannot be greater than 200.
652   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
653   * @returns { Promise<void> } the promise returned by the addAllowedInstallBundles.
654   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
655   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
656   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
657   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
658   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
659   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
660   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
661   * @systemapi
662   * @StageModelOnly
663   * @since 10
664   */
665  function addAllowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
666
667  /**
668   * Add appid list of bundles that can be installed in the device.
669   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
670   *
671   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
672   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
673   *                         The admin must have the corresponding permission.
674   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
675   *                                   setting cannot be greater than 200.
676   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
677   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
678   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
679   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
680   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
681   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
682   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
683   * @StageModelOnly
684   * @since 12
685   */
686  function addAllowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
687
688  /**
689   * Remove appid list of bundles that can be installed in the device.
690   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
691   *
692   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
693   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
694   *                         The admin must have the corresponding permission.
695   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
696   *                                   setting cannot be greater than 200.
697   * @param { AsyncCallback<void> } callback - the callback of removeAllowedInstallBundles.
698   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
699   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
700   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
701   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
702   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
703   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
704   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
705   * @systemapi
706   * @StageModelOnly
707   * @since 10
708   */
709  function removeAllowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
710
711  /**
712   * Remove appid list of bundles that can be installed in the device.
713   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
714   *
715   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
716   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
717   *                         The admin must have the corresponding permission.
718   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
719   *                                   setting cannot be greater than 200.
720   * @param { number } userId - userId indicates the user ID.
721   * @param { AsyncCallback<void> } callback - the callback of removeAllowedInstallBundles.
722   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
723   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
724   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
725   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
726   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
727   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
728   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
729   * @systemapi
730   * @StageModelOnly
731   * @since 10
732   */
733  function removeAllowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
734
735  /**
736   * Remove appid list of bundles that can be installed in the device.
737   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
738   *
739   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
740   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
741   *                         The admin must have the corresponding permission.
742   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
743   *                                   setting cannot be greater than 200.
744   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
745   * @returns { Promise<void> } the promise returned by the removeAllowedInstallBundles.
746   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
747   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
748   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
749   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
750   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
751   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
752   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
753   * @systemapi
754   * @StageModelOnly
755   * @since 10
756   */
757  function removeAllowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
758
759  /**
760   * Remove appid list of bundles that can be installed in the device.
761   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
762   *
763   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
764   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
765   *                         The admin must have the corresponding permission.
766   * @param { Array<string> } appIds - ids of the bundle that can be installed. The size of the array after
767   *                                   setting cannot be greater than 200.
768   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
769   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
770   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
771   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
772   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
773   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
774   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
775   * @StageModelOnly
776   * @since 12
777   */
778  function removeAllowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
779
780  /**
781   * Get the appid list of bundles that can be installed in the device.
782   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
783   *
784   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
785   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
786   *                         The admin must have the corresponding permission.
787   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
788   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
789   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
790   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
791   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
792   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
793   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
794   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
795   * @systemapi
796   * @StageModelOnly
797   * @since 10
798   */
799  function getAllowedInstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void;
800
801  /**
802   * Get the appid list of bundles that can be installed in the device.
803   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
804   *
805   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
806   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
807   *                         The admin must have the corresponding permission.
808   * @param { number } userId - userId indicates the user ID.
809   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
810   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
811   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
812   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
813   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
814   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
815   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
816   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
817   * @systemapi
818   * @StageModelOnly
819   * @since 10
820   */
821  function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void;
822
823  /**
824   * Get appid list of bundles that can be installed in the device.
825   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
826   *
827   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
828   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
829   *                         The admin must have the corresponding permission.
830   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
831   * @returns { Promise<Array<string>> } the promise that contains the appid list.
832   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
833   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
834   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
835   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
836   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
837   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
838   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
839   * @systemapi
840   * @StageModelOnly
841   * @since 10
842   */
843  function getAllowedInstallBundles(admin: Want, userId?: number): Promise<Array<string>>;
844
845  /**
846   * Get appid list of bundles that can be installed in the device.
847   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
848   *
849   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
850   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
851   *                         The admin must have the corresponding permission.
852   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
853   * @returns { Array<string> } ids of the bundle that can be installed.
854   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
855   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
856   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
857   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
858   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
859   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
860   * @StageModelOnly
861   * @since 12
862   */
863  function getAllowedInstallBundlesSync(admin: Want, accountId?: number): Array<string>;
864
865  /**
866   * Add appid list of bundles that can not be installed in the device.
867   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
868   *
869   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
870   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
871   *                         The admin must have the corresponding permission.
872   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
873   *                                   setting cannot be greater than 200.
874   * @param { AsyncCallback<void> } callback - the callback of addDisallowedInstallBundles.
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 addDisallowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
887
888  /**
889   * Add appid list of bundles that can not be installed in the device.
890   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
891   *
892   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
893   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
894   *                         The admin must have the corresponding permission.
895   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
896   *                                   setting cannot be greater than 200.
897   * @param { number } userId - userId indicates the user ID.
898   * @param { AsyncCallback<void> } callback - the callback of addDisallowedInstallBundles.
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 addDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
911
912  /**
913   * Add appid list of bundles that can not be installed in the device.
914   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
915   *
916   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
917   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
918   *                         The admin must have the corresponding permission.
919   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
920   *                                   setting cannot be greater than 200.
921   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
922   * @returns { Promise<void> } the promise returned by the addDisallowedInstallBundles.
923   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
924   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
925   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
926   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
927   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
928   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
929   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
930   * @systemapi
931   * @StageModelOnly
932   * @since 10
933   */
934  function addDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
935
936  /**
937   * Add appid list of bundles that can not be installed in the device.
938   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
939   *
940   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
941   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
942   *                         The admin must have the corresponding permission.
943   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
944   *                                   setting cannot be greater than 200.
945   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
946   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
947   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
948   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
949   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
950   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
951   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
952   * @StageModelOnly
953   * @since 12
954   */
955  function addDisallowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
956
957  /**
958   * Remove appid list of bundles that can not be installed in the device.
959   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
960   *
961   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
962   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
963   *                         The admin must have the corresponding permission.
964   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
965   *                                   setting cannot be greater than 200.
966   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedInstallBundles.
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 } 202 - Permission verification failed. A non-system application calls a system API.
971   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
972   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
973   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
974   * @systemapi
975   * @StageModelOnly
976   * @since 10
977   */
978  function removeDisallowedInstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
979
980  /**
981   * Remove appid list of bundles that can not be installed in the device.
982   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
983   *
984   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
985   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
986   *                         The admin must have the corresponding permission.
987   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
988   *                                   setting cannot be greater than 200.
989   * @param { number } userId - userId indicates the user ID.
990   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedInstallBundles.
991   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
992   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
993   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
994   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
995   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
996   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
997   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
998   * @systemapi
999   * @StageModelOnly
1000   * @since 10
1001   */
1002  function removeDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
1003
1004  /**
1005   * Remove appid list of bundles that can not be installed in the device.
1006   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1007   *
1008   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1009   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1010   *                         The admin must have the corresponding permission.
1011   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
1012   *                                   setting cannot be greater than 200.
1013   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
1014   * @returns { Promise<void> } the promise returned by the removeDisallowedInstallBundles.
1015   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1016   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1017   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1018   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1019   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1020   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1021   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1022   * @systemapi
1023   * @StageModelOnly
1024   * @since 10
1025   */
1026  function removeDisallowedInstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
1027
1028  /**
1029   * Remove appid list of bundles that can not be installed in the device.
1030   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1031   *
1032   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1033   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1034   *                         The admin must have the corresponding permission.
1035   * @param { Array<string> } appIds - ids of the bundle that can not be installed. The size of the array after
1036   *                                   setting cannot be greater than 200.
1037   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
1038   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1039   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1040   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1041   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1042   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1043   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1044   * @StageModelOnly
1045   * @since 12
1046   */
1047  function removeDisallowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
1048
1049  /**
1050   * Get the appid list of bundles that can not be installed in the device.
1051   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1052   *
1053   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1054   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1055   *                         The admin must have the corresponding permission.
1056   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
1057   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1058   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1059   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1060   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1061   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1062   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1063   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1064   * @systemapi
1065   * @StageModelOnly
1066   * @since 10
1067   */
1068  function getDisallowedInstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void;
1069
1070  /**
1071   * Get the appid list of bundles that can not be installed in the device.
1072   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1073   *
1074   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1075   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1076   *                         The admin must have the corresponding permission.
1077   * @param { number } userId - userId indicates the user ID.
1078   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
1079   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1080   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1081   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1082   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1083   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1084   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1085   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1086   * @systemapi
1087   * @StageModelOnly
1088   * @since 10
1089   */
1090  function getDisallowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void;
1091
1092  /**
1093   * Get appid list of bundles that can not be installed in the device.
1094   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1095   *
1096   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1097   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1098   *                         The admin must have the corresponding permission.
1099   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
1100   * @returns { Promise<Array<string>> } the promise that contains the appid list.
1101   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1102   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1103   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1104   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1105   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1106   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1107   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1108   * @systemapi
1109   * @StageModelOnly
1110   * @since 10
1111   */
1112  function getDisallowedInstallBundles(admin: Want, userId?: number): Promise<Array<string>>;
1113
1114  /**
1115   * Get appid list of bundles that can not be installed in the device.
1116   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1117   *
1118   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1119   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1120   *                         The admin must have the corresponding permission.
1121   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
1122   * @returns { Array<string> } ids of the bundle that can not be installed.
1123   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1124   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1125   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1126   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1127   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1128   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1129   * @StageModelOnly
1130   * @since 12
1131   */
1132  function getDisallowedInstallBundlesSync(admin: Want, accountId?: number): Array<string>;
1133
1134  /**
1135   * Add appid list of bundles that can not be uninstalled in the device.
1136   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1137   *
1138   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1139   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1140   *                         The admin must have the corresponding permission.
1141   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1142   *                                   setting cannot be greater than 200.
1143   * @param { AsyncCallback<void> } callback - the callback of addDisallowedUninstallBundles.
1144   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1145   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1146   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1147   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1148   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1149   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1150   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1151   * @systemapi
1152   * @StageModelOnly
1153   * @since 10
1154   */
1155  function addDisallowedUninstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
1156
1157  /**
1158   * Add appid list of bundles that can not be uninstalled in the device.
1159   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1160   *
1161   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1162   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1163   *                         The admin must have the corresponding permission.
1164   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1165   *                                   setting cannot be greater than 200.
1166   * @param { number } userId - userId indicates the user ID.
1167   * @param { AsyncCallback<void> } callback - the callback of addDisallowedUninstallBundles.
1168   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1169   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1170   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1171   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1172   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1173   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1174   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1175   * @systemapi
1176   * @StageModelOnly
1177   * @since 10
1178   */
1179  function addDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
1180
1181  /**
1182   * Add appid list of bundles that can not be uninstalled in the device.
1183   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1184   *
1185   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1186   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1187   *                         The admin must have the corresponding permission.
1188   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1189   *                                   setting cannot be greater than 200.
1190   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
1191   * @returns { Promise<void> } the promise returned by the addDisallowedUninstallBundles.
1192   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1193   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1194   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1195   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1196   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1197   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1198   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1199   * @systemapi
1200   * @StageModelOnly
1201   * @since 10
1202   */
1203  function addDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
1204
1205  /**
1206   * Add appid list of bundles that can not be uninstalled in the device.
1207   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1208   *
1209   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1210   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1211   *                         The admin must have the corresponding permission.
1212   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1213   *                                   setting cannot be greater than 200.
1214   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
1215   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1216   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1217   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1218   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1219   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1220   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1221   * @StageModelOnly
1222   * @since 12
1223   */
1224  function addDisallowedUninstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
1225
1226  /**
1227   * Remove appid list of bundles that can not be uninstalled in the device.
1228   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1229   *
1230   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1231   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1232   *                         The admin must have the corresponding permission.
1233   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1234   *                                   setting cannot be greater than 200.
1235   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedUninstallBundles.
1236   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1237   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1238   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1239   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1240   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1241   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1242   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1243   * @systemapi
1244   * @StageModelOnly
1245   * @since 10
1246   */
1247  function removeDisallowedUninstallBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void;
1248
1249  /**
1250   * Remove appid list of bundles that can not be uninstalled in the device.
1251   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1252   *
1253   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1254   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1255   *                         The admin must have the corresponding permission.
1256   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1257   *                                   setting cannot be greater than 200.
1258   * @param { number } userId - userId indicates the user ID.
1259   * @param { AsyncCallback<void> } callback - the callback of removeDisallowedUninstallBundles.
1260   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1261   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1262   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1263   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1264   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1265   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1266   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1267   * @systemapi
1268   * @StageModelOnly
1269   * @since 10
1270   */
1271  function removeDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void;
1272
1273  /**
1274   * Remove appid list of bundles that can not be uninstalled in the device.
1275   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1276   *
1277   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1278   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1279   *                         The admin must have the corresponding permission.
1280   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1281   *                                   setting cannot be greater than 200.
1282   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
1283   * @returns { Promise<void> } the promise returned by the removeDisallowedUninstallBundles.
1284   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1285   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1286   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1287   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1288   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1289   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1290   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1291   * @systemapi
1292   * @StageModelOnly
1293   * @since 10
1294   */
1295  function removeDisallowedUninstallBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>;
1296
1297  /**
1298   * Remove appid list of bundles that can not be uninstalled in the device.
1299   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1300   *
1301   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1302   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1303   *                         The admin must have the corresponding permission.
1304   * @param { Array<string> } appIds - ids of the bundle that can not be uninstalled. The size of the array after
1305   *                                   setting cannot be greater than 200.
1306   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
1307   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1308   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1309   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1310   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1311   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1312   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1313   * @StageModelOnly
1314   * @since 12
1315   */
1316  function removeDisallowedUninstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void;
1317
1318  /**
1319   * Get the appid list of bundles that can not be uninstalled in the device.
1320   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1321   *
1322   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1323   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1324   *                         The admin must have the corresponding permission.
1325   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
1326   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1327   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1328   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1329   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1330   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1331   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1332   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1333   * @systemapi
1334   * @StageModelOnly
1335   * @since 10
1336   */
1337  function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void;
1338
1339  /**
1340   * Get the appid list of bundles that can not be uninstalled in the device.
1341   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1342   *
1343   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1344   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1345   *                         The admin must have the corresponding permission.
1346   * @param { number } userId - userId indicates the user ID.
1347   * @param { AsyncCallback<Array<string>> } callback - the callback that contains the appid list.
1348   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1349   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1350   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1351   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1352   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1353   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1354   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1355   * @systemapi
1356   * @StageModelOnly
1357   * @since 10
1358   */
1359  function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void;
1360
1361  /**
1362   * Get appid list of bundles that can not be uninstalled in the device.
1363   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1364   *
1365   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1366   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1367   *                         The admin must have the corresponding permission.
1368   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
1369   * @returns { Promise<Array<string>> } the promise that contains the appid list.
1370   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1371   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1372   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1373   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1374   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1375   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1376   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1377   * @systemapi
1378   * @StageModelOnly
1379   * @since 10
1380   */
1381  function getDisallowedUninstallBundles(admin: Want, userId?: number): Promise<Array<string>>;
1382
1383  /**
1384   * Get appid list of bundles that can not be uninstalled in the device.
1385   * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method.
1386   *
1387   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1388   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1389   *                         The admin must have the corresponding permission.
1390   * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID.
1391   * @returns { Array<string> } ids of the bundle that can not be uninstalled.
1392   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1393   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1394   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1395   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1396   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1397   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1398   * @StageModelOnly
1399   * @since 12
1400   */
1401  function getDisallowedUninstallBundlesSync(admin: Want, accountId?: number): Array<string>;
1402
1403  /**
1404   * Uninstall an application.
1405   *
1406   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1407   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1408   *                         The admin must have the corresponding permission.
1409   * @param { string } bundleName - indicates the bundle name of the application to be uninstalled.
1410   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
1411   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1412   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1413   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1414   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1415   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1416   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1417   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1418   * @systemapi
1419   * @StageModelOnly
1420   * @since 10
1421   */
1422  function uninstall(admin: Want, bundleName: string, callback: AsyncCallback<void>): void;
1423
1424  /**
1425   * Uninstall an application.
1426   *
1427   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1428   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1429   *                         The admin must have the corresponding permission.
1430   * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
1431   * @param { number } userId - userId indicates the user ID or do not pass user ID.
1432   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
1433   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1434   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1435   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1436   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1437   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1438   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1439   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1440   * @systemapi
1441   * @StageModelOnly
1442   * @since 10
1443   */
1444  function uninstall(admin: Want, bundleName: string, userId: number, callback: AsyncCallback<void>): void;
1445
1446  /**
1447   * Uninstall an application.
1448   *
1449   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1450   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1451   *                         The admin must have the corresponding permission.
1452   * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
1453   * @param { boolean } isKeepData - isKeepData indicates whether keep the data.
1454   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
1455   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1456   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1457   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1458   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1459   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1460   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1461   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1462   * @systemapi
1463   * @StageModelOnly
1464   * @since 10
1465   */
1466  function uninstall(admin: Want, bundleName: string, isKeepData: boolean, callback: AsyncCallback<void>): void;
1467
1468  /**
1469   * Uninstall an application.
1470   *
1471   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1472   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1473   *                         The admin must have the corresponding permission.
1474   * @param { string } bundleName - indicates the bundle name of the application to be uninstalled.
1475   * @param { number } userId - userId indicates the user ID or do not pass user ID.
1476   * @param { boolean } isKeepData - isKeepData indicates whether keep the data.
1477   * @param { AsyncCallback<void> } callback - the callback of uninstalling application result.
1478   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1479   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1480   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1481   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1482   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1483   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1484   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1485   * @systemapi
1486   * @StageModelOnly
1487   * @since 10
1488   */
1489  function uninstall(admin: Want, bundleName: string, userId: number, isKeepData: boolean, callback: AsyncCallback<void>): void;
1490
1491  /**
1492   * Uninstall an application.
1493   *
1494   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1495   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1496   *                         The admin must have the corresponding permission.
1497   * @param { string } bundleName - indicates the bundle name of the application to be uninstalled.
1498   * @param { number } [userId] - userId indicates the user ID or do not pass user ID.
1499   * @param { boolean } [isKeepData] - isKeepData indicates whether keep the data.
1500   * @returns { Promise<void> } the promise of uninstalling application result.
1501   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1502   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1503   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1504   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1505   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1506   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1507   * @StageModelOnly
1508   * @since 12
1509   */
1510  function uninstall(admin: Want, bundleName: string, userId?: number, isKeepData?: boolean): Promise<void>;
1511
1512  /**
1513   * Install an application.
1514   *
1515   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1516   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1517   *                         The admin must have the corresponding permission.
1518   * @param { Array<string> } hapFilePaths - indicates the path of the application to be installed.
1519   * @param { AsyncCallback<void> } callback - the callback of installing application result.
1520   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1521   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1522   * @throws { BusinessError } 9201002 - Failed to install the application.
1523   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1524   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1525   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1526   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1527   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1528   * @systemapi
1529   * @StageModelOnly
1530   * @since 10
1531   */
1532  function install(admin: Want, hapFilePaths: Array<string>, callback: AsyncCallback<void>): void;
1533
1534  /**
1535   * Install an application.
1536   *
1537   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1538   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1539   *                         The admin must have the corresponding permission.
1540   * @param { Array<string> } hapFilePaths - indicates the path of the application to be installed.
1541   * @param { InstallParam } installParam - installParam indicates the installation parameters.
1542   *                                        It may contain two fields: userId and installFlag.
1543   *                                        The flag can only be one of correct flags.
1544   * @param { AsyncCallback<void> } callback - the callback of installing application result.
1545   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1546   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1547   * @throws { BusinessError } 9201002 - Failed to install the application.
1548   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1549   * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
1550   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1551   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1552   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1553   * @systemapi
1554   * @StageModelOnly
1555   * @since 10
1556   */
1557  function install(admin: Want, hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void;
1558
1559  /**
1560   * Install an application.
1561   *
1562   * @permission ohos.permission.ENTERPRISE_INSTALL_BUNDLE
1563   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1564   *                         The admin must have the corresponding permission.
1565   * @param { Array<string> } hapFilePaths - indicates the path of the application to be installed.
1566   * @param { InstallParam } [installParam] - installParam indicates the installation parameters.
1567   *                                        It may contain two fields: userId and installFlag.
1568   *                                        The flag can only be one of correct flags.
1569   * @returns { Promise<void> } the promise of installing application result.
1570   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1571   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1572   * @throws { BusinessError } 9201002 - Failed to install the application.
1573   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1574   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
1575   *                                 2. Incorrect parameter types; 3. Parameter verification failed.
1576   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1577   * @StageModelOnly
1578   * @since 12
1579   */
1580  function install(admin: Want, hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>;
1581
1582  /**
1583   * Get the list of install bundles in the device.
1584   *
1585   * @permission ohos.permission.ENTERPRISE_GET_ALL_BUNDLE_INFO
1586   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1587   *                         The admin must have the corresponding permission.
1588   * @param { number } accountId - accountId indicates the local ID of the OS account.
1589   * @returns { Promise<Array<BundleInfo>> } The result of getting the bundle info.
1590   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1591   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1592   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1593   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1594   * @stagemodelonly
1595   * @since 20
1596   */
1597  function getInstalledBundleList(admin: Want, accountId: number): Promise<Array<BundleInfo>>;
1598
1599  /**
1600   * Add the list of app distribution types can be installed in the device.
1601   *
1602   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1603   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1604   *                         The admin must have the corresponding permission.
1605   * @param { Array<AppDistributionType> } appDistributionTypes - appdistribution types id.
1606   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1607   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1608   * @throws { BusinessError } 9200012 - Parameter verification failed.
1609   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1610   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1611   * @stagemodelonly
1612   * @since 20
1613   */
1614  function addInstallationAllowedAppDistributionTypes(admin: Want, appDistributionTypes: Array<AppDistributionType>): void;
1615
1616  /**
1617   * Remove the list of app distribution types can be installed in the device.
1618   *
1619   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1620   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1621   *                         The admin must have the corresponding permission.
1622   * @param { Array<AppDistributionType> } appDistributionTypes - appdistribution types id.
1623   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1624   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1625   * @throws { BusinessError } 9200012 - Parameter verification failed.
1626   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1627   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1628   * @stagemodelonly
1629   * @since 20
1630   */
1631  function removeInstallationAllowedAppDistributionTypes(admin: Want, appDistributionTypes: Array<AppDistributionType>): void;
1632
1633  /**
1634   * Get the list of app distribution types can be installed in the device.
1635   *
1636   * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
1637   * @param { Want } admin - admin indicates the enterprise admin extension ability information.
1638   *                         The admin must have the corresponding permission.
1639   * @returns { Array<AppDistributionType> } the result of app distribution types can be installed in the device.
1640   * @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
1641   * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
1642   * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
1643   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1644   * @stagemodelonly
1645   * @since 20
1646   */
1647  function getInstallationAllowedAppDistributionTypes(admin: Want): Array<AppDistributionType>;
1648
1649  /**
1650   * App distribution type.
1651   *
1652   * @enum { number }
1653   * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1654   * @stagemodelonly
1655   * @since 20
1656   */
1657  enum AppDistributionType {
1658	/**
1659     * App distribution type of app gallery
1660     *
1661     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1662     * @stagemodelonly
1663     * @since 20
1664     */
1665	APP_GALLERY = 1,
1666
1667	/**
1668     * App distribution type of enterprise
1669     *
1670     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1671     * @stagemodelonly
1672     * @since 20
1673     */
1674	ENTERPRISE = 2,
1675
1676	/**
1677     * App distribution type of enterprise normal
1678     *
1679     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1680     * @stagemodelonly
1681     * @since 20
1682     */
1683	ENTERPRISE_NORMAL = 3,
1684
1685	/**
1686     * App distribution type of enterprise MDM
1687     *
1688     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1689     * @stagemodelonly
1690     * @since 20
1691     */
1692	ENTERPRISE_MDM = 4,
1693
1694	/**
1695     * App distribution type of enterprise internal testing
1696     *
1697     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1698     * @stagemodelonly
1699     * @since 20
1700     */
1701	INTERNALTESTING = 5,
1702
1703	/**
1704     * App distribution type of enterprise crowd testing
1705     *
1706     * @syscap SystemCapability.Customization.EnterpriseDeviceManager
1707     * @stagemodelonly
1708     * @since 20
1709     */
1710	CROWDTESTING = 6,
1711  }
1712}
1713
1714export default bundleManager;
1715