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.
Obtains the application information based on a given bundle name. This method uses a promise to return the result.
**Required permissions**
ohos.permission.GET\_BUNDLE\_INFO\_PRIVILEGED or ohos.permission.GET\_BUNDLE\_INFO
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**
SystemCapability.BundleManager.BundleFramework
**Parameters**
...
...
@@ -34,7 +38,7 @@ ohos.permission.GET\_BUNDLE\_INFO\_PRIVILEGED or ohos.permission.GET\_BUNDLE\_IN
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.
Obtains the application information based on a given bundle name. This method uses an asynchronous callback to return the result.
**Required permissions**
ohos.permission.GET\_BUNDLE\_INFO\_PRIVILEGED or ohos.permission.GET\_BUNDLE\_INFO
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
| Promise\<boolean> | Promise used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
| info | AbilityInfo | Yes | Ability information. |
| callback | AsyncCallback\<boolean> | Yes| Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
| Promise\<boolean> | Promise used to return whether the application is enabled. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.|
| bundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback\<boolean> | Yes| Callback used to return whether the application is enabled. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.|
function getAbilityIcon(bundleName: string, abilityName: string): Promise\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)>;
Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This method uses a promise to return the result.
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain.|
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain.|
| Promise\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)> | Promise used to return the <[PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.|
function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)>): void;
Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the corresponding icon based on a given bundle name and ability name. This method uses an asynchronous callback to return the result.
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain.|
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain.|
| callback | AsyncCallback\<[PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)> | Yes | Callback used to return the <[PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.|
| want | Want | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension 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. |
| extensionFlags | number | Yes | Extension 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\<ExtensionAbilityInfo>> | Yes | Callback used to return the extension ability information. |
| want | Want | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<ExtensionAbilityInfo>> | Yes | Callback used to return the extension ability information. |