diff --git a/api/@ohos.enterprise.bundleManager.d.ts b/api/@ohos.enterprise.bundleManager.d.ts index 1c12e481a45aecb07b1809a1d21d8a52d9107dda..42b5cb009096419917f51b4191e9f1827470a8bc 100644 --- a/api/@ohos.enterprise.bundleManager.d.ts +++ b/api/@ohos.enterprise.bundleManager.d.ts @@ -614,6 +614,27 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ + /** + * Add appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of addAllowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ function addAllowedInstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; /** @@ -638,6 +659,28 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ + /** + * Add appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of addAllowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ function addAllowedInstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; /** @@ -662,6 +705,28 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ + /** + * Add appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the addAllowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ function addAllowedInstallBundles(admin: Want, appIds: Array, userId?: number): Promise; /** @@ -683,6 +748,25 @@ declare namespace bundleManager { * @StageModelOnly * @since 12 */ + /** + * Add appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 21 + */ function addAllowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; /** @@ -706,6 +790,27 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ + /** + * Remove appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of removeAllowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ function removeAllowedInstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; /** @@ -730,6 +835,28 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ + /** + * Remove appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of removeAllowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ function removeAllowedInstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; /** @@ -754,6 +881,28 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ + /** + * Remove appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the removeAllowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ function removeAllowedInstallBundles(admin: Want, appIds: Array, userId?: number): Promise; /** @@ -773,18 +922,612 @@ declare namespace bundleManager { * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @StageModelOnly - * @since 12 + * @since 12 + */ + /** + * Remove appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 21 + */ + function removeAllowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; + + /** + * Get the appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Get the appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { AsyncCallback> } callback - the callback that contains the appIds or appIdentifiers list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function getAllowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + + /** + * Get the appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Get the appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback> } callback - the callback that contains the appIds or appIdentifiers list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + + /** + * Get appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise that contains the appid list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Get appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise that contains the appIds or appIdentifiers list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function getAllowedInstallBundles(admin: Want, userId?: number): Promise>; + + /** + * Get appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @returns { Array } ids of the bundle that can be installed. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 12 + */ + /** + * Get appid list of bundles that can be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @returns { Array } appIds or appIdentifiers of the bundle that can be installed. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 21 + */ + function getAllowedInstallBundlesSync(admin: Want, accountId?: number): Array; + + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of addDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of addDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function addDisallowedInstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; + + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function addDisallowedInstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; + + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the addDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the addDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function addDisallowedInstallBundles(admin: Want, appIds: Array, userId?: number): Promise; + + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 12 + */ + /** + * Add appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 21 + */ + function addDisallowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; + + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of removeDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of removeDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function removeDisallowedInstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; + + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function removeDisallowedInstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; + + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the removeDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the removeDisallowedInstallBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function removeDisallowedInstallBundles(admin: Want, appIds: Array, userId?: number): Promise; + + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 12 + */ + /** + * Remove appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be installed. + * The size of the array after setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 21 + */ + function removeDisallowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; + + /** + * Get the appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + /** + * Get the appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { AsyncCallback> } callback - the callback that contains the appIds or appIdentifiers list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 21 + */ + function getDisallowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + + /** + * Get the appid list of bundles that can not be installed in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 */ - function removeAllowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; - /** - * Get the appid list of bundles that can be installed in the device. + * Get the appid list of bundles that can not be installed in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback> } callback - the callback that contains the appIds or appIdentifiers list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -794,19 +1537,19 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function getAllowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + function getDisallowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; /** - * Get the appid list of bundles that can be installed in the device. + * Get appid list of bundles that can not be installed in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise that contains the appid list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -818,17 +1561,15 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; - /** - * Get appid list of bundles that can be installed in the device. + * Get appid list of bundles that can not be installed in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise> } the promise that contains the appid list. + * @returns { Promise> } the promise that contains the appIds or appIdentifiers list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -838,19 +1579,19 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function getAllowedInstallBundles(admin: Want, userId?: number): Promise>; + function getDisallowedInstallBundles(admin: Want, userId?: number): Promise>; /** - * Get appid list of bundles that can be installed in the device. + * Get appid list of bundles that can not be installed in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. - * @returns { Array } ids of the bundle that can be installed. + * @returns { Array } ids of the bundle that can not be installed. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -860,42 +1601,36 @@ declare namespace bundleManager { * @StageModelOnly * @since 12 */ - function getAllowedInstallBundlesSync(admin: Want, accountId?: number): Array; - /** - * Add appid list of bundles that can not be installed in the device. + * Get appid list of bundles that can not be installed in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after - * setting cannot be greater than 200. - * @param { AsyncCallback } callback - the callback of addDisallowedInstallBundles. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @returns { Array } appIds or appIdentifiers of the bundle that can not be installed. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. - * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function addDisallowedInstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; + function getDisallowedInstallBundlesSync(admin: Want, accountId?: number): Array; /** - * Add appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after * setting cannot be greater than 200. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback } callback - the callback of addDisallowedInstallBundles. + * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -907,19 +1642,16 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function addDisallowedInstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; - /** - * Add appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after - * setting cannot be greater than 200. - * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise } the promise returned by the addDisallowedInstallBundles. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -929,41 +1661,43 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function addDisallowedInstallBundles(admin: Want, appIds: Array, userId?: number): Promise; + function addDisallowedUninstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; /** - * Add appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after * setting cannot be greater than 200. - * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly - * @since 12 + * @since 10 */ - function addDisallowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; - /** - * Remove appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after - * setting cannot be greater than 200. - * @param { AsyncCallback } callback - the callback of removeDisallowedInstallBundles. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -973,21 +1707,21 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function removeDisallowedInstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; + function addDisallowedUninstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; /** - * Remove appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after * setting cannot be greater than 200. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback } callback - the callback of removeDisallowedInstallBundles. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the addDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -999,19 +1733,17 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function removeDisallowedInstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; - /** - * Remove appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after - * setting cannot be greater than 200. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise } the promise returned by the removeDisallowedInstallBundles. + * @returns { Promise } the promise returned by the addDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1021,18 +1753,18 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function removeDisallowedInstallBundles(admin: Want, appIds: Array, userId?: number): Promise; + function addDisallowedUninstallBundles(admin: Want, appIds: Array, userId?: number): Promise; /** - * Remove appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be installed. The size of the array after + * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after * setting cannot be greater than 200. * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. @@ -1044,38 +1776,37 @@ declare namespace bundleManager { * @StageModelOnly * @since 12 */ - function removeDisallowedInstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; - /** - * Get the appid list of bundles that can not be installed in the device. + * Add appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. - * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function getDisallowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + function addDisallowedUninstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; /** - * Get the appid list of bundles that can not be installed in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after + * setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1087,17 +1818,16 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function getDisallowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; - /** - * Get appid list of bundles that can not be installed in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise> } the promise that contains the appid list. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1107,40 +1837,43 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function getDisallowedInstallBundles(admin: Want, userId?: number): Promise>; + function removeDisallowedUninstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; /** - * Get appid list of bundles that can not be installed in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. - * @returns { Array } ids of the bundle that can not be installed. + * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after + * setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly - * @since 12 + * @since 10 */ - function getDisallowedInstallBundlesSync(admin: Want, accountId?: number): Array; - /** - * Add appid list of bundles that can not be uninstalled in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after - * setting cannot be greater than 200. - * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1150,12 +1883,12 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function addDisallowedUninstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; + function removeDisallowedUninstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; /** - * Add appid list of bundles that can not be uninstalled in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -1163,8 +1896,8 @@ declare namespace bundleManager { * The admin must have the corresponding permission. * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after * setting cannot be greater than 200. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the removeDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1176,19 +1909,17 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function addDisallowedUninstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; - /** - * Add appid list of bundles that can not be uninstalled in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after - * setting cannot be greater than 200. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise } the promise returned by the addDisallowedUninstallBundles. + * @returns { Promise } the promise returned by the removeDisallowedUninstallBundles. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1198,12 +1929,12 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function addDisallowedUninstallBundles(admin: Want, appIds: Array, userId?: number): Promise; + function removeDisallowedUninstallBundles(admin: Want, appIds: Array, userId?: number): Promise; /** - * Add appid list of bundles that can not be uninstalled in the device. + * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -1221,8 +1952,6 @@ declare namespace bundleManager { * @StageModelOnly * @since 12 */ - function addDisallowedUninstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; - /** * Remove appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. @@ -1230,33 +1959,28 @@ declare namespace bundleManager { * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after - * setting cannot be greater than 200. - * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. + * @param { Array } appIds - appIds or appIdentifiers of the bundle that can not be uninstalled. + * The size of the array after setting cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. - * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function removeDisallowedUninstallBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; + function removeDisallowedUninstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; /** - * Remove appid list of bundles that can not be uninstalled in the device. + * Get the appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after - * setting cannot be greater than 200. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. + * @param { AsyncCallback> } callback - the callback that contains the appid list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1268,19 +1992,14 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function removeDisallowedUninstallBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; - /** - * Remove appid list of bundles that can not be uninstalled in the device. + * Get the appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after - * setting cannot be greater than 200. - * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise } the promise returned by the removeDisallowedUninstallBundles. + * @param { AsyncCallback> } callback - the callback that contains the appIds or appIdentifiers list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1290,31 +2009,30 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function removeDisallowedUninstallBundles(admin: Want, appIds: Array, userId?: number): Promise; + function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; /** - * Remove appid list of bundles that can not be uninstalled in the device. + * Get the appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { Array } appIds - ids of the bundle that can not be uninstalled. The size of the array after - * setting cannot be greater than 200. - * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback> } callback - the callback that contains the appid list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly - * @since 12 + * @since 10 */ - function removeDisallowedUninstallBundlesSync(admin: Want, appIds: Array, accountId?: number): void; - /** * Get the appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. @@ -1322,7 +2040,8 @@ declare namespace bundleManager { * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback> } callback - the callback that contains the appIds or appIdentifiers list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1332,19 +2051,19 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ - function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; + function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; /** - * Get the appid list of bundles that can not be uninstalled in the device. + * Get appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. * * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. - * @param { number } userId - userId indicates the user ID. - * @param { AsyncCallback> } callback - the callback that contains the appid list. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise that contains the appid list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1356,8 +2075,6 @@ declare namespace bundleManager { * @StageModelOnly * @since 10 */ - function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; - /** * Get appid list of bundles that can not be uninstalled in the device. * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. @@ -1366,7 +2083,7 @@ declare namespace bundleManager { * @param { Want } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. * @param { number } [userId] - userId indicates the user ID or do not pass user ID. - * @returns { Promise> } the promise that contains the appid list. + * @returns { Promise> } the promise that contains the appIds or appIdentifiers list. * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. @@ -1376,7 +2093,7 @@ declare namespace bundleManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @StageModelOnly - * @since 10 + * @since 21 */ function getDisallowedUninstallBundles(admin: Want, userId?: number): Promise>; @@ -1398,6 +2115,24 @@ declare namespace bundleManager { * @StageModelOnly * @since 12 */ + /** + * Get appid list of bundles that can not be uninstalled in the device. + * Only apps with the ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY permission can call this method. + * + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } [accountId] - accountId indicates the account ID or do not pass account ID. + * @returns { Array } appIds or appIdentifiers of the bundle that can not be uninstalled. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + * @since 21 + */ function getDisallowedUninstallBundlesSync(admin: Want, accountId?: number): Array; /**