From bf9c12811c6b38c0567b0b484383f54840cfd630 Mon Sep 17 00:00:00 2001 From: lanhaoyu Date: Wed, 30 Jul 2025 15:51:56 +0800 Subject: [PATCH] 2 Signed-off-by: lanhaoyu --- api/@ohos.bundle.bundleManager.d.ts | 990 +++++++++++++++++++++++++--- 1 file changed, 881 insertions(+), 109 deletions(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index f37ee52072..e871361d1e 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -2980,8 +2980,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 isApplicationEnabled(bundleName: string, appIndex: int): Promise; @@ -2995,8 +2994,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 isApplicationEnabled(bundleName: string, callback: AsyncCallback): void; @@ -3010,11 +3008,66 @@ 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 isApplicationEnabled(bundleName: string): Promise; + /** + * Checks whether a specified application is enabled. + * + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } appIndex - Indicates the index of clone app. + * @returns { Promise } Returns true if the application is enabled; returns false otherwise. + * @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 isApplicationEnabledWithBundleNameAppIndexReturnsPromise(bundleName: string, + appIndex: int): Promise; + + /** + * Checks whether a specified application is enabled. + * + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise. + * @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 isApplicationEnabledWithBundleNameCallback(bundleName: string, + callback: AsyncCallback): void; + + /** + * Checks whether a specified application is enabled. + * + * @param { string } bundleName - Indicates the bundle name of the application. + * @returns { Promise } Returns true if the application is enabled; returns false otherwise. + * @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 isApplicationEnabledWithBundleNameReturnsPromise(bundleName: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload isApplicationEnabled { + isApplicationEnabledWithBundleNameAppIndexReturnsPromise, + isApplicationEnabledWithBundleNameCallback, + isApplicationEnabledWithBundleNameReturnsPromise + } + /** * Checks whether a specified application is enabled. * @@ -3043,8 +3096,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 isAbilityEnabled(info: AbilityInfo, appIndex: int): Promise; @@ -3059,8 +3111,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700003 - The specified abilityName 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 isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void; @@ -3075,11 +3126,67 @@ declare namespace bundleManager { * @throws { BusinessError } 17700003 - The specified abilityName 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 isAbilityEnabled(info: AbilityInfo): Promise; + /** + * Checks whether a specified ability is enabled. + * + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @param { int } appIndex - Indicates the index of clone app. + * @returns { Promise } Returns true if the ability is enabled; returns false otherwise. + * @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 abilityName is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function isAbilityEnabledWithInfoAppIndexReturnsPromise(info: AbilityInfo, appIndex: int): Promise; + + /** + * Checks whether a specified ability is enabled. + * + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @param { AsyncCallback } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise. + * @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 abilityName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function isAbilityEnabledWithInfoAppIndexCallback(info: AbilityInfo, callback: AsyncCallback): void; + + /** + * Checks whether a specified ability is enabled. + * + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @returns { Promise } Returns true if the ability is enabled; returns false otherwise. + * @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 abilityName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function isAbilityEnabledWithInfoReturnsPromise(info: AbilityInfo): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload isAbilityEnabled { + isAbilityEnabledWithInfoAppIndexReturnsPromise, + isAbilityEnabledWithInfoAppIndexCallback, + isAbilityEnabledWithInfoReturnsPromise + } + /** * Checks whether a specified ability is enabled. * @@ -3113,8 +3220,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 getLaunchWantForBundle(bundleName: string, userId: int, callback: AsyncCallback): void; @@ -3133,8 +3239,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 getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; @@ -3155,8 +3260,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 getLaunchWantForBundle(bundleName: string, userId?: int): Promise; @@ -3168,6 +3272,79 @@ declare namespace bundleManager { * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application. * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @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 getLaunchWantForBundleWithBundleNameUserIdCallback(bundleName: string, + userId: int, callback: AsyncCallback): void; + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback - The callback for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @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 getLaunchWantForBundleWithBundleNameCallback(bundleName: string, callback: AsyncCallback): void; + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. + * @returns { Promise } the Want for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @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 getLaunchWantForBundleWithBundleNameUserIdReturnsPromise(bundleName: string, + userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getLaunchWantForBundle { + getLaunchWantForBundleWithBundleNameUserIdCallback, + getLaunchWantForBundleWithBundleNameCallback, + getLaunchWantForBundleWithBundleNameUserIdReturnsPromise + } + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. * @returns { Want } the Want for starting the application's main ability. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -3225,8 +3402,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback>): void; @@ -3259,11 +3435,55 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise>; + /** + * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } abilityName - Indicates the abilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @param { AsyncCallback> } callback - The callback of returning string in json-format of the corresponding config file. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified abilityName is not existed. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 + */ + function getProfileByAbilityWithModuleNameAbilityNameMetadataNameCallback(moduleName: string, + abilityName: string, metadataName: string, callback: AsyncCallback>): void; + + /** + * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } abilityName - Indicates the abilityName of the application. + * @param { string } [metadataName] - Indicates the name of metadata in ability. + * @returns { Promise> } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified abilityName is not existed. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 + */ + function getProfileByAbilityWithModuleNameAbilityNameMetadataNameReturnsPromise(moduleName: string, + abilityName: string, metadataName?: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getProfileByAbility { + getProfileByAbilityWithModuleNameAbilityNameMetadataNameCallback, + getProfileByAbilityWithModuleNameAbilityNameMetadataNameReturnsPromise + } + /** * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. * @@ -3284,7 +3504,7 @@ declare namespace bundleManager { * * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } abilityName - Indicates the abilityName of the application. - * @param { string } metadataName - Indicates the name of metadata in ability. + * @param { string } [metadataName] - Indicates the name of metadata in ability. * @returns { Array } Returns string in json-format of the corresponding config file. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. @@ -3325,8 +3545,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; @@ -3357,8 +3576,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise>; @@ -3368,34 +3586,77 @@ declare namespace bundleManager { * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. * @param { string } metadataName - Indicates the name of metadata in ability. - * @returns { Array } Returns string in json-format of the corresponding config file. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @param { AsyncCallback> } callback - The callback of returning string in json-format of the corresponding config file. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 10 + * @since 20 + * @arkts 1.2 */ + function getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameCallback(moduleName: string, + extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; + /** * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. * * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. - * @param { string } metadataName - Indicates the name of metadata in ability. - * @returns { Array } Returns string in json-format of the corresponding config file. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @param { string } [metadataName] - Indicates the name of metadata in ability. + * @returns { Promise> } Returns string in json-format of the corresponding config file. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function getProfileByExtensionAbilitySync(moduleName: string, extensionAbilityName: string, metadataName?: string): Array; + function getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameReturnsPromise(moduleName: string, + extensionAbilityName: string, metadataName?: string): Promise>; /** - * Get the permission details by permission name. + * @since 20 + * @arkts 1.2 + */ + overload getProfileByExtensionAbility { + getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameCallback, + getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameReturnsPromise + } + + /** + * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @returns { Array } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 10 + */ + /** + * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. + * @param { string } [metadataName] - Indicates the name of metadata in ability. + * @returns { Array } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @atomicservice + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getProfileByExtensionAbilitySync(moduleName: string, extensionAbilityName: string, metadataName?: string): Array; + + /** + * Get the permission details by permission name. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } permissionName - Indicates permission name. @@ -3406,8 +3667,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700006 - The specified permission 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 getPermissionDef(permissionName: string, callback: AsyncCallback): void; @@ -3423,11 +3683,52 @@ declare namespace bundleManager { * @throws { BusinessError } 17700006 - The specified permission 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 getPermissionDef(permissionName: string): Promise; + /** + * Get the permission details by permission name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } permissionName - Indicates permission name. + * @param { AsyncCallback } callback - The callback of get permissionDef object result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700006 - The specified permission is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getPermissionDefWithPermissionNameCallback(permissionName: string, + callback: AsyncCallback): void; + + /** + * Get the permission details by permission name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } permissionName - Indicates permission name. + * @returns { Promise } Returns permissionDef object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700006 - The specified permission is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getPermissionDefWithPermissionNameReturnsPromise(permissionName: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getPermissionDef { + getPermissionDefWithPermissionNameCallback, + getPermissionDefWithPermissionNameReturnsPromise + } + /** * Get the permission details by permission name. * @@ -3464,8 +3765,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; @@ -3488,11 +3788,67 @@ declare namespace bundleManager { * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise; + /** + * Obtains the label of a specified ability. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } moduleName - Indicates the module name. + * @param { string } abilityName - Indicates the ability name. + * @param { AsyncCallback } callback - The callback of getting ability label result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAbilityLabelWithBundleNameModuleNameAbilityNameCallback(bundleName: string, + moduleName: string, abilityName: string, callback: AsyncCallback): void; + + /** + * Obtains the label of a specified ability. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } moduleName - Indicates the module name. + * @param { string } abilityName - Indicates the ability name. + * @returns { Promise } Returns the label representing the label of the specified ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAbilityLabelWithBundleNameModuleNameAbilityNameReturnsPromise(bundleName: string, + moduleName: string, abilityName: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAbilityLabel { + getAbilityLabelWithBundleNameModuleNameAbilityNameCallback, + getAbilityLabelWithBundleNameModuleNameAbilityNameReturnsPromise + } + /** * Obtains the label of a specified ability. * @@ -3533,8 +3889,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 getApplicationInfoSync(bundleName: string, applicationFlags: int, userId: int): ApplicationInfo; @@ -3552,11 +3907,59 @@ 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 getApplicationInfoSync(bundleName: string, applicationFlags: int): ApplicationInfo; + /** + * Obtains applicationInfo based on a given bundleName and bundleFlags. + * + * @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 } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @returns { ApplicationInfo } - Returns the ApplicationInfo object. + * @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 getApplicationInfoSyncWithBundleNameApplicationFlagsUserId(bundleName: string, + applicationFlags: int, userId: int): ApplicationInfo; + + /** + * Obtains applicationInfo based on a given bundleName and bundleFlags. + * + * @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 } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. + * @returns { ApplicationInfo } - Returns the ApplicationInfo object. + * @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 getApplicationInfoSyncWithBundleNameApplicationFlags(bundleName: string, + applicationFlags: int): ApplicationInfo; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getApplicationInfoSync { + getApplicationInfoSyncWithBundleNameApplicationFlagsUserId, + getApplicationInfoSyncWithBundleNameApplicationFlags + } + /** * 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. * @@ -3571,8 +3974,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 getBundleInfoSync(bundleName: string, bundleFlags: int, userId: int): BundleInfo; @@ -3588,11 +3990,54 @@ 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 getBundleInfoSync(bundleName: string, bundleFlags: int): BundleInfo; + /** + * 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 object that will be returned. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @returns { BundleInfo } - Returns the BundleInfo object. + * @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 getBundleInfoSyncWithBundleNameBundleFlagsUserId(bundleName: string, + bundleFlags: int, userId: int): BundleInfo; + + /** + * 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 object that will be returned. + * @returns { BundleInfo } - Returns the BundleInfo object. + * @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 getBundleInfoSyncWithBundleNameBundleFlags(bundleName: string, bundleFlags: int): BundleInfo; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleInfoSync { + getBundleInfoSyncWithBundleNameBundleFlagsUserId, + getBundleInfoSyncWithBundleNameBundleFlags + } + /** * Obtains SharedBundleInfo of all shared bundle available in the system. * @@ -3602,8 +4047,7 @@ declare namespace bundleManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getAllSharedBundleInfo(callback: AsyncCallback>): void; @@ -3616,48 +4060,185 @@ declare namespace bundleManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 + */ + function getAllSharedBundleInfo(): Promise>; + + /** + * Obtains SharedBundleInfo of all shared bundle available in the system. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { AsyncCallback> } callback - The callback of getting a list of SharedBundleInfo 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 getAllSharedBundleInfoWithCallback( + callback: AsyncCallback>): void; + + /** + * Obtains SharedBundleInfo of all shared bundle available in the system. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @returns { Promise> } Returns a list of SharedBundleInfo 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 getAllSharedBundleInfoReturnsPromise(): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllSharedBundleInfo { + getAllSharedBundleInfoWithCallback, + getAllSharedBundleInfoReturnsPromise + } + + /** + * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundleName of the application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { AsyncCallback> } callback - The callback of getting a list of SharedBundleInfo 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 } 17700002 - The specified moduleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 10 + */ + function getSharedBundleInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void; + + /** + * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundleName of the application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @returns { Promise> } Returns a list of SharedBundleInfo 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 } 17700002 - The specified moduleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 10 + */ + function getSharedBundleInfo(bundleName: string, moduleName: string): Promise>; + + /** + * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundleName of the application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { AsyncCallback> } callback - The callback of getting a list of SharedBundleInfo 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 } 17700002 - The specified moduleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getSharedBundleInfoWithBundleNameModuleNameCallback(bundleName: string, + moduleName: string, callback: AsyncCallback>): void; + + /** + * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundleName of the application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @returns { Promise> } Returns a list of SharedBundleInfo 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 } 17700002 - The specified moduleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getSharedBundleInfoWithBundleNameModuleNameReturnsPromise(bundleName: string, + moduleName: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getSharedBundleInfo { + getSharedBundleInfoWithBundleNameModuleNameCallback, + getSharedBundleInfoWithBundleNameModuleNameReturnsPromise + } + + /** + * Obtains the profile file information of a specified bundle. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { AsyncCallback } callback - Indicates the callback of getting AppProvisionInfo 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. Parameter bundleName is empty. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 10 */ - function getAllSharedBundleInfo(): Promise>; + function getAppProvisionInfo(bundleName: string, callback: AsyncCallback): void; /** - * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * Obtains the profile file information of a specified bundle. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { string } bundleName - Indicates the bundleName of the application. - * @param { string } moduleName - Indicates the moduleName of the application. - * @param { AsyncCallback> } callback - The callback of getting a list of SharedBundleInfo objects. + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - Indicates the callback of getting AppProvisionInfo 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. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter bundleName is empty. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ - function getSharedBundleInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void; + function getAppProvisionInfo(bundleName: string, userId: int, callback: AsyncCallback): void; /** - * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * Obtains the profile file information of a specified bundle. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { string } bundleName - Indicates the bundleName of the application. - * @param { string } moduleName - Indicates the moduleName of the application. - * @returns { Promise> } Returns a list of SharedBundleInfo objects. + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { int } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise } Returns the AppProvisionInfo 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 } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter bundleName is empty. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ - function getSharedBundleInfo(bundleName: string, moduleName: string): Promise>; + function getAppProvisionInfo(bundleName: string, userId?: int): Promise; /** * Obtains the profile file information of a specified bundle. @@ -3672,10 +4253,11 @@ declare namespace bundleManager { * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function getAppProvisionInfo(bundleName: string, callback: AsyncCallback): void; + function getAppProvisionInfoWithBundleNameCallback(bundleName: string, + callback: AsyncCallback): void; /** * Obtains the profile file information of a specified bundle. @@ -3686,48 +4268,56 @@ declare namespace bundleManager { * @param { AsyncCallback } callback - Indicates the callback of getting AppProvisionInfo 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. Parameter bundleName is empty. * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function getAppProvisionInfo(bundleName: string, userId: int, callback: AsyncCallback): void; + function getAppProvisionInfoWithBundleNameUserIdCallback(bundleName: string, + userId: int, callback: AsyncCallback): void; /** * Obtains the profile file information of a specified bundle. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. - * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. * @returns { Promise } Returns the AppProvisionInfo 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; 3. Parameter bundleName is empty. * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function getAppProvisionInfo(bundleName: string, userId?: int): Promise; + function getAppProvisionInfoWithBundleNameUserIdReturnsPromise(bundleName: string, + userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAppProvisionInfo { + getAppProvisionInfoWithBundleNameCallback, + getAppProvisionInfoWithBundleNameUserIdCallback, + getAppProvisionInfoWithBundleNameUserIdReturnsPromise + } /** * Obtains the profile file information of a specified bundle. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. - * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. * @returns { AppProvisionInfo } Returns the AppProvisionInfo 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; 3. Parameter bundleName is empty. + * 2. Incorrect parameter types; 3. Parameter bundleName is empty. * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -3797,8 +4387,8 @@ declare namespace bundleManager { * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { ProfileType } profileType - Indicates the type of profile to be obtained. * @param { string } bundleName - Indicates the name of the bundle to which the profile belongs. - * @param { string } moduleName - Indicates the name of the module to which the profile belongs. - * @param { int } userId - Indicates the user ID or do not pass user ID. + * @param { string } [moduleName] - Indicates the name of the module to which the profile belongs. + * @param { int } [userId] - Indicates the user ID or do not pass user ID. * @returns { string } Returns string in json-format of the designated profile. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -3867,7 +4457,6 @@ declare namespace bundleManager { * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 20 - * @arkts 1.1&1.2 */ function enableDynamicIcon(bundleName: string, moduleName: string): Promise; @@ -3894,10 +4483,66 @@ declare namespace bundleManager { * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 20 - * @arkts 1.1&1.2 */ function enableDynamicIcon(bundleName: string, moduleName: string, option?: BundleOptions): Promise; + /** + * Enable dynamic icon. + * + * @permission ohos.permission.ACCESS_DYNAMIC_ICON + * @param { string } bundleName - Indicates the bundleName. + * @param { string } moduleName - Indicates the moduleName for extend resource. + * @returns { Promise } Returns enableDynamicIcon 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 } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700304 - Failed to enable the dynamic icon. + * @throws { BusinessError } 17700307 - Dynamic icons cannot take effect due to existing custom themes. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function enableDynamicIconWithBundleNameModuleNameReturnsPromise(bundleName: string, moduleName: string): Promise; + + /** + * Enable dynamic icon. + * If you need to enable dynamic icon under the current user, ohos.permission.ACCESS_DYNAMIC_ICON + * needs to be applied for. + * If you need to enable dynamic icon under other users, ohos.permission.ACCESS_DYNAMIC_ICON and + * ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS need to be applied for. + * + * @permission ohos.permission.ACCESS_DYNAMIC_ICON or (ohos.permission.ACCESS_DYNAMIC_ICON and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS) + * @param { string } bundleName - Indicates the bundleName. + * @param { string } moduleName - Indicates the moduleName for extend resource. + * @param { BundleOptions } [option] - Indicates the bundle option. + * @returns { Promise } Returns enableDynamicIcon 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 } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. + * @throws { BusinessError } 17700304 - Failed to enable the dynamic icon. + * @throws { BusinessError } 17700307 - Dynamic icons cannot take effect due to existing custom themes. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function enableDynamicIconWithBundleNameModuleNameOptionReturnsPromise(bundleName: string, + moduleName: string, option?: BundleOptions): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload enableDynamicIcon { + enableDynamicIconWithBundleNameModuleNameReturnsPromise, + enableDynamicIconWithBundleNameModuleNameOptionReturnsPromise + } + /** * Disable dynamic icon. * @@ -3911,8 +4556,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700305 - Failed to disable the dynamic icon. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function disableDynamicIcon(bundleName: string): Promise; @@ -3936,10 +4580,60 @@ declare namespace bundleManager { * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 20 - * @arkts 1.1&1.2 */ function disableDynamicIcon(bundleName: string, option?: BundleOptions): Promise; + /** + * Disable dynamic icon. + * + * @permission ohos.permission.ACCESS_DYNAMIC_ICON + * @param { string } bundleName - Indicates the bundleName. + * @returns { Promise } Returns disableDynamicIcon 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 } 17700305 - Failed to disable the dynamic icon. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function disableDynamicIconWithBundleNameReturnsPromise(bundleName: string): Promise; + + /** + * Disable dynamic icon. + * If you need to disable dynamic icon under the current user, ohos.permission.ACCESS_DYNAMIC_ICON + * needs to be applied for. + * If you need to disable dynamic icon under other users, ohos.permission.ACCESS_DYNAMIC_ICON and + * ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS need to be applied for. + * + * @permission ohos.permission.ACCESS_DYNAMIC_ICON or (ohos.permission.ACCESS_DYNAMIC_ICON and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS) + * @param { string } bundleName - Indicates the bundleName. + * @param { BundleOptions } [option] - Indicates the bundle option. + * @returns { Promise } Returns disableDynamicIcon 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 } 17700061 - AppIndex not in valid range. + * @throws { BusinessError } 17700305 - Failed to disable the dynamic icon. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function disableDynamicIconWithBundleNameOptionReturnsPromise(bundleName: string, + option?: BundleOptions): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload disableDynamicIcon { + disableDynamicIconWithBundleNameReturnsPromise, + disableDynamicIconWithBundleNameOptionReturnsPromise + } + /** * Get dynamic icon. * @@ -4022,8 +4716,7 @@ declare namespace bundleManager { * @throws { BusinessError } 17700201 - Failed to verify the abc file. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function verifyAbc(abcPaths: Array, deleteOriginalFiles: boolean, callback: AsyncCallback): void; @@ -4053,11 +4746,55 @@ declare namespace bundleManager { * @throws { BusinessError } 17700201 - Failed to verify the abc file. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function verifyAbc(abcPaths: Array, deleteOriginalFiles: boolean): Promise; + /** + * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. + * + * @permission ohos.permission.RUN_DYN_CODE + * @param { Array } abcPaths - The abc path. + * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. + * @param { AsyncCallback } callback - Indicates the callback of verifyAbc result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700201 - Failed to verify the abc file. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function verifyAbcWithAbcPathsDeleteOriginalFilesCallback(abcPaths: Array, + deleteOriginalFiles: boolean, callback: AsyncCallback): void; + + /** + * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. + * + * @permission ohos.permission.RUN_DYN_CODE + * @param { Array } abcPaths - The abc path. + * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. + * @returns { Promise } Returns verifyAbc result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700201 - Failed to verify the abc file. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function verifyAbcWithAbcPathsDeleteOriginalFilesReturnsPromise(abcPaths: Array, + deleteOriginalFiles: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload verifyAbc { + verifyAbcWithAbcPathsDeleteOriginalFilesCallback, + verifyAbcWithAbcPathsDeleteOriginalFilesReturnsPromise + } + /** * Obtains recoverable preinstalled applications. * @@ -4067,8 +4804,7 @@ declare namespace bundleManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getRecoverableApplicationInfo(callback: AsyncCallback>): void; @@ -4081,11 +4817,47 @@ declare namespace bundleManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getRecoverableApplicationInfo(): Promise>; + /** + * Obtains recoverable preinstalled applications. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { AsyncCallback> } callback - The callback of getting a list of RecoverableApplicationInfo 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 getRecoverableApplicationInfoWithCallback(callback: AsyncCallback>): void; + + /** + * Obtains recoverable preinstalled applications. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @returns { Promise> } Returns a list of RecoverableApplicationInfo 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 getRecoverableApplicationInfoReturnsPromise(): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getRecoverableApplicationInfo { + getRecoverableApplicationInfoWithCallback, + getRecoverableApplicationInfoReturnsPromise + } + /** * Set additional information to the specified application. * @@ -4185,7 +4957,7 @@ declare namespace bundleManager { * Get a list of developedId by distribution type. * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { int } appDistributionType - Indicates the distribution type of the application, and if not passed in, it gets all the developerId. + * @param { int } [appDistributionType] - Indicates the distribution type of the application, and if not passed in, it gets all the developerId. * @returns { Array } Returns a list of developerId. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. -- Gitee