Obtains the application information of the specified user based on a given bundle name in asynchronous mode. This method uses a promise to return the result.
**Permission required**
**Required permissions**
ohos.permission.GET\_BUNDLE\_INFO\_PRIVILEGED or ohos.permission.GET\_BUNDLE\_INFO
Obtains the application information of the specified user based on a given bundle name in asynchronous mode. This method uses a callback to return the result.
**Permission required**
**Required permissions**
ohos.permission.GET\_BUNDLE\_INFO\_PRIVILEGED or ohos.permission.GET\_BUNDLE\_INFO
| bundleFlag | BundleFlag | Yes| Type of information that will be returned.<br/>**0**: The default bundle information will be returned.<br/>**1**: The bundle information containing the ability information will be returned.|
| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| bundleFlag | BundleFlag | Yes| Type of information that will be returned.<br/>**0**: The default bundle information will be returned.<br/>**1**: The bundle information containing the ability information will be returned.|
| callback | AsyncCallback<Array\<BundleInfo>> | Yes| Callback used to return the information of all available bundles.|
| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<BundleInfo>> | Yes | Callback used to return the information of all available bundles. |
**Example**
```js
bundle.getAllBundleInfo(0,OnReceiveEvent);
functionOnReceiveEvent(err,data){
console.info('xxx getAllBundleInfo data length ['+data.length+']');
| bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<BundleInfo>> | Yes | Callback used to return the information of all available bundles. |
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default bundle information will be returned.<br/>**1**: The bundle information containing the ability information will be returned.|
| bundleName | string | Yes | Bundle name. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | BundleOptions | No | Includes **userId** and **networkId**. |
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default bundle information will be returned.<br/>**1**: The bundle information containing the ability information will be returned.|
| callback | AsyncCallback\<BundleInfo> | Yes| Callback used to return the bundle information.|
| bundleName | string | Yes | Bundle name. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<BundleInfo> | Yes | Callback used to return the bundle information. |
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default application information will be returned. <br/>**8**: The application information containing the permission information will be returned.|
| userId | number | Yes| User ID.|
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default application information will be returned. <br/>**8**: The application information containing the permission information will be returned.|
| userId | number | Yes| User ID.|
| callback | AsyncCallback<Array\<ApplicationInfo>> | Yes| Callback used to return the application information.|
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<ApplicationInfo>> | Yes | Callback used to return the application information. |
**Example**
```js
bundle.getAllApplicationInfo(8,0,OnReceiveEvent);
functionOnReceiveEvent(err,data){
console.info('xxx getAllApplicationInfo data length ['+data.length+']');
| want | Want | Yes| Want that contains the bundle name.|
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default ability information will be returned.<br/>**2**: The ability information containing the permission information will be returned.<br/>**4**: The ability information containing the application information will be returned.|
| userId | number | No| User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
| want | Want | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| want | Want | Yes| Want that contains the bundle name.|
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default ability information will be returned.<br/>**2**: The ability information containing the permission information will be returned.<br/>**4**: The ability information containing the application information will be returned.|
| userId | number | Yes| User ID.|
| callback | AsyncCallback<Array\<AbilityInfo>> | Yes| Callback used to return the ability information.|
| want | Want | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<AbilityInfo>> | Yes | Callback used to return the ability information. |
| want | Want | Yes| Want that contains the bundle name.|
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default ability information will be returned.<br/>**2**: The ability information containing the permission information will be returned.<br/>**4**: The ability information containing the application information will be returned.|
| callback | AsyncCallback<Array\<AbilityInfo>> | Yes| Callback used to return the ability information.|
| hapFilePath | string | Yes| Path of the HAP file.|
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default bundle information will be returned.<br/>**1**: The bundle information containing the ability information will be returned.|
| hapFilePath | string | Yes| Path of the HAP file.|
| bundleFlags | number | Yes| Type of information that will be returned.<br/>**0**: The default bundle information will be returned.<br/>**1**: The bundle information containing the ability information will be returned.|
| callback | AsyncCallback<BundleInfo> | Yes| Callback used to return the bundle information.|
| Promise\<GrantStatus> | Promise used to return the verification result. <br/>**-1**: The bundle does not have the specified permission.<br/>**0**: The bundle has the specified permission.|
| Promise\<string> | Promise used to return the bundle name.|
| callback | AsyncCallback\<GrantStatus> | Yes| Callback used to return the verification result. <br/>**-1**: The bundle does not have the specified permission.<br/>**0**: The bundle has the specified permission.|
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------- |
| uid | number | Yes | UID based on which the bundle name is to obtain.|
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.|
| deviceId | Read-only| string | No| ID of the device that runs the ability.|
| bundleName | Read-only| string | Yes| Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| abilityName | Read-only| string | Yes| Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| deviceId | Read-only | string | No | ID of the device that runs the ability. |
| bundleName | Read-only | string | Yes | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| abilityName | Read-only | string | Yes | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| uri | Read-only | string | No | Resource ID.|
| shortName | Read-only | string | No | Short name of the **ElementName**.|