diff --git a/api/@ohos.bundle.appControl.d.ts b/api/@ohos.bundle.appControl.d.ts index 66ab0dc4ac569fdc19794d055a0fd7a1152097e6..cfb98b62f6895bbd83abb571251b693eb82561a0 100644 --- a/api/@ohos.bundle.appControl.d.ts +++ b/api/@ohos.bundle.appControl.d.ts @@ -337,8 +337,7 @@ declare namespace appControl { * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setDisposedStatus(appId: string, disposedWant: Want, callback: AsyncCallback): void; @@ -356,11 +355,56 @@ declare namespace appControl { * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setDisposedStatus(appId: string, disposedWant: Want): Promise; + /** + * Set the disposed status of a specified bundle. + * + * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS + * @param { string } appId - Indicates the app ID of the application. + * @param { Want } disposedWant - Indicates the disposed want. + * @param { AsyncCallback } callback - The callback of setting the disposed status 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 } 17700005 - The specified app ID is empty string. + * @syscap SystemCapability.BundleManager.BundleFramework.AppControl + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setDisposedStatusWithAppIdDisposedWantCallback(appId: string, + disposedWant: Want, callback: AsyncCallback): void; + + /** + * Set the disposed status of a specified bundle. + * + * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS + * @param { string } appId - Indicates the app ID of the application. + * @param { Want } disposedWant - Indicates the disposed want. + * @returns { Promise } The result of setting the disposed status of a specified bundle. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. + * @syscap SystemCapability.BundleManager.BundleFramework.AppControl + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setDisposedStatusWithAppIdDisposedWantReturnsPromise(appId: string, disposedWant: Want): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setDisposedStatus { + setDisposedStatusWithAppIdDisposedWantCallback, + setDisposedStatusWithAppIdDisposedWantReturnsPromise + } + /** * Set the disposed status of a specified bundle. * @@ -392,8 +436,7 @@ declare namespace appControl { * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDisposedStatus(appId: string, callback: AsyncCallback): void; @@ -410,11 +453,53 @@ declare namespace appControl { * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDisposedStatus(appId: string): Promise; + /** + * Obtains the disposed status of a specified bundle. + * + * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS + * @param { string } appId - Indicates the app ID of the application. + * @param { AsyncCallback } callback - The callback of getting the disposed status of a specified bundle 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 } 17700005 - The specified app ID is empty string. + * @syscap SystemCapability.BundleManager.BundleFramework.AppControl + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDisposedStatusWithAppIdCallback(appId: string, callback: AsyncCallback): void; + + /** + * Obtains the disposed status of a specified bundle. + * + * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS + * @param { string } appId - Indicates the app ID of the application. + * @returns { Promise } Returns the disposed status of a specified bundle. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. + * @syscap SystemCapability.BundleManager.BundleFramework.AppControl + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDisposedStatusWithAppIdReturnsPromise(appId: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getDisposedStatus { + getDisposedStatusWithAppIdCallback, + getDisposedStatusWithAppIdReturnsPromise + } + /** * Obtains the disposed status of a specified bundle. * @@ -446,8 +531,7 @@ declare namespace appControl { * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function deleteDisposedStatus(appId: string, callback: AsyncCallback): void; @@ -464,11 +548,53 @@ declare namespace appControl { * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function deleteDisposedStatus(appId: string): Promise; + /** + * Delete the disposed status of a specified bundle. + * + * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS + * @param { string } appId - Indicates the app ID of the application. + * @param { AsyncCallback } callback - the callback of deleting the disposed status of a specified bundle 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 } 17700005 - The specified app ID is empty string. + * @syscap SystemCapability.BundleManager.BundleFramework.AppControl + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function deleteDisposedStatusWithAppIdCallback(appId: string, callback: AsyncCallback): void; + + /** + * Delete the disposed status of a specified bundle. + * + * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS + * @param { string } appId - Indicates the app ID of the application. + * @returns { Promise } Returns the result of deleting the disposed status of a specified bundle. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. + * @syscap SystemCapability.BundleManager.BundleFramework.AppControl + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function deleteDisposedStatusWithAppIdReturnsPromise(appId: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload deleteDisposedStatus { + deleteDisposedStatusWithAppIdCallback, + deleteDisposedStatusWithAppIdReturnsPromise + } + /** * Delete the disposed status of a specified bundle. * @@ -592,7 +718,7 @@ declare namespace appControl { * @arkts 1.1&1.2 */ function setUninstallDisposedRule(appIdentifier: string, rule: UninstallDisposedRule, appIndex?: int): void; - + /** * Obtains the uninstall disposed rule of a specified bundle. * diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index f37ee52072b4c7ce1be256024d0f7b266cd1a9e4..e65cb15c6ebe735ba110ab59390e5a947430494e 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,24 +3079,102 @@ 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; /** - * 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. + * Query the ExtensionAbilityInfo by the given Want. * * @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. + * @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 } 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 + * @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. + * + * @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 } 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, callback: AsyncCallback): void; @@ -2657,11 +3188,47 @@ 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): 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 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. + * + * @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 } 17700021 - The uid is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @arkts 1.2 + */ + 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,8 +3539,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): Promise; @@ -2879,55 +3548,119 @@ declare namespace bundleManager { * * @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 } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function setApplicationEnabledSync(bundleName: string, isEnabled: boolean): void; + function setApplicationEnabledWithBundleNameAppIndexIsEnabledReturnsPromise(bundleName: string, + appIndex: int, isEnabled: boolean): Promise; /** - * Sets whether to enable a specified ability. + * Sets whether to enable a specified application. * * @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 { 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 ability enabled result. + * @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 } 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 } 17700003 - The specified abilityInfo is not found. - * @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 20 + * @arkts 1.2 */ - function setAbilityEnabled(info: AbilityInfo, appIndex: int, isEnabled: boolean): Promise; + function setApplicationEnabledWithBundleNameIsEnabledCallback(bundleName: string, + isEnabled: boolean, callback: AsyncCallback): void; /** - * Sets whether to enable a specified ability. + * Sets whether to enable a specified application. * * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE - * @param { AbilityInfo } info - Indicates information about the ability to set. + * @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 ability enabled result. + * @returns { Promise } set app enabled 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 } 17700001 - The specified bundleName is not found. - * @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 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. + * + * @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. + * @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. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function setApplicationEnabledSync(bundleName: string, isEnabled: boolean): 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 { 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 } 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 } 17700003 - The specified abilityInfo is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 12 + */ + function setAbilityEnabled(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 } 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 } 17700003 - The specified abilityInfo is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @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. * @@ -2980,8 +3780,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 +3794,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 +3808,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 +3896,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 +3911,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 +3926,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 +4020,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 +4039,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 +4060,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,23 +4072,96 @@ 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. - * @returns { Want } the Want for starting the application's main ability. + * @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 } 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 } 17700004 - The specified user ID is not found. * @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 20 + * @arkts 1.2 */ - function getLaunchWantForBundleSync(bundleName: string, userId?: int): Want; + function getLaunchWantForBundleWithBundleNameUserIdCallback(bundleName: string, + userId: int, callback: AsyncCallback): void; /** - * Obtains the Want for starting the main ability of own application. - * The main ability of an application is the ability that has the + * 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. + * @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 } 17700004 - The specified user ID is not found. + * @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 + */ + function getLaunchWantForBundleSync(bundleName: string, userId?: int): Want; + + /** + * Obtains the Want for starting the main ability of own application. + * 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. * * @returns { Want } the Want for starting the application's main ability. @@ -3225,8 +4202,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 +4235,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 +4304,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 +4345,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,11 +4376,53 @@ 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>; + /** + * 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. + * @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 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 { 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 + * @since 20 + * @arkts 1.2 + */ + function getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameReturnsPromise(moduleName: string, + extensionAbilityName: string, metadataName?: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getProfileByExtensionAbility { + getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameCallback, + getProfileByExtensionAbilityWithModuleNameExtensionAbilityNameMetadataNameReturnsPromise + } + /** * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. * @@ -3381,7 +4442,7 @@ 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. + * @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. @@ -3406,8 +4467,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 +4483,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 +4565,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 +4588,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 +4689,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 +4707,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 +4774,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 +4790,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 +4847,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 +4860,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 +5053,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 +5068,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 +5187,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 +5257,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 +5283,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 +5356,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 +5380,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 +5516,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 +5546,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 +5604,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 +5617,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 +5757,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. diff --git a/api/@ohos.bundle.bundleResourceManager.d.ts b/api/@ohos.bundle.bundleResourceManager.d.ts index d817c8e4e6d77e462142667878783d3813ac42a1..e37147f55cb3f8c7b65a7956b8fb4d064b220ff9 100644 --- a/api/@ohos.bundle.bundleResourceManager.d.ts +++ b/api/@ohos.bundle.bundleResourceManager.d.ts @@ -126,8 +126,7 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getBundleResourceInfo(bundleName: string, resourceFlags?: int): BundleResourceInfo; @@ -146,11 +145,57 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 17700061 - AppIndex not in valid range or not found. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function getBundleResourceInfo(bundleName: string, resourceFlags?: int, appIndex?: int): BundleResourceInfo; + /** + * Obtains the BundleResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL. + * + * @permission ohos.permission.GET_BUNDLE_RESOURCES + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } [resourceFlags] {@link ResourceFlag} - Indicates the flag used to specify information contained in the BundleResourceInfo object that will be returned. + * @returns { BundleResourceInfo } Returns the BundleResourceInfo 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. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundleResourceInfoWithBundleNameResourceFlags(bundleName: string, + resourceFlags?: int): BundleResourceInfo; + + /** + * Obtains the BundleResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL. + * + * @permission ohos.permission.GET_BUNDLE_RESOURCES + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } [resourceFlags] {@link ResourceFlag} - Indicates the flag used to specify information contained in the BundleResourceInfo object that will be returned. + * @param { int } [appIndex] - Indicates the index of the bundle,The default value is 0. + * @returns { BundleResourceInfo } Returns the BundleResourceInfo 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 } 17700061 - AppIndex not in valid range or not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundleResourceInfoWithBundleNameResourceFlagsAppIndex(bundleName: string, + resourceFlags?: int, appIndex?: int): BundleResourceInfo; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleResourceInfo { + getBundleResourceInfoWithBundleNameResourceFlags, + getBundleResourceInfoWithBundleNameResourceFlagsAppIndex + } + /** * Obtains the LauncherAbilityResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL. * @@ -164,8 +209,7 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getLauncherAbilityResourceInfo(bundleName: string, resourceFlags?: int): Array; @@ -185,11 +229,58 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 17700061 - AppIndex not in valid range or not found. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function getLauncherAbilityResourceInfo(bundleName: string, resourceFlags?: int, appIndex?: int): Array; + /** + * Obtains the LauncherAbilityResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL. + * + * @permission ohos.permission.GET_BUNDLE_RESOURCES + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } [resourceFlags] {@link ResourceFlag} - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo object that will be returned. + * @returns { Array } Returns a list of LauncherAbilityResourceInfo 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. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getLauncherAbilityResourceInfoWithBundleNameResourceFlags(bundleName: string, + resourceFlags?: int): Array; + + /** + * Obtains the LauncherAbilityResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL. + * + * @permission ohos.permission.GET_BUNDLE_RESOURCES + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { int } [resourceFlags] {@link ResourceFlag} - Indicates the flag used to specify information + *
contained in the LauncherAbilityResourceInfo object that will be returned. + * @param { int } [appIndex] - Indicates the index of the bundle,The default value is 0. + * @returns { Array } Returns a list of LauncherAbilityResourceInfo 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 } 17700061 - AppIndex not in valid range or not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getLauncherAbilityResourceInfoWithBundleNameResourceFlagsAppIndex(bundleName: string, + resourceFlags?: int, appIndex?: int): Array; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getLauncherAbilityResourceInfo { + getLauncherAbilityResourceInfoWithBundleNameResourceFlags, + getLauncherAbilityResourceInfoWithBundleNameResourceFlagsAppIndex + } + /** * Obtains BundleResourceInfo of all bundles available in the system. * @@ -201,8 +292,7 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getAllBundleResourceInfo(resourceFlags: int, callback: AsyncCallback>): void; @@ -217,11 +307,51 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getAllBundleResourceInfo(resourceFlags: int): Promise>; + /** + * Obtains BundleResourceInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES + * @param { int } resourceFlags {@link ResourceFlag} - Indicates the flag used to specify information contained in the BundleResourceInfo that will be returned. + * @param { AsyncCallback> } callback - The callback of getting a list of BundleResourceInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllBundleResourceInfoWithResourceFlagsCallback(resourceFlags: int, + callback: AsyncCallback>): void; + + /** + * Obtains BundleResourceInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES + * @param { int } resourceFlags {@link ResourceFlag} - Indicates the flag used to specify information contained in the BundleResourceInfo that will be returned. + * @returns { Promise> } Returns a list of BundleResourceInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllBundleResourceInfoWithResourceFlagsReturnsPromise( + resourceFlags: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllBundleResourceInfo { + getAllBundleResourceInfoWithResourceFlagsCallback, + getAllBundleResourceInfoWithResourceFlagsReturnsPromise + } + /** * Obtains LauncherAbilityResourceInfo of all launcher abilities available in the system. * @@ -233,8 +363,7 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getAllLauncherAbilityResourceInfo(resourceFlags: int, callback: AsyncCallback>): void; @@ -249,11 +378,51 @@ declare namespace bundleResourceManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @syscap SystemCapability.BundleManager.BundleFramework.Resource * @systemapi - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function getAllLauncherAbilityResourceInfo(resourceFlags: int): Promise>; + /** + * Obtains LauncherAbilityResourceInfo of all launcher abilities available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES + * @param { int } resourceFlags {@link ResourceFlag} - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo that will be returned. + * @param { AsyncCallback> } callback - The callback of getting a list of LauncherAbilityResourceInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllLauncherAbilityResourceInfoWithResourceFlagsCallback(resourceFlags: int, + callback: AsyncCallback>): void; + + /** + * Obtains LauncherAbilityResourceInfo of all launcher abilities available in the system. + * + * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES + * @param { int } resourceFlags {@link ResourceFlag} - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo that will be returned. + * @returns { Promise> } Returns a list of LauncherAbilityResourceInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllLauncherAbilityResourceInfoWithResourceFlagsReturnsPromise( + resourceFlags: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllLauncherAbilityResourceInfo { + getAllLauncherAbilityResourceInfoWithResourceFlagsCallback, + getAllLauncherAbilityResourceInfoWithResourceFlagsReturnsPromise + } + /** * Obtains the abilityResourceInfo of a specified bundle. * diff --git a/api/@ohos.bundle.defaultAppManager.d.ts b/api/@ohos.bundle.defaultAppManager.d.ts index c402034e9b8d8b16e1dda3992161cc6bc3c4857a..b138dca50e87f01e83cf6fff18929022e37ff5ed 100644 --- a/api/@ohos.bundle.defaultAppManager.d.ts +++ b/api/@ohos.bundle.defaultAppManager.d.ts @@ -122,8 +122,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function isDefaultApplication(type: string, callback: AsyncCallback): void; @@ -135,11 +134,43 @@ declare namespace defaultAppManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function isDefaultApplication(type: string): Promise; + /** + * Query whether the caller is default application based on type. + * + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { AsyncCallback } callback - The callback of querying default application result. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @since 20 + * @arkts 1.2 + */ + function isDefaultApplicationWithTypeCallback(type: string, callback: AsyncCallback): void; + + /** + * Query whether the caller is default application based on type. + * + * @param { string } type - Application type or a file type that conforms to media type format. + * @returns { Promise } Return true if caller is default application; return false otherwise. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @since 20 + * @arkts 1.2 + */ + function isDefaultApplicationWithTypeReturnsPromise(type: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload isDefaultApplication { + isDefaultApplicationWithTypeCallback, + isDefaultApplicationWithTypeReturnsPromise + } + /** * Query whether the caller is default application based on type. * @@ -169,8 +200,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700025 - The specified type is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDefaultApplication(type: string, userId: int, callback: AsyncCallback): void; @@ -188,8 +218,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700025 - The specified type is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDefaultApplication(type: string, callback: AsyncCallback): void; @@ -209,8 +238,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700025 - The specified type is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDefaultApplication(type: string, userId?: int): Promise; @@ -220,6 +248,75 @@ declare namespace defaultAppManager { * @permission ohos.permission.GET_DEFAULT_APPLICATION * @param { string } type - Application type or a file type that conforms to media type format. * @param { int } userId - Indicates the id for the user. + * @param { AsyncCallback } callback - The callback of the BundleInfo object 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 } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700023 - The specified default app does not exist. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDefaultApplicationWithTypeUserIdCallback(type: string, + userId: int, callback: AsyncCallback): void; + + /** + * Get default application based on type. + * + * @permission ohos.permission.GET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { AsyncCallback } callback - The callback of the BundleInfo object 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 } 17700023 - The specified default app does not exist. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDefaultApplicationWithTypeCallback(type: string, callback: AsyncCallback): void; + + /** + * Get default application based on type. + * + * @permission ohos.permission.GET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { int } [userId] - Indicates the id for the user. + * @returns { Promise } Return the BundleInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700023 - The specified default app does not exist. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDefaultApplicationWithTypeUserIdReturnsPromise(type: string, userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getDefaultApplication { + getDefaultApplicationWithTypeUserIdCallback, + getDefaultApplicationWithTypeCallback, + getDefaultApplicationWithTypeUserIdReturnsPromise + } + + /** + * Get default application based on type. + * + * @permission ohos.permission.GET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { int } [userId] - Indicates the id for the user. * @returns { BundleInfo } Return the BundleInfo object. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -252,8 +349,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700028 - The specified ability does not match the type. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setDefaultApplication(type: string, elementName: ElementName, userId: int, callback: AsyncCallback): void; @@ -273,8 +369,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700028 - The specified ability does not match the type. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCallback): void; @@ -295,8 +390,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700028 - The specified ability does not match the type. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setDefaultApplication(type: string, elementName: ElementName, userId?: int): Promise; @@ -307,6 +401,80 @@ declare namespace defaultAppManager { * @param { string } type - Application type or a file type that conforms to media type format. * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. * @param { int } userId - Indicates the id for the user. + * @param { AsyncCallback } callback - The callback of setting default application 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 } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @throws { BusinessError } 17700028 - The specified ability does not match the type. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setDefaultApplicationWithTypeElementNameUserIdCallback(type: string, + elementName: ElementName, userId: int, callback: AsyncCallback): void; + + /** + * Set default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. + * @param { AsyncCallback } callback - The callback of setting default application 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 } 17700025 - The specified type is invalid. + * @throws { BusinessError } 17700028 - The specified ability does not match the type. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setDefaultApplicationWithTypeElementNameCallback(type: string, + elementName: ElementName, callback: AsyncCallback): void; + + /** + * Set default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. + * @param { int } [userId] - Indicates the id for the user. + * @returns { Promise } The result of setting default application. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @throws { BusinessError } 17700028 - The specified ability does not match the type. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setDefaultApplicationWithTypeElementNameUserIdReturnsPromise(type: string, + elementName: ElementName, userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setDefaultApplication { + setDefaultApplicationWithTypeElementNameUserIdCallback, + setDefaultApplicationWithTypeElementNameCallback, + setDefaultApplicationWithTypeElementNameUserIdReturnsPromise + } + + /** + * Set default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. + * @param { int } [userId] - Indicates the id for the user. * @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. @@ -336,8 +504,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700025 - The specified type is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function resetDefaultApplication(type: string, userId: int, callback: AsyncCallback): void; @@ -354,8 +521,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700025 - The specified type is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function resetDefaultApplication(type: string, callback: AsyncCallback): void; @@ -374,8 +540,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700025 - The specified type is invalid. * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function resetDefaultApplication(type: string, userId?: int): Promise; @@ -385,6 +550,72 @@ declare namespace defaultAppManager { * @permission ohos.permission.SET_DEFAULT_APPLICATION * @param { string } type - Application type or a file type that conforms to media type format. * @param { int } userId - Indicates the id for the user. + * @param { AsyncCallback } callback - The callback of resetting default application 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 } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function resetDefaultApplicationWithTypeUserIdCallback(type: string, + userId: int, callback: AsyncCallback): void; + + /** + * Reset default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { AsyncCallback } callback - The callback of resetting default application 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 } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function resetDefaultApplicationWithTypeCallback(type: string, callback: AsyncCallback): void; + + /** + * Reset default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { int } [userId] - Indicates the id for the user. + * @returns { Promise } The result of resetting default application. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function resetDefaultApplicationWithTypeUserIdReturnsPromise(type: string, userId?: int): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload resetDefaultApplication { + resetDefaultApplicationWithTypeUserIdCallback, + resetDefaultApplicationWithTypeCallback, + resetDefaultApplicationWithTypeUserIdReturnsPromise + } + + /** + * Reset default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { int } [userId] - Indicates the id for the user. * @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. diff --git a/api/@ohos.bundle.distributedBundleManager.d.ts b/api/@ohos.bundle.distributedBundleManager.d.ts index a85231f931b605c07ccf6ffea065375f785df553..a7c2aefbef9edc17808d0d39392d6a331f9e9ef3 100644 --- a/api/@ohos.bundle.distributedBundleManager.d.ts +++ b/api/@ohos.bundle.distributedBundleManager.d.ts @@ -48,8 +48,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void; @@ -69,8 +68,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementName: ElementName): Promise; @@ -90,8 +88,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementNames: Array, callback: AsyncCallback>): void; @@ -112,8 +109,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementNames: Array): Promise>; @@ -134,8 +130,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCallback): void; @@ -157,8 +152,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise; @@ -179,8 +173,7 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementNames: Array, locale: string, callback: AsyncCallback>): void; @@ -202,11 +195,197 @@ declare namespace distributedBundleManager { * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getRemoteAbilityInfo(elementNames: Array, locale: string): Promise>; + /** + * Obtains information about the ability info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @param { AsyncCallback } callback - The callback of getting the ability info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithElementNameTypedElementNameCallbackOfRemoteAbilityInfo(elementName: ElementName, + callback: AsyncCallback): void; + + /** + * Obtains information about the ability info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @returns { Promise } Returns the ability info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithElementNameTypedElementNameReturnsPromiseOfRemoteAbilityInfo( + elementName: ElementName): Promise; + + /** + * Obtains information about the abilities info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @param { AsyncCallback> } callback - the callback of getting the abilities info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameCallbackOfArrayOfRemoteAbilityInfo( + elementNames: Array, callback: AsyncCallback>): void; + + /** + * Obtains information about the abilities info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @returns { Promise> } The result of getting the abilities info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameReturnsPromiseOfArrayOfRemoteAbilityInfo( + elementNames: Array): Promise>; + + /** + * Obtains information about the ability info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @param { string } locale - Indicates the locale info + * @param { AsyncCallback } callback - The callback of getting the ability info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithElementNameLocaleCallbackOfRemoteAbilityInfo(elementName: ElementName, + locale: string, callback: AsyncCallback): void; + + /** + * Obtains information about the ability info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @param { string } locale - Indicates the locale info + * @returns { Promise } The result of getting the ability info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithElementNameLocaleReturnsPromiseOfRemoteAbilityInfo(elementName: ElementName, + locale: string): Promise; + + /** + * Obtains information about the ability info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @param { string } locale - Indicates the locale info + * @param { AsyncCallback> } callback - Returns the abilities info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameLocaleCallbackOfArrayOfRemoteAbilityInfo( + elementNames: Array, locale: string, callback: AsyncCallback>): void; + + /** + * Obtains information about the abilities info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @param { string } locale - Indicates the locale info + * @returns { Promise> } Returns the abilities info of the remote device. + * @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 bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameLocaleReturnsPromiseOfArrayOfRemoteAbilityInfo( + elementNames: Array, locale: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getRemoteAbilityInfo { + getRemoteAbilityInfoWithElementNameTypedElementNameCallbackOfRemoteAbilityInfo, + getRemoteAbilityInfoWithElementNameTypedElementNameReturnsPromiseOfRemoteAbilityInfo, + getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameCallbackOfArrayOfRemoteAbilityInfo, + getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameReturnsPromiseOfArrayOfRemoteAbilityInfo, + getRemoteAbilityInfoWithElementNameLocaleCallbackOfRemoteAbilityInfo, + getRemoteAbilityInfoWithElementNameLocaleReturnsPromiseOfRemoteAbilityInfo, + getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameLocaleCallbackOfArrayOfRemoteAbilityInfo, + getRemoteAbilityInfoWithArrayOfElementNameTypedElementNameLocaleReturnsPromiseOfArrayOfRemoteAbilityInfo + } + /** * Contains basic remote ability information. * diff --git a/api/@ohos.bundle.freeInstall.d.ts b/api/@ohos.bundle.freeInstall.d.ts index bf7aeb18139974092f460e5dc01f183593d4e2b2..d4b53f31a153f7b9c7f2801b1595faa2ee6cc8a2 100644 --- a/api/@ohos.bundle.freeInstall.d.ts +++ b/api/@ohos.bundle.freeInstall.d.ts @@ -144,8 +144,7 @@ declare namespace freeInstall { * @throws { BusinessError } 17700002 - The specified module name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback): void; @@ -166,11 +165,61 @@ declare namespace freeInstall { * @throws { BusinessError } 17700002 - The specified module name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise; + /** + * Sets whether to upgrade the module. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { UpgradeFlag } upgradeFlag - Indicates upgradeFlag of the application. + * @param { AsyncCallback } callback - The callback of setting module upgrade flag 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 bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setHapModuleUpgradeFlagWithBundleNameModuleNameUpgradeFlagCallback(bundleName: string, + moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback): void; + + /** + * Sets whether to upgrade the module. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { UpgradeFlag } upgradeFlag - Indicates upgradeFlag of the application. + * @returns { Promise } - Return the result of setting module upgrade flag. + * @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 bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setHapModuleUpgradeFlagBundleNameModuleNameUpgradeFlagReturnsPromise(bundleName: string, + moduleName: string, upgradeFlag: UpgradeFlag): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setHapModuleUpgradeFlag { + setHapModuleUpgradeFlagWithBundleNameModuleNameUpgradeFlagCallback, + setHapModuleUpgradeFlagBundleNameModuleNameUpgradeFlagReturnsPromise + } + /** * Checks whether a specified module is removable. * @@ -187,8 +236,7 @@ declare namespace freeInstall { * @throws { BusinessError } 17700002 - The specified module name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function isHapModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback): void; @@ -207,11 +255,60 @@ declare namespace freeInstall { * @throws { BusinessError } 17700002 - The specified module name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function isHapModuleRemovable(bundleName: string, moduleName: string): Promise; + /** + * Checks whether a specified module is removable. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { AsyncCallback } callback - The callback of checking module removable result. + * The result is true if the module is removable, false otherwise. + * @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 bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function isHapModuleRemovableWithBundleNameModuleNameCallback(bundleName: string, + moduleName: string, callback: AsyncCallback): void; + + /** + * Checks whether a specified module is removable. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @returns { Promise } Returns true if the module is removable; returns false otherwise. + * @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 bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function isHapModuleRemovableWithBundleNameModuleNameReturnsPromise(bundleName: string, + moduleName: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload isHapModuleRemovable { + isHapModuleRemovableWithBundleNameModuleNameCallback, + isHapModuleRemovableWithBundleNameModuleNameReturnsPromise + } + /** * Obtains bundlePackInfo based on bundleName and bundlePackFlags. * @@ -226,8 +323,7 @@ declare namespace freeInstall { * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getBundlePackInfo(bundleName: string, bundlePackFlag: BundlePackFlag, callback: AsyncCallback): void; @@ -246,11 +342,57 @@ declare namespace freeInstall { * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getBundlePackInfo(bundleName: string, bundlePackFlag: BundlePackFlag): Promise; + /** + * Obtains bundlePackInfo based on bundleName and bundlePackFlags. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { BundlePackFlag } bundlePackFlag - Indicates the application bundle pack flag to be queried. + * @param { AsyncCallback } callback - The callback of getting the BundlePackInfo object 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 bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundlePackInfoWithBundleNameBundlePackFlagCallback(bundleName: string, + bundlePackFlag: BundlePackFlag, callback: AsyncCallback): void; + + /** + * Obtains bundlePackInfo based on bundleName and bundlePackFlags. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { BundlePackFlag } bundlePackFlag - Indicates the application bundle pack flag to be queried. + * @returns { Promise } Returns the BundlePackInfo object. + * @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 bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundlePackInfoWithBundleNameBundlePackFlagReturnsPromise(bundleName: string, + bundlePackFlag: BundlePackFlag): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundlePackInfo { + getBundlePackInfoWithBundleNameBundlePackFlagCallback, + getBundlePackInfoWithBundleNameBundlePackFlagReturnsPromise + } + /** * Obtains information about the dispatcher version. * @@ -261,8 +403,7 @@ declare namespace freeInstall { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDispatchInfo(callback: AsyncCallback): void; @@ -276,11 +417,49 @@ declare namespace freeInstall { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getDispatchInfo(): Promise; + /** + * Obtains information about the dispatcher version. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { AsyncCallback } callback - The callback of getting the dispatchInfo object for the current ability result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDispatchInfoWithCallback(callback: AsyncCallback): void; + + /** + * Obtains information about the dispatcher version. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @returns { Promise } Returns the DispatchInfo object for the current ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getDispatchInfoReturnsPromise(): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getDispatchInfo { + getDispatchInfoWithCallback, + getDispatchInfoReturnsPromise + } + /** * The dispatch info class. * diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index f2c586bd4368ba2302dfbb5901cb75db32265f83..f15e662c63c2d1a9a6ce27911cd67fd6020d521a 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -38,8 +38,7 @@ declare namespace installer { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. 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 getBundleInstaller(callback: AsyncCallback): void; @@ -50,11 +49,43 @@ declare namespace installer { * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getBundleInstaller(): Promise; + /** + * Obtains the interface used to install bundle. + * + * @param { AsyncCallback } callback - The callback of BundleInstaller object. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundleInstallerWithCallback(callback: AsyncCallback): void; + + /** + * Obtains the interface used to install bundle. + * + * @returns { Promise } BundleInstaller object. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getBundleInstallerReturnsPromise(): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getBundleInstaller { + getBundleInstallerWithCallback, + getBundleInstallerReturnsPromise + } + /** * Obtains the interface used to install bundle. * @@ -368,8 +399,7 @@ declare namespace installer { * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ install(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback): void; @@ -646,8 +676,7 @@ declare namespace installer { * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ install(hapFilePaths: Array, callback: AsyncCallback): void; @@ -942,11 +971,167 @@ declare namespace installer { * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ install(hapFilePaths: Array, installParam?: InstallParam): Promise; + /** + * Install HAPs for an application. + * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. + * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. + * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. + * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. + * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { InstallParam } installParam - Indicates other parameters required for the installation. + * @param { AsyncCallback } callback - The callback of installing HAPs result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or + * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. + * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. + * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. + * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. + * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same + *
bundle name but different signature information exists on the device. + * @throws { BusinessError } 17700076 - Failed to install the HAP or HSP because the app distribution type is not allowed. + * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + installWithHapFilePathsInstallParamCallback(hapFilePaths: Array, + installParam: InstallParam, callback: AsyncCallback): void; + + /** + * Install HAPs for an application. + * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. + * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. + * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. + * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. + * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { AsyncCallback } callback - The callback of installing HAPs result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or + * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. + * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. + * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. + * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. + * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same + *
bundle name but different signature information exists on the device. + * @throws { BusinessError } 17700076 - Failed to install the HAP or HSP because the app distribution type is not allowed. + * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + installWithHapFilePathsCallback(hapFilePaths: Array, callback: AsyncCallback): void; + + /** + * Install haps for an application. + * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. + * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. + * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. + * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. + * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or + * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. + * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. + * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. + * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. + * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same + *
bundle name but different signature information exists on the device. + * @throws { BusinessError } 17700076 - Failed to install the HAP or HSP because the app distribution type is not allowed. + * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + installWithHapFilePathsInstallParamReturnsPromise(hapFilePaths: Array, + installParam?: InstallParam): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload install { + installWithHapFilePathsInstallParamCallback, + installWithHapFilePathsCallback, + installWithHapFilePathsInstallParamReturnsPromise + } + /** * Uninstall an application. * @@ -1027,8 +1212,7 @@ declare namespace installer { * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'15', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ uninstall(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; @@ -1084,8 +1268,7 @@ declare namespace installer { * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'13', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ uninstall(bundleName: string, callback: AsyncCallback): void; @@ -1169,8 +1352,7 @@ declare namespace installer { * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'15', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ uninstall(bundleName: string, installParam?: InstallParam): Promise; @@ -1226,8 +1408,7 @@ declare namespace installer { *
bundle name but different signature information exists on the device. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; @@ -1277,8 +1458,7 @@ declare namespace installer { *
bundle name but different signature information exists on the device. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ recover(bundleName: string, callback: AsyncCallback): void; @@ -1334,11 +1514,85 @@ declare namespace installer { *
bundle name but different signature information exists on the device. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ recover(bundleName: string, installParam?: InstallParam): Promise; + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { InstallParam } installParam - Indicates other parameters required for the recover. + * @param { AsyncCallback } callback - The callback of recovering application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same + *
bundle name but different signature information exists on the device. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + recoverWithBundleNameInstallParamCallback(bundleName: string, + installParam: InstallParam, callback: AsyncCallback): void; + + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { AsyncCallback } callback - The callback of recovering application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same + *
bundle name but different signature information exists on the device. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + recoverWithBundleNameCallback(bundleName: string, callback: AsyncCallback): void; + + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { InstallParam } [installParam] - Indicates other parameters required for the recover. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same + *
bundle name but different signature information exists on the device. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + recoverWithBundleNameInstallParamReturnsPromise(bundleName: string, installParam?: InstallParam): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload recover { + recoverWithBundleNameInstallParamCallback, + recoverWithBundleNameCallback, + recoverWithBundleNameInstallParamReturnsPromise + } + /** * Uninstall a shared bundle. * @@ -1353,8 +1607,7 @@ declare namespace installer { * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ uninstall(uninstallParam: UninstallParam, callback: AsyncCallback): void; @@ -1372,11 +1625,128 @@ declare namespace installer { * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ uninstall(uninstallParam: UninstallParam): Promise; + /** + * Uninstall an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { InstallParam } installParam - Indicates other parameters required for the uninstallation. + * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. + * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. + * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. + * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. + * @throws { BusinessError } 17700062 - Failed to uninstall the app because the app is locked. + * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + uninstallWithBundleNameInstallParamCallback(bundleName: string, + installParam: InstallParam, callback: AsyncCallback): void; + + /** + * Uninstall an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. + * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. + * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. + * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. + * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + uninstallWithBundleNameCallback(bundleName: string, callback: AsyncCallback): void; + + /** + * Uninstall an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { InstallParam } [installParam] - Indicates other parameters required for the uninstallation. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. + * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. + * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. + * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. + * @throws { BusinessError } 17700062 - Failed to uninstall the app because the app is locked. + * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + uninstallWithBundleNameInstallParamReturnsPromise(bundleName: string, installParam?: InstallParam): Promise; + + /** + * Uninstall a shared bundle. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE + * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. + * @param { AsyncCallback } callback - The callback of uninstalling shared bundle result. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. + * @throws { BusinessError } 17700037 - The version of shared bundle is dependent on other applications. + * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + uninstallWithUninstallParamCallback(uninstallParam: UninstallParam, callback: AsyncCallback): void; + + /** + * Uninstall a shared bundle. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE + * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. + * @throws { BusinessError } 17700037 - The version of shared bundle is dependent on other applications. + * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + uninstallWithUninstallParamReturnsPromise(uninstallParam: UninstallParam): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload uninstall { + uninstallWithBundleNameInstallParamCallback, + uninstallWithBundleNameCallback, + uninstallWithBundleNameInstallParamReturnsPromise, + uninstallWithUninstallParamCallback, + uninstallWithUninstallParamReturnsPromise + } + /** * Updates this enterprise application. * @@ -1445,8 +1815,7 @@ declare namespace installer { * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ updateBundleForSelf(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback): void; @@ -1510,8 +1879,7 @@ declare namespace installer { * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ updateBundleForSelf(hapFilePaths: Array, callback: AsyncCallback): void; @@ -1583,11 +1951,125 @@ declare namespace installer { * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ updateBundleForSelf(hapFilePaths: Array, installParam?: InstallParam): Promise; + /** + * Updates this enterprise application. + * + * @permission ohos.permission.INSTALL_SELF_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { InstallParam } installParam - Indicates other parameters required for the installation. + * @param { AsyncCallback } callback - Indicates the callback used to return the HAP installation result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + updateBundleForSelfWithHapFilePathsInstallParamCallback(hapFilePaths: Array, + installParam: InstallParam, callback: AsyncCallback): void; + + /** + * Updates this enterprise application. + * + * @permission ohos.permission.INSTALL_SELF_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { AsyncCallback } callback - Indicates the callback used to return the HAP installation result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + updateBundleForSelfWithHapFilePathsCallback(hapFilePaths: Array, callback: AsyncCallback): void; + + /** + * Updates this enterprise application. + * + * @permission ohos.permission.INSTALL_SELF_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + updateBundleForSelfWithHapFilePathsInstallParamReturnsPromise(hapFilePaths: Array, + installParam?: InstallParam): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload updateBundleForSelf { + updateBundleForSelfWithHapFilePathsInstallParamCallback, + updateBundleForSelfWithHapFilePathsCallback, + updateBundleForSelfWithHapFilePathsInstallParamReturnsPromise + } + /** * Uninstall updates for a pre-installed application. * @@ -1610,7 +2092,7 @@ declare namespace installer { * * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled updates. - * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. + * @param { InstallParam } [installParam] - Indicates other parameters required for the uninstall. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. diff --git a/api/@ohos.bundle.launcherBundleManager.d.ts b/api/@ohos.bundle.launcherBundleManager.d.ts index 71215a818969cdc4ef3244855649c59ef06ac02c..cea68b93588cfcf301fa25590cac36ef352e0662 100644 --- a/api/@ohos.bundle.launcherBundleManager.d.ts +++ b/api/@ohos.bundle.launcherBundleManager.d.ts @@ -50,8 +50,7 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getLauncherAbilityInfo(bundleName: string, userId: int, callback: AsyncCallback>): void; @@ -71,11 +70,59 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getLauncherAbilityInfo(bundleName: string, userId: int): Promise>; + /** + * Obtains launcher abilities info based on a given bundleName and userId. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback -The callback of the LauncherAbilityInfo object result. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getLauncherAbilityInfoWithBundleNameUserIdCallback(bundleName: string, + userId: int, callback: AsyncCallback>): void; + + /** + * Obtains launcher abilities info based on a given bundleName and userId. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { int } userId - Indicates the id for the user. + * @returns { Promise> } the LauncherAbilityInfo object. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getLauncherAbilityInfoWithBundleNameUserIdReturnsPromise(bundleName: string, + userId: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getLauncherAbilityInfo { + getLauncherAbilityInfoWithBundleNameUserIdCallback, + getLauncherAbilityInfoWithBundleNameUserIdReturnsPromise + } + /** * Obtains launcher abilities info based on a given bundleName and userId. * @@ -106,8 +153,7 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllLauncherAbilityInfo(userId: int, callback: AsyncCallback>): void; @@ -124,11 +170,54 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getAllLauncherAbilityInfo(userId: int): Promise>; + /** + * Obtains launcher abilities info based on a given userId. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { int } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback -The callback of the LauncherAbilityInfo object result. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllLauncherAbilityInfoWithUserIdCallback(userId: int, + callback: AsyncCallback>): void; + + /** + * Obtains launcher abilities info based on a given userId. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { int } userId - Indicates the id for the user. + * @returns { Promise> } the LauncherAbilityInfo object. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getAllLauncherAbilityInfoWithUserIdReturnsPromise(userId: int): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllLauncherAbilityInfo { + getAllLauncherAbilityInfoWithUserIdCallback, + getAllLauncherAbilityInfoWithUserIdReturnsPromise + } + /** * Obtains shortcut info based on a given bundleName. * @@ -142,8 +231,7 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getShortcutInfo(bundleName: string, callback: AsyncCallback>): void; @@ -160,11 +248,54 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function getShortcutInfo(bundleName: string): Promise>; + /** + * Obtains shortcut info based on a given bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { AsyncCallback> } callback -The callback of the ShortcutInfo object result. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getShortcutInfoWithBundleNameCallback(bundleName: string, + callback: AsyncCallback>): void; + + /** + * Obtains shortcut info based on a given bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @returns { Promise> } the LauncherShortcutInfo object. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getShortcutInfoWithBundleNameReturnsPromise(bundleName: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getShortcutInfo { + getShortcutInfoWithBundleNameCallback, + getShortcutInfoWithBundleNameReturnsPromise + } + /** * Obtains shortcut info based on a given bundleName. * @@ -178,12 +309,10 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getShortcutInfoSync(bundleName: string): Array; - /** * Obtains shortcut info based on bundleName and userId. * @@ -199,11 +328,55 @@ declare namespace launcherBundleManager { * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi - * @since arkts {'1.1':'13', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ function getShortcutInfoSync(bundleName: string, userId: int): Array; + /** + * Obtains shortcut info based on a given bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @returns { Array } the LauncherShortcutInfo object. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getShortcutInfoSyncWithBundleName(bundleName: string): Array; + + /** + * Obtains shortcut info based on bundleName and userId. + * + * @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 } userId - Indicates the user ID. + * @returns { Array } the LauncherShortcutInfo object. + * @throws { BusinessError } 201 - Verify permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getShortcutInfoSyncWithBundleNameUserId(bundleName: string, userId: int): Array; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getShortcutInfoSync { + getShortcutInfoSyncWithBundleName, + getShortcutInfoSyncWithBundleNameUserId + } + /** * Obtains shortcut info based on bundleName and appIndex. * diff --git a/api/@ohos.bundle.overlay.d.ts b/api/@ohos.bundle.overlay.d.ts index f4bcece3b431ce1b9c80ccbb7041a6bda3a6821c..9f9d769d88c95d750e5658c5a850f78e1b5860ec 100755 --- a/api/@ohos.bundle.overlay.d.ts +++ b/api/@ohos.bundle.overlay.d.ts @@ -45,8 +45,7 @@ declare namespace overlay { * @throws { BusinessError } 17700002 - The specified module name is not found. * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function setOverlayEnabled(moduleName: string, isEnabled: boolean, callback: AsyncCallback): void; @@ -60,11 +59,49 @@ declare namespace overlay { * @throws { BusinessError } 17700002 - The specified module name is not found. * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function setOverlayEnabled(moduleName: string, isEnabled: boolean): Promise; + /** + * Set enabled state of overlay module based on specified moduleName. + * + * @param { string } moduleName - Indicates the module name of the overlay module to be set. + * @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature. + * @param { AsyncCallback } callback - The callback of setting specified overlay module enabled state result. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 20 + * @arkts 1.2 + */ + function setOverlayEnabledWithModuleNameIsEnabledCallback(moduleName: string, + isEnabled: boolean, callback: AsyncCallback): void; + + /** + * Set enabled state of overlay module based on specified moduleName. + * + * @param { string } moduleName - Indicates the module name of the overlay module to be set. + * @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 20 + * @arkts 1.2 + */ + function setOverlayEnabledWithModuleNameIsEnabledReturnsPromise(moduleName: string, + isEnabled: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setOverlayEnabled { + setOverlayEnabledWithModuleNameIsEnabledCallback, + setOverlayEnabledWithModuleNameIsEnabledReturnsPromise + } + /** * Set enabled state of overlay module based on specified bundleName and moduleName. * @@ -82,8 +119,7 @@ declare namespace overlay { * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function setOverlayEnabledByBundleName(bundleName: string, moduleName: string, isEnabled: boolean, callback: AsyncCallback): void; @@ -105,11 +141,63 @@ declare namespace overlay { * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function setOverlayEnabledByBundleName(bundleName: string, moduleName: string, isEnabled: boolean): Promise; + /** + * Set enabled state of overlay module based on specified bundleName and moduleName. + * + * @permission ohos.permission.CHANGE_OVERLAY_ENABLED_STATE + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be set. + * @param { string } moduleName - Indicates the module name of the overlay module to be set. + * @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature. + * @param { AsyncCallback } callback - The callback of setting specified overlay module enabled state 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 module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setOverlayEnabledByBundleNameWithBundleNameModuleNameIsEnabledCallback(bundleName: string, + moduleName: string, isEnabled: boolean, callback: AsyncCallback): void; + + /** + * Set enabled state of overlay module based on specified bundleName and moduleName. + * + * @permission ohos.permission.CHANGE_OVERLAY_ENABLED_STATE + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be set. + * @param { string } moduleName - Indicates the module name of the overlay module to be set. + * @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature. + * @returns { Promise } the promise returned by the function. + * @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 module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function setOverlayEnabledByBundleNameWithBundleNameModuleNameIsEnabledReturnsPromise(bundleName: string, + moduleName: string, isEnabled: boolean): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload setOverlayEnabledByBundleName { + setOverlayEnabledByBundleNameWithBundleNameModuleNameIsEnabledCallback, + setOverlayEnabledByBundleNameWithBundleNameModuleNameIsEnabledReturnsPromise + } + /** * Obtain the OverlayModuleInfo of current application based on moduleName. * @@ -120,8 +208,7 @@ declare namespace overlay { * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getOverlayModuleInfo(moduleName: string, callback: AsyncCallback): void; @@ -135,11 +222,48 @@ declare namespace overlay { * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getOverlayModuleInfo(moduleName: string): Promise; + /** + * Obtain the OverlayModuleInfo of current application based on moduleName. + * + * @param { string } moduleName - Indicates the module name of the overlay module to be queried. + * @param { AsyncCallback } callback - The callback of getting OverlayModuleInfo object. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 20 + * @arkts 1.2 + */ + function getOverlayModuleInfoWithModuleNameCallback(moduleName: string, + callback: AsyncCallback): void; + + /** + * Obtain the OverlayModuleInfo of current application based on moduleName. + * + * @param { string } moduleName - Indicates the module name of the overlay module to be queried. + * @returns { Promise } The result of getting OverlayModuleInfo object. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 20 + * @arkts 1.2 + */ + function getOverlayModuleInfoWithModuleNameReturnsPromise(moduleName: string): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getOverlayModuleInfo { + getOverlayModuleInfoWithModuleNameCallback, + getOverlayModuleInfoWithModuleNameReturnsPromise + } + /** * Obtain the OverlayModuleInfo of current application based on moduleName. * @@ -149,8 +273,7 @@ declare namespace overlay { * @throws { BusinessError } 17700002 - The specified module name is not found. * @throws { BusinessError } 17700034 - The specified module is an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getTargetOverlayModuleInfos(targetModuleName: string, callback: AsyncCallback>): void; @@ -164,11 +287,47 @@ declare namespace overlay { * @throws { BusinessError } 17700002 - The specified module name is not found. * @throws { BusinessError } 17700034 - The specified module is an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getTargetOverlayModuleInfos(targetModuleName: string): Promise>; + /** + * Obtain the OverlayModuleInfo of current application based on moduleName. + * + * @param { string } targetModuleName - Indicates the target module name of the target module to be queried. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo object. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700034 - The specified module is an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 20 + * @arkts 1.2 + */ + function getTargetOverlayModuleInfosWithTargetModuleNameCallback(targetModuleName: string, + callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of current application based on moduleName. + * + * @param { string } targetModuleName - Indicates the target module name of the target module to be queried. + * @returns { Promise> } Returns a list of OverlayModuleInfo object. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700034 - The specified module is an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 20 + * @arkts 1.2 + */ + function getTargetOverlayModuleInfosWithTargetModuleNameReturnsPromise( + targetModuleName: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getTargetOverlayModuleInfos { + getTargetOverlayModuleInfosWithTargetModuleNameCallback, + getTargetOverlayModuleInfosWithTargetModuleNameReturnsPromise + } + /** * Obtain the OverlayModuleInfo of the specified application based on bundleName. * @@ -182,8 +341,7 @@ declare namespace overlay { * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getOverlayModuleInfoByBundleName(bundleName: string, callback: AsyncCallback>): void; @@ -204,8 +362,7 @@ declare namespace overlay { * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getOverlayModuleInfoByBundleName(bundleName: string, moduleName: string, callback: AsyncCallback>): void; @@ -226,12 +383,81 @@ declare namespace overlay { * @throws { BusinessError } 17700033 - The specified module is not an overlay module. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getOverlayModuleInfoByBundleName(bundleName: string, moduleName?: string): Promise>; + /** + * Obtain the OverlayModuleInfo of the specified application based on bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo 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 } 17700032 - The specified bundle does not contain any overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getOverlayModuleInfoByBundleNameWithBundleNameCallback(bundleName: string, + callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of the specified application based on bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired. + * @param { string } moduleName - Indicates the module name of the overlay module to be queried. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo 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 } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getOverlayModuleInfoByBundleNameWithBundleNameModuleNameCallback(bundleName: string, + moduleName: string, callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of the specified application based on bundleName and moduleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired. + * @param { string } [moduleName] - Indicates the module name of the overlay module to be queried. + * @returns { Promise> } Returns a list of OverlayModuleInfo 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 } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getOverlayModuleInfoByBundleNameWithBundleNameModuleNameReturnsPromise(bundleName: string, + moduleName?: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getOverlayModuleInfoByBundleName { + getOverlayModuleInfoByBundleNameWithBundleNameCallback, + getOverlayModuleInfoByBundleNameWithBundleNameModuleNameCallback, + getOverlayModuleInfoByBundleNameWithBundleNameModuleNameReturnsPromise + } + /** * Obtain the OverlayModuleInfo of the specified target application based on bundleName. * @@ -245,8 +471,7 @@ declare namespace overlay { * @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, callback: AsyncCallback>): void; @@ -267,8 +492,7 @@ declare namespace overlay { * @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName: string, callback: AsyncCallback>): void; @@ -289,12 +513,81 @@ declare namespace overlay { * @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle. * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName?: string): Promise>; + /** + * Obtain the OverlayModuleInfo of the specified target application based on bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo 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 } 17700035 - The specified bundle is an overlay bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getTargetOverlayModuleInfosByBundleNameWithTargetBundleNameCallback(targetBundleName: string, + callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of the specified target application based on bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired. + * @param { string } moduleName - Indicates the module name of the overlay module to be queried. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo 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 } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700034 - The specified module is an overlay module. + * @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getTargetOverlayModuleInfosByBundleNameWithTargetBundleNameModuleNameCallback(targetBundleName: string, + moduleName: string, callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of the specified target application based on bundleName and moduleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired. + * @param { string } [moduleName] - Indicates the module name of the overlay module to be queried. + * @returns { Promise> } Returns a list of OverlayModuleInfo 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 } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700034 - The specified module is an overlay module. + * @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function getTargetOverlayModuleInfosByBundleNameWithTargetBundleNameModuleNameReturnsPromise(targetBundleName: string, + moduleName?: string): Promise>; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getTargetOverlayModuleInfosByBundleName { + getTargetOverlayModuleInfosByBundleNameWithTargetBundleNameCallback, + getTargetOverlayModuleInfosByBundleNameWithTargetBundleNameModuleNameCallback, + getTargetOverlayModuleInfosByBundleNameWithTargetBundleNameModuleNameReturnsPromise + } + /** * Obtains configuration information about a overlay hap module. * diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index bf438afc5d30393d4ed8d5f5ba47a39a028db0fa..c0a72b5671c87a7563ed264a1dcd0fd5ca91ca3f 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -1046,8 +1046,7 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function compressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback): void; @@ -1077,11 +1076,53 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function compressFile(inFile: string, outFile: string, options: Options): Promise; + /** + * Compress the specified file. + * + * @param { string } inFile - Indicates the path of the file to be compressed. + * @param { string } outFile - Indicates the path of the output compressed file. + * @param { Options } options - Indicates the options of compressing file. + * @param { AsyncCallback } callback - The callback of compressing file result. + * @throws { BusinessError } 900001 - The input source file is invalid. + * @throws { BusinessError } 900002 - The input destination file is invalid. + * @syscap SystemCapability.BundleManager.Zlib + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function compressFileWithInFileOutFileOptionsCallback(inFile: string, + outFile: string, options: Options, callback: AsyncCallback): void; + + /** + * Compress the specified file. + * + * @param { string } inFile - Indicates the path of the file to be compressed. + * @param { string } outFile - Indicates the path of the output compressed file. + * @param { Options } options - Indicates the options of compressing file. + * @returns { Promise } Returns the result of compressFile file. + * @throws { BusinessError } 900001 - The input source file is invalid. + * @throws { BusinessError } 900002 - The input destination file is invalid. + * @syscap SystemCapability.BundleManager.Zlib + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function compressFileWithInFileOutFileOptionsReturnsPromise(inFile: string, + outFile: string, options: Options): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload compressFile { + compressFileWithInFileOutFileOptionsCallback, + compressFileWithInFileOutFileOptionsReturnsPromise + } + /** * Compress the specified multiple files. * @@ -1140,8 +1181,7 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function decompressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback): void; @@ -1171,8 +1211,7 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function decompressFile(inFile: string, outFile: string, callback: AsyncCallback): void; @@ -1217,11 +1256,73 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function decompressFile(inFile: string, outFile: string, options?: Options): Promise; + /** + * Decompress the specified file. + * + * @param { string } inFile - Indicates the path of the file to be decompressed. + * @param { string } outFile - Indicates the path of the output decompressed file. + * @param { Options } options - Indicates the options of decompressing file. + * @param { AsyncCallback } callback - The callback of decompressing file result. + * @throws { BusinessError } 900001 - The input source file is invalid. + * @throws { BusinessError } 900002 - The input destination file is invalid. + * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. + * @syscap SystemCapability.BundleManager.Zlib + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function decompressFileWithInFileOutFileOptionsCallback(inFile: string, + outFile: string, options: Options, callback: AsyncCallback): void; + + /** + * Decompress the specified file. + * + * @param { string } inFile - Indicates the path of the file to be decompressed. + * @param { string } outFile - Indicates the path of the output decompressed file. + * @param { AsyncCallback } callback - The callback of decompressing file result. + * @throws { BusinessError } 900001 - The input source file is invalid. + * @throws { BusinessError } 900002 - The input destination file is invalid. + * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. + * @syscap SystemCapability.BundleManager.Zlib + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function decompressFileWithInFileOutFileCallback(inFile: string, + outFile: string, callback: AsyncCallback): void; + + /** + * Decompress the specified file. + * + * @param { string } inFile - Indicates the path of the file to be decompressed. + * @param { string } outFile - Indicates the path of the output decompressing file. + * @param { Options } [options] - Indicates the options of decompressing file. + * @returns { Promise } Returns the result of decompressing file. + * @throws { BusinessError } 900001 - The input source file is invalid. + * @throws { BusinessError } 900002 - The input destination file is invalid. + * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. + * @syscap SystemCapability.BundleManager.Zlib + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function decompressFileWithInFileOutFileOptionsReturnsPromise(inFile: string, + outFile: string, options?: Options): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload decompressFile { + decompressFileWithInFileOutFileOptionsCallback, + decompressFileWithInFileOutFileCallback, + decompressFileWithInFileOutFileOptionsReturnsPromise + } + /** * Get the original size of the compressed zip file, the size is the meta data stored in zip file. *