diff --git a/api/@ohos.bundle.appControl.d.ts b/api/@ohos.bundle.appControl.d.ts index d780a5e477cbe6e2bf80ebe2c5f72fcf3533c24b..f1d960578b5537c9960622dd4d539b97e8be0a66 100644 --- a/api/@ohos.bundle.appControl.d.ts +++ b/api/@ohos.bundle.appControl.d.ts @@ -33,7 +33,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified app ID is not found. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -49,7 +49,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified app ID is not found. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -64,7 +64,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified app ID is not found. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -79,7 +79,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified app ID is not found. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -94,7 +94,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified app ID is not found. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -109,7 +109,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified app ID is not found. + * @throws { BusinessError } 17700005 - The specified app ID is empty string. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index 50cc5f8742ca5684d082ee12936dd98da64a5120..91c2916a8b83bc99187f5daab3ff571c9555dede 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -67,14 +67,33 @@ declare namespace installer { * @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 } 17700101 - The system service is excepted. - * @throws { BusinessError } 17700103 - I/O operation is failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 */ install(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback) : void; + /** + * Install haps for an application. + * @permission ohos.permission.INSTALL_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'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @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. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + install(hapFilePaths: Array, installParam?: InstallParam) : Promise; + /** * Uninstall an application. * @permission ohos.permission.INSTALL_BUNDLE @@ -92,6 +111,23 @@ declare namespace installer { */ uninstall(bundleName: string, installParam: InstallParam, callback : AsyncCallback) : void; + /** + * Uninstall an application. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. + * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. + * @throws { BusinessError } 17700101 - The system service is excepted. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + uninstall(bundleName: string, installParam?: InstallParam) : Promise; + /** * recover an application. * @permission ohos.permission.INSTALL_BUNDLE @@ -106,6 +142,21 @@ declare namespace installer { * @since 9 */ recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; + + /** + * Recover an application. + * @permission ohos.permission.INSTALL_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'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + recover(bundleName: string, installParam?: InstallParam) : Promise; } /**