| type| BundleChangedEvent| Yes | Type of the event to unsubscribe from. |
| callback | callback\<BundleChangedInfo>| No | Callback used for the unsubscription. If this parameter is left empty, all callbacks of the current event are unsubscribed from.|
| callback | callback\<BundleChangedInfo>| No | Callback used for the unsubscription. By default, no value is passed, and all callbacks of the current event are unsubscribed from.|
| hapFilePaths | Array\<string\> | Yes | Paths where the HAP files of the bundle are stored, which are the data directories. If only one directory is passed, the HAP files in the directory must belong to the same bundle and have the same signature.|
| installParam | [InstallParam](#installparam) | No | Parameters required for the installation. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the installation. For details about their default values, see [InstallParam](#installparam). |
**Return value**
...
...
@@ -252,6 +260,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700036 | Failed to install the HSP because lacks appropriate permissions. |
| 17700039 | Failed to install because disallow install a shared bundle by hapFilePaths. |
| 17700041 | Failed to install because enterprise device management disallow install. |
| 17700042 | Failed to install the HAP because of incorrect URI in the data proxy. |
| 17700043 | Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). |
| 17700044 | Failed to install the HAP because the isolationMode configured is not supported. |
| 17700047 | Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. |
**Example**
...
...
@@ -310,6 +322,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700004 | The specified user ID is not found. |
| 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. |
| 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. |
| 17700045 | Failed to uninstall because enterprise device management disallow uninstall. |
**Example**
...
...
@@ -367,6 +380,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700001 | The specified bundle name is not found. |
| 17700020 | The specified bundle is pre-installed bundle which cannot be uninstalled. |
| 17700040 | The specified bundle is a shared bundle which cannot be uninstalled. |
| 17700045 | Failed to uninstall because enterprise device management disallow uninstall. |
**Example**
...
...
@@ -407,7 +421,7 @@ Uninstalls a bundle. This API uses a promise to return the result.
| bundleName | string | Yes | Name of the target bundle. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the uninstall. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the uninstall. For details about their default values, see [InstallParam](#installparam). |
**Return value**
...
...
@@ -422,9 +436,10 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| bundleName | string | Yes | Name of the target bundle. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the recovery. |
| installParam | [InstallParam](#installparam) | No | Parameters required for the recovery. For details about their default values, see [InstallParam](#installparam). |
**Return value**
...
...
@@ -755,12 +770,12 @@ Defines the parameters that need to be specified for bundle installation, uninst
| userId | number | No | User ID. You can use [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user of the current process.|
| installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation.|
| isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall.|
| crowdtestDeadline| number | No |End date of crowdtesting.|
| sharedBundleDirPaths<sup>10+</sup> | Array\<String> | No|Paths of the shared bundle files.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. You can call [queryOsAccountLocalIdFromProcess](js-apis-osAccount.md#getOsAccountLocalId) to obtain the user ID of the current process.|
| installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation. The default value is **0**.|
| isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall. The default value is **false**.|
| hashParams | Array<[HashParam](#hashparam)> | No| Hash parameters. By default, no value is passed. |
| crowdtestDeadline| number | No |End date of crowdtesting. The default value is **-1**.|
| sharedBundleDirPaths<sup>10+</sup> | Array\<String> | No|Paths of the shared bundle files. By default, no value is passed.|
## UninstallParam<sup>10+</sup>
...
...
@@ -773,4 +788,4 @@ Defines the parameters required for the uninstallation of a shared bundle.
| bundleName | string | Yes | Name of the shared bundle. |
| versionCode | number | No | Version number of the shared bundle. If this parameter is not set, all shared bundles of the specified name are uninstalled.|
| versionCode | number | No | Version number of the shared bundle. By default, no value is passed, and all shared bundles of the specified name are uninstalled.|
| bundleName | string | Yes | Bundle name of the application. |
| moduleName | string | No | HAP name of the module with the overlay feature. If this parameter is not specified, the API obtains the information of all modules with the overlay feature in that application. |
| moduleName | string | No | HAP name of the module with the overlay feature. By default, no value is passed, and the API obtains the information of all modules with the overlay feature in that application. |
**Return value**
...
...
@@ -424,14 +424,14 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| targetBundleName | string | Yes | Bundle name of the application. |
| moduleName | string | No | HAP name of the target module, which is **targetModuleName** specified by modules with the overlay feature. If this parameter is not specified, the API obtains the information associated with all modules in that application. |
| moduleName | string | No | HAP name of the target module, which is **targetModuleName** specified by modules with the overlay feature. By default, no value is passed, and the API obtains the information associated with all modules in that application. |
**Return value**
...
...
@@ -574,21 +572,21 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
Obtains the information about modules with the overlay feature in another application based on the target module name. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned.
...
...
@@ -621,24 +619,24 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
Obtains the information about all modules with the overlay feature in another application. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned.
...
...
@@ -662,8 +660,6 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
@@ -586,11 +586,11 @@ The version of shared bundle is dependent on other applications.
**Description**
Other applications depend on the shared library, causing the uninstallation to fail.
Other applications depend on the shared library, causing the uninstall to fail.
**Possible Causes**
1. The version specified during the uninstallation is the latest version of the shared library, and the shared library is depended on by other applications.
2. No version is not specified during the uninstallation, meaning that all versions of the shared library will be uninstalled, and the shared library is depended on by other applications.
1. The version specified during the uninstall is the latest version of the shared library, and the shared library is depended on by other applications.
2. No version is not specified during the uninstall, meaning that all versions of the shared library will be uninstalled, and the shared library is depended on by other applications.
**Solution**
1. Check whether the shared library to uninstall is depended on by other applications.
...
...
@@ -607,7 +607,7 @@ The specified shared bundle does not exist.
The shared library to uninstall does not exist.
**Possible Causes**
1. The version specified during the uninstallation is different from the version of the shared library installed.
1. The version specified during the uninstall is different from the version of the shared library installed.
2. The shared library to uninstall is not installed.
**Solution**
...
...
@@ -649,3 +649,118 @@ During application uninstall, the bundle name of an inter-application shared lib
**Solution**
1. Use the **-s** parameter to specify the application to be uninstalled as a shared library application.
2. Use the **bundleName** and **versionCode** parameters in **UninstallParam** to specify the bundle name and version of the shared library to be uninstalled.
## 17700041 Application Installation Is Not Allowed by Enterprise Device Management
**Error Message**
Failed to install because enterprise device management disallow install.
**Description**
The installation of this application is prohibited by enterprise device management.
**Possible Causes**
The enterprise device management does not allow the installation of this application.
**Solution**
Check whether the application installation is prohibited by the enterprise device management.
## 17700042 Incorrect URI in the Data Proxy
**Error Message**
Failed to install the HAP because of incorrect URI in the data proxy.
**Description**
During application installation, the URI of the data proxy is incorrectly configured.
**Possible Causes**
1. The bundle name in the URI is different from that of the current application.
2. The URI is duplicate.
**Solution**
1. Change the bundle name in the URI to that of the current application.
2. Change duplicate URIs. Ensure that the URI of each data proxy is unique.
## 17700043 Incorrect Permission Configuration in the Data Proxy
**Error Message**
Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core).
**Description**
During application installation, the permission level of the data proxy of a non-system application is too low. The permission level should be **system_basic** or **system_core**.
**Possible Causes**
1. No permission is configured for the data proxy of a non-system application.
1. The permission level of the data proxy of a non-system application is too low.
**Solution**
1. Configure the read and write permissions in the data proxy.
2. Change the read and write permissions in the data proxy and ensure that the permission level is **system_basic** or **system_core**.
## 17700044 Field isolationMode in the HAP Conflicts with the Device Isolation Mode
**Error Message**
Failed to install the HAP because the isolationMode configured is not supported.
**Description**
During application installation, the value of **isolationMode** in the HAP conflicts with the isolation mode of the device.
**Possible Causes**
1. The device supports the isolation mode (the value of **supportIsolationMode** is **true**), whereas the value of **isolationMode** in the HAP is **nonisolationOnly**.
2. The device does not support the isolation mode (the value of **supportIsolationMode** is **false**), whereas the value of **isolationMode** in the HAP is **isolationOnly**.
**Solution**
Set the **isolationMode** field in the HAP based on the isolation mode of the device.
## 17700045 Application Uninstall Is Not Allowed by Enterprise Device Management
**Error Message**
Failed to uninstall because enterprise device management disallow uninstall.
**Description**
The uninstall of this application is prohibited by enterprise device management.
**Possible Causes**
The enterprise device management does not allow the uninstall of this application.
**Solution**
Check whether the application uninstall is prohibited by the enterprise device management.
## 17700047 Application Version To Be Updated Is Not Later Than the Current Version
**Error Message**
Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode.
**Description**
The version of the application to be updated is not later than the current version.
**Possible Causes**
1. The version number of the application to be updated is earlier than or equal to that of the current version number.
2. When **installFlag** is set to **NORMAL**, the version number of the application to be updated must be later than the installed version number.
**Solution**
1. Set the version number of the application to be later than the current version number.
2. If you want to update the application without changing the version number, set **installFlag** to **REPLACE_EXISTING**.