IssueNo:#I9P2FZ

Description:add bms interface
Sig:SIG_ApplicaitonFramework
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: wangtiantian <wangtiantian19@huawei.com>
This commit is contained in:
wangtiantian 2024-05-14 10:18:36 +08:00
parent b9e2ac78ae
commit b63f93a077
3 changed files with 60 additions and 0 deletions

View File

@ -104,6 +104,25 @@ declare namespace bundleResourceManager {
*/
function getBundleResourceInfo(bundleName: string, resourceFlags?: number): BundleResourceInfo;
/**
* Obtains the BundleResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL.
*
* @permission ohos.permission.GET_BUNDLE_RESOURCES
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { number } [resourceFlags] - Indicates the flag used to specify information contained in the BundleResourceInfo object that will be returned.
* @param { number } [appIndex] - Indicates the index of the bundle.
* @returns { BundleResourceInfo } Returns the BundleResourceInfo object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700061 - AppIndex not in valid range.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 12
*/
function getBundleResourceInfo(bundleName: string, resourceFlags?: number, appIndex?: number): BundleResourceInfo;
/**
* Obtains the LauncherAbilityResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL.
*
@ -121,6 +140,25 @@ declare namespace bundleResourceManager {
*/
function getLauncherAbilityResourceInfo(bundleName: string, resourceFlags?: number): Array<LauncherAbilityResourceInfo>;
/**
* Obtains the LauncherAbilityResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL.
*
* @permission ohos.permission.GET_BUNDLE_RESOURCES
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { number } [resourceFlags] - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo object that will be returned.
* @param { number } [appIndex] - Indicates the index of the bundle.
* @returns { Array<LauncherAbilityResourceInfo> } Returns a list of LauncherAbilityResourceInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700061 - AppIndex not in valid range.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 12
*/
function getLauncherAbilityResourceInfo(bundleName: string, resourceFlags?: number, appIndex?: number): Array<LauncherAbilityResourceInfo>;
/**
* Obtains BundleResourceInfo of all bundles available in the system.
*

View File

@ -72,4 +72,15 @@ export interface BundleResourceInfo {
* @since 12
*/
readonly drawableDescriptor: DrawableDescriptor;
/**
* Indicates the index of the bundle
*
* @type { number }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 12
*/
readonly appIndex: number;
}

View File

@ -94,4 +94,15 @@ export interface LauncherAbilityResourceInfo {
* @since 12
*/
readonly drawableDescriptor: DrawableDescriptor;
/**
* Indicates the index of the bundle
*
* @type { number }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 12
*/
readonly appIndex: number;
}