From 5f7c2b530c185a737b60069030cbc1f0c3f3ec17 Mon Sep 17 00:00:00 2001 From: lanhaoyu Date: Mon, 28 Jul 2025 20:27:58 +0800 Subject: [PATCH] 1 Signed-off-by: lanhaoyu --- api/@ohos.bundle.bundleManager.d.ts | 982 +++++++++++++++++++++++++--- 1 file changed, 891 insertions(+), 91 deletions(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index f37ee52072..b83b57850c 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -2053,7 +2053,6 @@ declare namespace bundleManager { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ function getBundleInfoForSelf(bundleFlags: int): Promise; @@ -2086,10 +2085,42 @@ declare namespace bundleManager { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ function getBundleInfoForSelf(bundleFlags: int, callback: AsyncCallback): void; + /** + * Obtains own bundleInfo. + * + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. + * @returns { Promise } The result of getting the bundle info. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function getBundleInfoForSelfWithBundleFlagsReturnsPromise(bundleFlags: int): Promise; + + /** + * Obtains own bundleInfo. + * + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. + * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function getBundleInfoForSelfWithBundleFlagsCallback(bundleFlags: int, callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleInfoForSelf { + getBundleInfoForSelfWithBundleFlagsReturnsPromise, + getBundleInfoForSelfWithBundleFlagsCallback + } + /** * Obtains own bundleInfo. * @@ -2135,8 +2166,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ function getBundleInfo(bundleName: string, bundleFlags: int, callback: AsyncCallback): void; @@ -2154,8 +2184,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ function getBundleInfo(bundleName: string, bundleFlags: int, userId: int, callback: AsyncCallback): void; @@ -2174,11 +2203,75 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ function getBundleInfo(bundleName: string, bundleFlags: int, userId?: int): Promise; + /** + * Obtains bundleInfo based on bundleName, bundleFlags. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. + * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 + */ + function getBundleInfoWithBundleNameBundleFlagsCallback(bundleName: string, + bundleFlags: int, callback: AsyncCallback): void; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and userId. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 + */ + function getBundleInfoWithBundleNameBundleFlagsUserIdCallback(bundleName: string, + bundleFlags: int, userId: int, callback: AsyncCallback): void; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and userId. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. + * @returns { Promise } The result of getting the bundle info. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 + */ + function getBundleInfoWithBundleNameBundleFlagsUserIdReturnsPromise(bundleName: string, + bundleFlags: int, userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleInfo { + getBundleInfoWithBundleNameBundleFlagsCallback, + getBundleInfoWithBundleNameBundleFlagsUserIdCallback, + getBundleInfoWithBundleNameBundleFlagsUserIdReturnsPromise + } + /** * Obtains application info based on a given bundle name. * @@ -2193,8 +2286,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getApplicationInfo(bundleName: string, appFlags: int, callback: AsyncCallback): void; @@ -2214,8 +2306,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getApplicationInfo(bundleName: string, appFlags: int, userId: int, callback: AsyncCallback): void; @@ -2236,11 +2327,81 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getApplicationInfo(bundleName: string, appFlags: int, userId?: int): Promise; + /** + * Obtains application info based on a given bundle name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } appFlags {@link ApplicationFlag} - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { AsyncCallback } callback - The callback of getting application info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getApplicationInfoWithBundleNameAppFlagsCallback(bundleName: string, + appFlags: int, callback: AsyncCallback): void; + + /** + * Obtains application info based on a given bundle name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } appFlags {@link ApplicationFlag} - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback of getting application info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getApplicationInfoWithBundleNameAppFlagsUserIdCallback(bundleName: string, + appFlags: int, userId: int, callback: AsyncCallback): void; + + /** + * Obtains application info based on a given bundle name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } appFlags {@link ApplicationFlag} - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. + * @returns { Promise } The result of getting the application info. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getApplicationInfoWithBundleNameAppFlagsUserIdReturnsPromise(bundleName: string, + appFlags: int, userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getApplicationInfo { + getApplicationInfoWithBundleNameAppFlagsCallback, + getApplicationInfoWithBundleNameAppFlagsUserIdCallback, + getApplicationInfoWithBundleNameAppFlagsUserIdReturnsPromise + } + /** * Obtains BundleInfo of all bundles available in the system. * @@ -2252,8 +2413,7 @@ declare namespace bundleManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllBundleInfo(bundleFlags: int, callback: AsyncCallback>): void; @@ -2270,8 +2430,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllBundleInfo(bundleFlags: int, userId: int, callback: AsyncCallback>): void; @@ -2288,11 +2447,71 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllBundleInfo(bundleFlags: int, userId?: int): Promise>; + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo that will be returned. + * @param { AsyncCallback> } callback - The callback of getting a list of BundleInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllBundleInfoWithBundleFlagsCallback(bundleFlags: int, callback: AsyncCallback>): void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo that will be returned. + * @param { int } userId - Indicates the user id. + * @param { AsyncCallback> } callback - The callback of getting a list of BundleInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllBundleInfoWithBundleFlagsUserIdCallback(bundleFlags: int, + userId: int, callback: AsyncCallback>): void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo that will be returned. + * @param { int } [userId] - Indicates the user id. + * @returns { Promise> } Returns a list of BundleInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllBundleInfoWithBundleFlagsUserIdReturnsPromise(bundleFlags: int, + userId?: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllBundleInfo { + getAllBundleInfoWithBundleFlagsCallback, + getAllBundleInfoWithBundleFlagsUserIdCallback, + getAllBundleInfoWithBundleFlagsUserIdReturnsPromise + } + /** * Obtains information about all installed applications of a specified user. * @@ -2304,8 +2523,7 @@ declare namespace bundleManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllApplicationInfo(appFlags: int, callback: AsyncCallback>): void; @@ -2322,8 +2540,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllApplicationInfo(appFlags: int, userId: int, callback: AsyncCallback>): void; @@ -2341,38 +2558,98 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllApplicationInfo(appFlags: int, userId?: int): Promise>; /** - * Query the AbilityInfo by the given Want. + * Obtains information about all installed applications of a specified user. * - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @param { Want } want - Indicates the Want containing the application bundle name to be queried. - * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. - * @param { AsyncCallback> } callback - The callback of querying ability info result. + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST + * @param { int } appFlags {@link ApplicationFlag} - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of getting a list of ApplicationInfo 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; 3. At least one parameter(action, entity, uri or type) is required for implicit query. - * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700003 - The specified ability is not found. - * @throws { BusinessError } 17700026 - The specified bundle is disabled. - * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function queryAbilityInfo(want: Want, abilityFlags: int, callback: AsyncCallback>): void; + function getAllApplicationInfoWithAppFlagsCallback(appFlags: int, + callback: AsyncCallback>): void; /** - * Query the AbilityInfo by the given Want. + * Obtains information about all installed applications of a specified user. * - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST + * @param { int } appFlags {@link ApplicationFlag} - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - The callback of getting a list of ApplicationInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllApplicationInfoWithAppFlagsUserIdCallback(appFlags: int, + userId: int, callback: AsyncCallback>): void; + + /** + * Obtains information about all installed applications of a specified user. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST + * @param { int } appFlags {@link ApplicationFlag} - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. + * @returns { Promise> } Returns a list of ApplicationInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllApplicationInfoWithAppFlagsUserIdReturnsPromise(appFlags: int, + userId?: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllApplicationInfo { + getAllApplicationInfoWithAppFlagsCallback, + getAllApplicationInfoWithAppFlagsUserIdCallback, + getAllApplicationInfoWithAppFlagsUserIdReturnsPromise + } + + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of querying ability info result. + * @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; 3. At least one parameter(action, entity, uri or type) is required for implicit query. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryAbilityInfo(want: Want, abilityFlags: int, callback: AsyncCallback>): void; + + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. * @param { int } userId - userId Indicates the user ID. * @param { AsyncCallback> } callback - The callback of querying ability info result. @@ -2387,8 +2664,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function queryAbilityInfo(want: Want, abilityFlags: int, userId: int, callback: AsyncCallback>): void; @@ -2412,8 +2688,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function queryAbilityInfo(want: Want, abilityFlags: int, userId?: int): Promise>; @@ -2436,11 +2711,31 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function queryAbilityInfo(wants: Array, abilityFlags: int, userId?: int): Promise>; + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of querying ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryAbilityInfoWithWantTypedWantAbilityFlagsCallback(want: Want, + abilityFlags: int, callback: AsyncCallback>): void; + /** * Query the AbilityInfo by the given Want. * @@ -2448,6 +2743,86 @@ declare namespace bundleManager { * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. * @param { int } userId - userId Indicates the user ID. + * @param { AsyncCallback> } callback - The callback of querying ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryAbilityInfoWithWantTypedWantAbilityFlagsUserIdCallback(want: Want, + abilityFlags: int, userId: int, callback: AsyncCallback>): void; + + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { int } [userId] - userId Indicates the user ID. + * @returns { Promise> } Returns a list of AbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryAbilityInfoWithWantTypedWantAbilityFlagsUserIdReturnsPromise(want: Want, + abilityFlags: int, userId?: int): Promise>; + + /** + * Query the AbilityInfo by the given Want Array. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Array } wants - Indicates the Want Array containing the application bundle name to be queried. + * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { int } [userId] - userId Indicates the user ID. + * @returns { Promise> } Returns a list of AbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryAbilityInfoWithArrayOfWantTypedWantAbilityFlagsUserIdReturnsPromise(wants: Array, + abilityFlags: int, userId?: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload queryAbilityInfo { + queryAbilityInfoWithWantTypedWantAbilityFlagsCallback, + queryAbilityInfoWithWantTypedWantAbilityFlagsUserIdCallback, + queryAbilityInfoWithWantTypedWantAbilityFlagsUserIdReturnsPromise, + queryAbilityInfoWithArrayOfWantTypedWantAbilityFlagsUserIdReturnsPromise + } + + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { int } abilityFlags {@link AbilityFlag} - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { int } [userId] - userId Indicates the user ID. * @returns { Array } Returns a list of AbilityInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -2499,8 +2874,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: int, callback: AsyncCallback>): void; @@ -2525,8 +2899,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: int, userId: int, callback: AsyncCallback>): void; @@ -2551,12 +2924,94 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: int, userId?: int): Promise>; + /** + * Query extension info of by utilizing a Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { int } extensionAbilityFlags {@link ExtensionAbilityFlag} - Indicates the flag used to specify information contained in the + * ExtensionAbilityInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of querying extension ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryExtensionAbilityInfoWithWantExtensionAbilityTypeExtensionAbilityFlagsCallback(want: Want, + extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: int, + callback: AsyncCallback>): void; + + /** + * Query extension info of by utilizing a Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { int } extensionAbilityFlags {@link ExtensionAbilityFlag} - Indicates the flag used to specify information contained in the + * ExtensionAbilityInfo objects that will be returned. + * @param { int } userId - Indicates the user ID. + * @param { AsyncCallback> } callback - The callback of querying extension ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryExtensionAbilityInfoWithWantExtensionAbilityTypeExtensionAbilityFlagsUserIdCallback(want: Want, + extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: int, userId: int, + callback: AsyncCallback>): void; + + /** + * Query the ExtensionAbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { int } extensionAbilityFlags {@link ExtensionAbilityFlag} - Indicates the flag used to specify information contained in the + * ExtensionAbilityInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID. + * @returns { Promise> } Returns a list of ExtensionAbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryExtensionAbilityInfoWithWantExtensionAbilityTypeExtensionAbilityFlagsUserIdReturnsPromise(want: Want, + extensionAbilityType: ExtensionAbilityType, + extensionAbilityFlags: int, userId?: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload queryExtensionAbilityInfo { + queryExtensionAbilityInfoWithWantExtensionAbilityTypeExtensionAbilityFlagsCallback, + queryExtensionAbilityInfoWithWantExtensionAbilityTypeExtensionAbilityFlagsUserIdCallback, + queryExtensionAbilityInfoWithWantExtensionAbilityTypeExtensionAbilityFlagsUserIdReturnsPromise + } + /** * Query the ExtensionAbilityInfo by the given Want. * @@ -2577,8 +3032,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: int, userId?: int): Array; @@ -2603,8 +3057,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: string, extensionAbilityFlags: int, userId?: int): Array; @@ -2626,12 +3079,91 @@ declare namespace bundleManager { * @throws { BusinessError } 17700004 - The specified userId is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function queryExtensionAbilityInfoSync(extensionAbilityType: string, extensionAbilityFlags: int, userId?: int): Array; + /** + * Query the ExtensionAbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { int } extensionAbilityFlags {@link ExtensionAbilityFlag} - Indicates the flag used to specify information contained in the + * ExtensionAbilityInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID. + * @returns { Array } Returns a list of ExtensionAbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryExtensionAbilityInfoSyncWithWantExtensionAbilityTypeTypedExtensionAbilityTypeExtensionAbilityFlagsUserId( + want: Want, extensionAbilityType: ExtensionAbilityType, + extensionAbilityFlags: int, userId?: int): Array; + + /** + * Query the ExtensionAbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { string } extensionAbilityType - Indicates extensionAbilityType. + * @param { int } extensionAbilityFlags {@link ExtensionAbilityFlag} - Indicates the flag used to specify information contained in the + * ExtensionAbilityInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID. + * @returns { Array } Returns a list of ExtensionAbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryExtensionAbilityInfoSyncWithWantStringTypedExtensionAbilityTypeExtensionAbilityFlagsUserId(want: Want, + extensionAbilityType: string, extensionAbilityFlags: int, userId?: int): Array; + + /** + * Query the ExtensionAbilityInfo by extension ability type. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { int } extensionAbilityFlags {@link ExtensionAbilityFlag} - Indicates the flag used to specify information contained in the + * ExtensionAbilityInfo objects that will be returned. + * @param { int } [userId] - Indicates the user ID. + * @returns { Array } Returns a list of ExtensionAbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function queryExtensionAbilityInfoSyncWithStringTypedExtensionAbilityTypeExtensionAbilityFlagsUserId( + extensionAbilityType: string, extensionAbilityFlags: int, userId?: int): Array; + + /** + * @since 20 + * @arkts 1.2 + */ + overload queryExtensionAbilityInfoSync { + queryExtensionAbilityInfoSyncWithWantExtensionAbilityTypeTypedExtensionAbilityTypeExtensionAbilityFlagsUserId, + queryExtensionAbilityInfoSyncWithWantStringTypedExtensionAbilityTypeExtensionAbilityFlagsUserId, + queryExtensionAbilityInfoSyncWithStringTypedExtensionAbilityTypeExtensionAbilityFlagsUserId + } + /** * Obtains bundle name by the given uid. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. * @@ -2642,10 +3174,37 @@ declare namespace bundleManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 17700021 - The uid is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 + */ + function getBundleNameByUid(uid: int, callback: AsyncCallback): void; + + /** + * Obtains bundle name by the given uid. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { int } uid - Indicates the UID of an application. + * @returns { Promise } Returns the bundle name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700021 - The uid is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 14 + */ + function getBundleNameByUid(uid: int): Promise; + + /** + * Obtains bundle name by the given uid. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { int } uid - Indicates the UID of an application. + * @param { AsyncCallback } callback - The callback of getting bundle name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 17700021 - The uid is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 */ - function getBundleNameByUid(uid: int, callback: AsyncCallback): void; + function getBundleNameByUidWithUidCallback(uid: int, callback: AsyncCallback): void; /** * Obtains bundle name by the given uid. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. @@ -2654,13 +3213,21 @@ declare namespace bundleManager { * @param { int } uid - Indicates the UID of an application. * @returns { Promise } Returns the bundle name. * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 17700021 - The uid is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function getBundleNameByUid(uid: int): Promise; + function getBundleNameByUidWithUidReturnsPromise(uid: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleNameByUid { + getBundleNameByUidWithUidCallback, + getBundleNameByUidWithUidReturnsPromise + } /** * Obtains bundle name by the given uid. The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. @@ -2691,8 +3258,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700022 - The hapFilePath is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getBundleArchiveInfo(hapFilePath: string, bundleFlags: int, callback: AsyncCallback): void; @@ -2710,8 +3276,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700022 - The hapFilePath is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getBundleArchiveInfo(hapFilePath: string, bundleFlags: int): Promise; @@ -2720,7 +3285,54 @@ declare namespace bundleManager { * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } hapFilePath - Indicates the path storing the HAP. - * The path should be the relative path to the data directory of the current application. + * The path should be the relative path to the data directory of the current application. + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo object to be returned. + * @param { AsyncCallback } callback - The callback of getting bundle archive info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700022 - The hapFilePath is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundleArchiveInfoWithHapFilePathBundleFlagsCallback(hapFilePath: string, + bundleFlags: int, callback: AsyncCallback): void; + + /** + * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } hapFilePath - Indicates the path storing the HAP. + * The path should be the relative path to the data directory of the current application. + * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo object to be returned. + * @returns { Promise } Returns the BundleInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700022 - The hapFilePath is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundleArchiveInfoWithHapFilePathBundleFlagsReturnsPromise(hapFilePath: string, + bundleFlags: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleArchiveInfo { + getBundleArchiveInfoWithHapFilePathBundleFlagsCallback, + getBundleArchiveInfoWithHapFilePathBundleFlagsReturnsPromise + } + + /** + * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } hapFilePath - Indicates the path storing the HAP. + * The path should be the relative path to the data directory of the current application. * @param { int } bundleFlags {@link BundleFlag} - Indicates the flag used to specify information contained in the BundleInfo object to be returned. * @returns { BundleInfo } Returns the BundleInfo object. * @throws { BusinessError } 201 - Permission denied. @@ -2747,8 +3359,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback): void; @@ -2765,8 +3376,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function cleanBundleCacheFiles(bundleName: string): Promise; @@ -2785,11 +3395,73 @@ declare namespace bundleManager { * @throws { BusinessError } 17700061 - AppIndex not in valid range. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'15', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ function cleanBundleCacheFiles(bundleName: string, appIndex: int): Promise; + /** + * Clears cache data of a specified application. + * + * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. + * @param { AsyncCallback } callback - The callback of cleaning bundle cache files result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function cleanBundleCacheFilesWithBundleNameCallback(bundleName: string, callback: AsyncCallback): void; + + /** + * Clears cache data of a specified application. + * + * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. + * @returns { Promise } Clean bundle cache files result + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function cleanBundleCacheFilesWithBundleNameReturnsPromise(bundleName: string): Promise; + + /** + * Clears cache data of a specified application. + * + * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. + * @param { int } appIndex - Indicates the index of clone app. + * @returns { Promise } Clean bundle cache files result + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function cleanBundleCacheFilesWithBundleNameAppIndexReturnsPromise(bundleName: string, appIndex: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload cleanBundleCacheFiles { + cleanBundleCacheFilesWithBundleNameCallback, + cleanBundleCacheFilesWithBundleNameReturnsPromise, + cleanBundleCacheFilesWithBundleNameAppIndexReturnsPromise + } + /** * Get the all bundle cache size of the current user. * @@ -2833,8 +3505,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700061 - AppIndex not in valid range. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function setApplicationEnabled(bundleName: string, appIndex: int, isEnabled: boolean): Promise; @@ -2851,8 +3522,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setApplicationEnabled(bundleName: string, isEnabled: boolean, callback: AsyncCallback): void; @@ -2869,11 +3539,76 @@ declare namespace bundleManager { * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setApplicationEnabled(bundleName: string, isEnabled: boolean): Promise; + /** + * Sets whether to enable a specified application. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } appIndex - Indicates the index of clone app. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @returns { Promise } set app enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setApplicationEnabledWithBundleNameAppIndexIsEnabledReturnsPromise(bundleName: string, + appIndex: int, isEnabled: boolean): Promise; + + /** + * Sets whether to enable a specified application. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @param { AsyncCallback } callback - The callback of setting app enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setApplicationEnabledWithBundleNameIsEnabledCallback(bundleName: string, + isEnabled: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable a specified application. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @returns { Promise } set app enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setApplicationEnabledWithBundleNameIsEnabledReturnsPromise(bundleName: string, + isEnabled: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setApplicationEnabled { + setApplicationEnabledWithBundleNameAppIndexIsEnabledReturnsPromise, + setApplicationEnabledWithBundleNameIsEnabledCallback, + setApplicationEnabledWithBundleNameIsEnabledReturnsPromise + } + /** * Sets whether to enable a specified application. * @@ -2907,8 +3642,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700061 - AppIndex not in valid range. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function setAbilityEnabled(info: AbilityInfo, appIndex: int, isEnabled: boolean): Promise; @@ -2926,8 +3660,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean, callback: AsyncCallback): void; @@ -2945,11 +3678,78 @@ declare namespace bundleManager { * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean): Promise; + /** + * Sets whether to enable a specified ability. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } info - Indicates information about the ability to set. + * @param { int } appIndex - Indicates the index of clone app. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @returns { Promise } set ability enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setAbilityEnabledWithInfoAppIndexIsEnabledReturnsPromise(info: AbilityInfo, + appIndex: int, isEnabled: boolean): Promise; + + /** + * Sets whether to enable a specified ability. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } info - Indicates information about the ability to set. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @param { AsyncCallback } callback - The callback of setting ability enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setAbilityEnabledWithInfoIsEnabledCallback(info: AbilityInfo, + isEnabled: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable a specified ability. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } info - Indicates information about the ability to set. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @returns { Promise } set ability enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setAbilityEnabledWithInfoIsEnabledReturnsPromise(info: AbilityInfo, isEnabled: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setAbilityEnabled { + setAbilityEnabledWithInfoAppIndexIsEnabledReturnsPromise, + setAbilityEnabledWithInfoIsEnabledCallback, + setAbilityEnabledWithInfoIsEnabledReturnsPromise + } + /** * Sets whether to enable a specified ability. * -- Gitee