1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22 23/** 24 * Support install, upgrade, remove and recover bundles on the devices. 25 * 26 * @namespace installer 27 * @syscap SystemCapability.BundleManager.BundleFramework.Core 28 * @systemapi 29 * @since 9 30 */ 31declare namespace installer { 32 /** 33 * Obtains the interface used to install bundle. 34 * 35 * @param { AsyncCallback<BundleInstaller> } callback - The callback of BundleInstaller object. 36 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 37 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 38 * @syscap SystemCapability.BundleManager.BundleFramework.Core 39 * @systemapi 40 * @since 9 41 */ 42 function getBundleInstaller(callback: AsyncCallback<BundleInstaller>): void; 43 44 /** 45 * Obtains the interface used to install bundle. 46 * 47 * @returns { Promise<BundleInstaller> } BundleInstaller object. 48 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 49 * @syscap SystemCapability.BundleManager.BundleFramework.Core 50 * @systemapi 51 * @since 9 52 */ 53 function getBundleInstaller(): Promise<BundleInstaller>; 54 55 /** 56 * Obtains the interface used to install bundle. 57 * 58 * @returns { BundleInstaller } BundleInstaller object. 59 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 60 * @syscap SystemCapability.BundleManager.BundleFramework.Core 61 * @systemapi 62 * @since 10 63 */ 64 function getBundleInstallerSync(): BundleInstaller; 65 66 /** 67 * Bundle installer interface, include install uninstall recover. 68 * 69 * @interface BundleInstaller 70 * @syscap SystemCapability.BundleManager.BundleFramework.Core 71 * @systemapi 72 * @since 9 73 */ 74 interface BundleInstaller { 75 /** 76 * Install haps for an application. 77 * 78 * @permission ohos.permission.INSTALL_BUNDLE 79 * @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored. 80 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 81 * @param { AsyncCallback<void> } callback - The callback of installing haps result. 82 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 83 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 84 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 85 * @throws { BusinessError } 17700004 - The specified user ID is not found. 86 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 87 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 88 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 89 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 90 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 91 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 92 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 93 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 94 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 95 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 96 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 97 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 98 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 99 * (required APL: system_basic or system_core). 100 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 101 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 102 * @syscap SystemCapability.BundleManager.BundleFramework.Core 103 * @systemapi 104 * @since 9 105 */ 106 /** 107 * Install HAPs for an application. 108 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 109 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 110 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 111 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 112 * 113 * @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 114 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 115 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 116 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 117 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 118 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 119 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 120 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 121 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 122 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 123 * @throws { BusinessError } 17700004 - The specified user ID is not found. 124 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 125 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 126 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 127 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 128 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 129 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 130 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 131 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 132 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 133 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 134 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 135 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 136 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 137 * (required APL: system_basic or system_core). 138 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 139 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 140 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 141 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 142 * @syscap SystemCapability.BundleManager.BundleFramework.Core 143 * @systemapi 144 * @since 10 145 */ 146 /** 147 * Install HAPs for an application. 148 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 149 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 150 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 151 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 152 * 153 * @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 154 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 155 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 156 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 157 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 158 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 159 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 160 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 161 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 162 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 163 * @throws { BusinessError } 17700004 - The specified user ID is not found. 164 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 165 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 166 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 167 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 168 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 169 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 170 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 171 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 172 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 173 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 174 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 175 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 176 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 177 * (required APL: system_basic or system_core). 178 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 179 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 180 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 181 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 182 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 183 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 184 * @syscap SystemCapability.BundleManager.BundleFramework.Core 185 * @systemapi 186 * @since 11 187 */ 188 /** 189 * Install HAPs for an application. 190 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 191 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 192 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 193 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 194 * 195 * @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 196 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 197 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 198 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 199 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 200 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 201 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 202 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 203 * @throws { BusinessError } 17700004 - The specified user ID is not found. 204 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 205 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 206 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 207 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 208 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 209 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 210 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 211 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 212 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 213 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 214 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 215 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 216 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 217 * (required APL: system_basic or system_core). 218 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 219 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 220 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 221 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 222 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 223 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 224 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 225 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 226 * @syscap SystemCapability.BundleManager.BundleFramework.Core 227 * @systemapi 228 * @since 12 229 */ 230 /** 231 * Install HAPs for an application. 232 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 233 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 234 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 235 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 236 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 237 * 238 * @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 239 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 240 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 241 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 242 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 243 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 244 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 245 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 246 * @throws { BusinessError } 17700004 - The specified user ID is not found. 247 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 248 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 249 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 250 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 251 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 252 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 253 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 254 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 255 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 256 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 257 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 258 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 259 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 260 * (required APL: system_basic or system_core). 261 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 262 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 263 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 264 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 265 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 266 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 267 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 268 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 269 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 270 * <br>bundle name but different signature information exists on the device. 271 * @syscap SystemCapability.BundleManager.BundleFramework.Core 272 * @systemapi 273 * @since 13 274 */ 275 /** 276 * Install HAPs for an application. 277 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 278 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 279 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 280 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 281 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 282 * 283 * @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 284 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 285 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 286 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 287 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 288 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 289 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 290 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 291 * @throws { BusinessError } 17700004 - The specified user ID is not found. 292 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 293 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 294 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 295 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 296 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 297 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 298 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 299 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 300 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 301 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 302 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 303 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 304 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 305 * (required APL: system_basic or system_core). 306 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 307 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 308 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 309 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 310 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 311 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 312 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 313 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 314 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 315 * <br>bundle name but different signature information exists on the device. 316 * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. 317 * @syscap SystemCapability.BundleManager.BundleFramework.Core 318 * @systemapi 319 * @since 17 320 */ 321 /** 322 * Install HAPs for an application. 323 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 324 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 325 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 326 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 327 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 328 * 329 * @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 330 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 331 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 332 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 333 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 334 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 335 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 336 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 337 * @throws { BusinessError } 17700004 - The specified user ID is not found. 338 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 339 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 340 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 341 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 342 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 343 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 344 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 345 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 346 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 347 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 348 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 349 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 350 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 351 * (required APL: system_basic or system_core). 352 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 353 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 354 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 355 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 356 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 357 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 358 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 359 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 360 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 361 * <br>bundle name but different signature information exists on the device. 362 * @throws { BusinessError } 17700076 - Failed to install the HAP or HSP because the app distribution type is not allowed. 363 * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. 364 * @syscap SystemCapability.BundleManager.BundleFramework.Core 365 * @systemapi 366 * @since 18 367 */ 368 install(hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void; 369 370 /** 371 * Install haps for an application. 372 * 373 * @permission ohos.permission.INSTALL_BUNDLE 374 * @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored. 375 * @param { AsyncCallback<void> } callback - The callback of installing haps result. 376 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 377 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 378 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 379 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 380 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 381 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 382 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 383 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 384 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 385 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 386 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 387 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 388 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 389 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 390 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 391 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 392 * (required APL: system_basic or system_core). 393 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 394 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 395 * @syscap SystemCapability.BundleManager.BundleFramework.Core 396 * @systemapi 397 * @since 9 398 */ 399 /** 400 * Install HAPs for an application. 401 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 402 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 403 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 404 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 405 * 406 * @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 407 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 408 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 409 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 410 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 411 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 412 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 413 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 414 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 415 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 416 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 417 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 418 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 419 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 420 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 421 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 422 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 423 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 424 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 425 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 426 * (required APL: system_basic or system_core). 427 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 428 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 429 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 430 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 431 * @syscap SystemCapability.BundleManager.BundleFramework.Core 432 * @systemapi 433 * @since 10 434 */ 435 /** 436 * Install HAPs for an application. 437 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 438 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 439 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 440 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 441 * 442 * @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 443 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 444 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 445 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 446 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 447 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 448 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 449 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 450 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 451 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 452 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 453 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 454 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 455 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 456 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 457 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 458 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 459 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 460 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 461 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 462 * (required APL: system_basic or system_core). 463 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 464 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 465 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 466 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 467 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 468 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 469 * @syscap SystemCapability.BundleManager.BundleFramework.Core 470 * @systemapi 471 * @since 11 472 */ 473 /** 474 * Install HAPs for an application. 475 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 476 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 477 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 478 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 479 * 480 * @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 481 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 482 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 483 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 484 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 485 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 486 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 487 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 488 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 489 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 490 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 491 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 492 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 493 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 494 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 495 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 496 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 497 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 498 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 499 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 500 * (required APL: system_basic or system_core). 501 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 502 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 503 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 504 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 505 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 506 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 507 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 508 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 509 * @syscap SystemCapability.BundleManager.BundleFramework.Core 510 * @systemapi 511 * @since 12 512 */ 513 /** 514 * Install HAPs for an application. 515 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 516 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 517 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 518 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 519 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 520 * 521 * @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 522 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 523 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 524 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 525 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 526 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 527 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 528 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 529 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 530 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 531 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 532 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 533 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 534 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 535 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 536 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 537 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 538 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 539 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 540 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 541 * (required APL: system_basic or system_core). 542 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 543 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 544 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 545 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 546 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 547 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 548 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 549 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 550 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 551 * <br>bundle name but different signature information exists on the device. 552 * @syscap SystemCapability.BundleManager.BundleFramework.Core 553 * @systemapi 554 * @since 13 555 */ 556 /** 557 * Install HAPs for an application. 558 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 559 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 560 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 561 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 562 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 563 * 564 * @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 565 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 566 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 567 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 568 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 569 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 570 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 571 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 572 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 573 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 574 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 575 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 576 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 577 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 578 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 579 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 580 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 581 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 582 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 583 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 584 * (required APL: system_basic or system_core). 585 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 586 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 587 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 588 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 589 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 590 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 591 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 592 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 593 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 594 * <br>bundle name but different signature information exists on the device. 595 * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. 596 * @syscap SystemCapability.BundleManager.BundleFramework.Core 597 * @systemapi 598 * @since 17 599 */ 600 /** 601 * Install HAPs for an application. 602 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 603 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 604 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 605 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 606 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 607 * 608 * @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 609 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 610 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 611 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 612 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 613 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 614 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 615 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 616 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 617 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 618 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 619 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 620 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 621 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 622 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 623 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 624 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 625 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 626 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 627 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 628 * (required APL: system_basic or system_core). 629 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 630 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 631 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 632 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 633 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 634 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 635 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 636 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 637 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 638 * <br>bundle name but different signature information exists on the device. 639 * @throws { BusinessError } 17700076 - Failed to install the HAP or HSP because the app distribution type is not allowed. 640 * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. 641 * @syscap SystemCapability.BundleManager.BundleFramework.Core 642 * @systemapi 643 * @since 18 644 */ 645 install(hapFilePaths: Array<string>, callback: AsyncCallback<void>): void; 646 647 /** 648 * Install haps for an application. 649 * 650 * @permission ohos.permission.INSTALL_BUNDLE 651 * @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored. 652 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 653 * @returns { Promise<void> } 654 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 655 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 656 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 657 * @throws { BusinessError } 17700004 - The specified user ID is not found. 658 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 659 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 660 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 661 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 662 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 663 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 664 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 665 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 666 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 667 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 668 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 669 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 670 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 671 * (required APL: system_basic or system_core). 672 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 673 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 674 * @syscap SystemCapability.BundleManager.BundleFramework.Core 675 * @systemapi 676 * @since 9 677 */ 678 /** 679 * Install haps for an application. 680 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 681 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 682 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 683 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 684 * 685 * @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 686 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 687 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 688 * @returns { Promise<void> } 689 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 690 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 691 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 692 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 693 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 694 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 695 * @throws { BusinessError } 17700004 - The specified user ID is not found. 696 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 697 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 698 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 699 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 700 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 701 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 702 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 703 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 704 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 705 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 706 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 707 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 708 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 709 * (required APL: system_basic or system_core). 710 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 711 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 712 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 713 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 714 * @syscap SystemCapability.BundleManager.BundleFramework.Core 715 * @systemapi 716 * @since 10 717 */ 718 /** 719 * Install haps for an application. 720 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 721 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 722 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 723 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 724 * 725 * @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 726 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 727 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 728 * @returns { Promise<void> } 729 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 730 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 731 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 732 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 733 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 734 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 735 * @throws { BusinessError } 17700004 - The specified user ID is not found. 736 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 737 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 738 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 739 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 740 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 741 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 742 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 743 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 744 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 745 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 746 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 747 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 748 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 749 * (required APL: system_basic or system_core). 750 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 751 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 752 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 753 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 754 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 755 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 756 * @syscap SystemCapability.BundleManager.BundleFramework.Core 757 * @systemapi 758 * @since 11 759 */ 760 /** 761 * Install haps for an application. 762 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 763 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 764 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 765 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 766 * 767 * @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 768 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 769 * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. 770 * @returns { Promise<void> } 771 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 772 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 773 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 774 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 775 * @throws { BusinessError } 17700004 - The specified user ID is not found. 776 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 777 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 778 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 779 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 780 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 781 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 782 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 783 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 784 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 785 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 786 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 787 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 788 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 789 * (required APL: system_basic or system_core). 790 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 791 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 792 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 793 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 794 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 795 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 796 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 797 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 798 * @syscap SystemCapability.BundleManager.BundleFramework.Core 799 * @systemapi 800 * @since 12 801 */ 802 /** 803 * Install haps for an application. 804 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 805 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 806 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 807 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 808 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 809 * 810 * @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 811 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 812 * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. 813 * @returns { Promise<void> } 814 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 815 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 816 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 817 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 818 * @throws { BusinessError } 17700004 - The specified user ID is not found. 819 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 820 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 821 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 822 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 823 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 824 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 825 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 826 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 827 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 828 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 829 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 830 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 831 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 832 * (required APL: system_basic or system_core). 833 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 834 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 835 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 836 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 837 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 838 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 839 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 840 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 841 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 842 * <br>bundle name but different signature information exists on the device. 843 * @syscap SystemCapability.BundleManager.BundleFramework.Core 844 * @systemapi 845 * @since 13 846 */ 847 /** 848 * Install haps for an application. 849 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 850 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 851 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 852 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 853 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 854 * 855 * @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 856 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 857 * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. 858 * @returns { Promise<void> } 859 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 860 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 861 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 862 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 863 * @throws { BusinessError } 17700004 - The specified user ID is not found. 864 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 865 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 866 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 867 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 868 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 869 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 870 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 871 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 872 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 873 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 874 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 875 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 876 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 877 * (required APL: system_basic or system_core). 878 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 879 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 880 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 881 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 882 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 883 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 884 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 885 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 886 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 887 * <br>bundle name but different signature information exists on the device. 888 * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. 889 * @syscap SystemCapability.BundleManager.BundleFramework.Core 890 * @systemapi 891 * @since 17 892 */ 893 /** 894 * Install haps for an application. 895 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 896 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 897 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 898 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 899 * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. 900 * 901 * @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 902 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 903 * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. 904 * @returns { Promise<void> } 905 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 906 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 907 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 908 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 909 * @throws { BusinessError } 17700004 - The specified user ID is not found. 910 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 911 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 912 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 913 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 914 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 915 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 916 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 917 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 918 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 919 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 920 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 921 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 922 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 923 * (required APL: system_basic or system_core). 924 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 925 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 926 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 927 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 928 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 929 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 930 * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. 931 * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. 932 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 933 * <br>bundle name but different signature information exists on the device. 934 * @throws { BusinessError } 17700076 - Failed to install the HAP or HSP because the app distribution type is not allowed. 935 * @throws { BusinessError } 17700077 - Failed to install the HAP and restore to preinstalled bundle. 936 * @syscap SystemCapability.BundleManager.BundleFramework.Core 937 * @systemapi 938 * @since 18 939 */ 940 install(hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>; 941 942 /** 943 * Uninstall an application. 944 * 945 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 946 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 947 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 948 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 949 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 950 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 951 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 952 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 953 * @throws { BusinessError } 17700004 - The specified user ID is not found. 954 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 955 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. 956 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 957 * @syscap SystemCapability.BundleManager.BundleFramework.Core 958 * @systemapi 959 * @since 9 960 */ 961 /** 962 * Uninstall an application. 963 * 964 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 965 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 966 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 967 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 968 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 969 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 970 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 971 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 972 * @throws { BusinessError } 17700004 - The specified user ID is not found. 973 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 974 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 975 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 976 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 977 * @syscap SystemCapability.BundleManager.BundleFramework.Core 978 * @systemapi 979 * @since 12 980 */ 981 /** 982 * Uninstall an application. 983 * 984 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 985 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 986 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 987 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 988 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 989 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 990 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 991 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 992 * @throws { BusinessError } 17700004 - The specified user ID is not found. 993 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 994 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 995 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 996 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 997 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 998 * @syscap SystemCapability.BundleManager.BundleFramework.Core 999 * @systemapi 1000 * @since 13 1001 */ 1002 /** 1003 * Uninstall an application. 1004 * 1005 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1006 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1007 * @param { InstallParam } installParam - Indicates other parameters required for the uninstallation. 1008 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 1009 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1010 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1011 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1012 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1013 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1014 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1015 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 1016 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 1017 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 1018 * @throws { BusinessError } 17700062 - Failed to uninstall the app because the app is locked. 1019 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1020 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1021 * @systemapi 1022 * @since 15 1023 */ 1024 uninstall(bundleName: string, installParam: InstallParam, callback: AsyncCallback<void>): void; 1025 1026 /** 1027 * Uninstall an application. 1028 * 1029 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1030 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1031 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 1032 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 1033 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1034 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1035 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1036 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 1037 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. 1038 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 1039 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1040 * @systemapi 1041 * @since 9 1042 */ 1043 /** 1044 * Uninstall an application. 1045 * 1046 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1047 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1048 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 1049 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1050 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1051 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1052 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1053 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1054 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 1055 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 1056 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1057 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1058 * @systemapi 1059 * @since 12 1060 */ 1061 /** 1062 * Uninstall an application. 1063 * 1064 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1065 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1066 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 1067 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1068 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1069 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1070 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1071 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1072 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 1073 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 1074 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 1075 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1076 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1077 * @systemapi 1078 * @since 13 1079 */ 1080 uninstall(bundleName: string, callback: AsyncCallback<void>): void; 1081 1082 /** 1083 * Uninstall an application. 1084 * 1085 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1086 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1087 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 1088 * @returns { Promise<void> } 1089 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 1090 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1091 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1092 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1093 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1094 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 1095 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. 1096 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 1097 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1098 * @systemapi 1099 * @since 9 1100 */ 1101 /** 1102 * Uninstall an application. 1103 * 1104 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1105 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1106 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 1107 * @returns { Promise<void> } 1108 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1109 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1110 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1111 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1112 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1113 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1114 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 1115 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 1116 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1117 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1118 * @systemapi 1119 * @since 12 1120 */ 1121 /** 1122 * Uninstall an application. 1123 * 1124 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1125 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1126 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 1127 * @returns { Promise<void> } 1128 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1129 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1130 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1131 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1132 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1133 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1134 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 1135 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 1136 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 1137 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1138 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1139 * @systemapi 1140 * @since 13 1141 */ 1142 /** 1143 * Uninstall an application. 1144 * 1145 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1146 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 1147 * @param { InstallParam } [installParam] - Indicates other parameters required for the uninstallation. 1148 * @returns { Promise<void> } 1149 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1150 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1151 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1152 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1153 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1154 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1155 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle and cannot be uninstalled. 1156 * @throws { BusinessError } 17700045 - Failed to uninstall the HAP because uninstall is not allowed by the enterprise device management. 1157 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 1158 * @throws { BusinessError } 17700062 - Failed to uninstall the app because the app is locked. 1159 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1160 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1161 * @systemapi 1162 * @since 15 1163 */ 1164 uninstall(bundleName: string, installParam?: InstallParam): Promise<void>; 1165 1166 /** 1167 * Recover an application. 1168 * 1169 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1170 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1171 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 1172 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 1173 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1174 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1175 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1176 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1177 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1178 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1179 * @systemapi 1180 * @since 9 1181 */ 1182 /** 1183 * Recover an application. 1184 * 1185 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1186 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1187 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 1188 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 1189 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1190 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1191 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1192 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1193 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1194 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1195 * <br>bundle name but different signature information exists on the device. 1196 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1197 * @systemapi 1198 * @since 13 1199 */ 1200 /** 1201 * Recover an application. 1202 * 1203 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1204 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1205 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 1206 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 1207 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1208 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1209 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1210 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1211 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1212 * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited 1213 * <br>from being installed on this device or by specified users. 1214 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1215 * <br>bundle name but different signature information exists on the device. 1216 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1217 * @systemapi 1218 * @since 14 1219 */ 1220 recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback<void>): void; 1221 1222 /** 1223 * Recover an application. 1224 * 1225 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1226 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1227 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 1228 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1229 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1230 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1231 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1232 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1233 * @systemapi 1234 * @since 9 1235 */ 1236 /** 1237 * Recover an application. 1238 * 1239 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1240 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1241 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 1242 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1243 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1244 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1245 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1246 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1247 * <br>bundle name but different signature information exists on the device. 1248 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1249 * @systemapi 1250 * @since 13 1251 */ 1252 /** 1253 * Recover an application. 1254 * 1255 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1256 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1257 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 1258 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1259 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1260 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1261 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1262 * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited 1263 * <br>from being installed on this device or by specified users. 1264 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1265 * <br>bundle name but different signature information exists on the device. 1266 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1267 * @systemapi 1268 * @since 14 1269 */ 1270 recover(bundleName: string, callback: AsyncCallback<void>): void; 1271 1272 /** 1273 * Recover an application. 1274 * 1275 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1276 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1277 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 1278 * @returns { Promise<void> } 1279 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1280 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1281 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1282 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1283 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1284 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1285 * @systemapi 1286 * @since 9 1287 */ 1288 /** 1289 * Recover an application. 1290 * 1291 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1292 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1293 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 1294 * @returns { Promise<void> } 1295 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1296 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1297 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1298 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1299 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1300 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1301 * <br>bundle name but different signature information exists on the device. 1302 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1303 * @systemapi 1304 * @since 13 1305 */ 1306 /** 1307 * Recover an application. 1308 * 1309 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 1310 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 1311 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 1312 * @returns { Promise<void> } 1313 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 1314 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1315 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1316 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1317 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1318 * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited 1319 * <br>from being installed on this device or by specified users. 1320 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1321 * <br>bundle name but different signature information exists on the device. 1322 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1323 * @systemapi 1324 * @since 14 1325 */ 1326 recover(bundleName: string, installParam?: InstallParam): Promise<void>; 1327 1328 /** 1329 * Uninstall a shared bundle. 1330 * 1331 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1332 * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. 1333 * @param { AsyncCallback<void> } callback - The callback of uninstalling shared bundle result. 1334 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1335 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1336 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1337 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1338 * @throws { BusinessError } 17700037 - The version of shared bundle is dependent on other applications. 1339 * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. 1340 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1341 * @systemapi 1342 * @since 10 1343 */ 1344 uninstall(uninstallParam: UninstallParam, callback: AsyncCallback<void>): void; 1345 1346 /** 1347 * Uninstall a shared bundle. 1348 * 1349 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1350 * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. 1351 * @returns { Promise<void> } 1352 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1353 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1354 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1355 * @throws { BusinessError } 17700020 - The specified bundle is a pre-installed bundle and cannot be uninstalled. 1356 * @throws { BusinessError } 17700037 - The version of shared bundle is dependent on other applications. 1357 * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. 1358 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1359 * @systemapi 1360 * @since 10 1361 */ 1362 uninstall(uninstallParam: UninstallParam): Promise<void>; 1363 1364 /** 1365 * Updates this enterprise application. 1366 * 1367 * @permission ohos.permission.INSTALL_SELF_BUNDLE 1368 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 1369 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 1370 * @param { AsyncCallback<void> } callback - Indicates the callback used to return the HAP installation result. 1371 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 1372 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1373 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1374 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 1375 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 1376 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1377 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 1378 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 1379 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 1380 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 1381 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 1382 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 1383 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 1384 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 1385 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 1386 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 1387 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 1388 * (required APL: system_basic or system_core). 1389 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 1390 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 1391 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 1392 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 1393 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 1394 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 1395 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1396 * @systemapi 1397 * @since 10 1398 */ 1399 /** 1400 * Updates this enterprise application. 1401 * 1402 * @permission ohos.permission.INSTALL_SELF_BUNDLE 1403 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 1404 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 1405 * @param { AsyncCallback<void> } callback - Indicates the callback used to return the HAP installation result. 1406 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 1407 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1408 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1409 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 1410 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 1411 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1412 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 1413 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 1414 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 1415 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 1416 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 1417 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 1418 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 1419 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 1420 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 1421 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 1422 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 1423 * (required APL: system_basic or system_core). 1424 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 1425 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 1426 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 1427 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 1428 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 1429 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 1430 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1431 * @systemapi 1432 * @since 12 1433 */ 1434 updateBundleForSelf(hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void; 1435 1436 /** 1437 * Updates this enterprise application. 1438 * 1439 * @permission ohos.permission.INSTALL_SELF_BUNDLE 1440 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 1441 * @param { AsyncCallback<void> } callback - Indicates the callback used to return the HAP installation result. 1442 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 1443 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1444 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1445 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 1446 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 1447 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 1448 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 1449 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 1450 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 1451 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 1452 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 1453 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 1454 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 1455 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 1456 * (required APL: system_basic or system_core). 1457 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 1458 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 1459 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 1460 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 1461 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 1462 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 1463 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1464 * @systemapi 1465 * @since 10 1466 */ 1467 /** 1468 * Updates this enterprise application. 1469 * 1470 * @permission ohos.permission.INSTALL_SELF_BUNDLE 1471 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 1472 * @param { AsyncCallback<void> } callback - Indicates the callback used to return the HAP installation result. 1473 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 1474 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1475 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1476 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 1477 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 1478 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 1479 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 1480 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 1481 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 1482 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 1483 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 1484 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 1485 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 1486 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 1487 * (required APL: system_basic or system_core). 1488 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 1489 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 1490 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 1491 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 1492 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 1493 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 1494 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1495 * @systemapi 1496 * @since 12 1497 */ 1498 updateBundleForSelf(hapFilePaths: Array<string>, callback: AsyncCallback<void>): void; 1499 1500 /** 1501 * Updates this enterprise application. 1502 * 1503 * @permission ohos.permission.INSTALL_SELF_BUNDLE 1504 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 1505 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 1506 * @returns { Promise<void> } 1507 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 1508 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1509 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1510 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 1511 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 1512 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1513 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 1514 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 1515 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 1516 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 1517 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 1518 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 1519 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 1520 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 1521 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 1522 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 1523 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 1524 * (required APL: system_basic or system_core). 1525 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 1526 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 1527 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 1528 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 1529 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 1530 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 1531 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1532 * @systemapi 1533 * @since 10 1534 */ 1535 /** 1536 * Updates this enterprise application. 1537 * 1538 * @permission ohos.permission.INSTALL_SELF_BUNDLE 1539 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 1540 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 1541 * @returns { Promise<void> } 1542 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 1543 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1544 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1545 * 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 1546 * 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. 1547 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1548 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 1549 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 1550 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 1551 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 1552 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 1553 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 1554 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 1555 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 1556 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 1557 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 1558 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 1559 * (required APL: system_basic or system_core). 1560 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 1561 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 1562 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 1563 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 1564 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 1565 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 1566 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1567 * @systemapi 1568 * @since 12 1569 */ 1570 updateBundleForSelf(hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>; 1571 1572 /** 1573 * Uninstall updates for a pre-installed application. 1574 * 1575 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1576 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled updates. 1577 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 1578 * @returns { Promise<void> } 1579 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1580 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1581 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1582 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1583 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 1584 * @throws { BusinessError } 17700057 - Failed to uninstall updates because the HAP is not pre-installed. 1585 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1586 * @systemapi 1587 * @since 12 1588 */ 1589 /** 1590 * Uninstall updates for a pre-installed application. 1591 * 1592 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1593 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled updates. 1594 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 1595 * @returns { Promise<void> } 1596 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1597 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1598 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1599 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 1600 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 1601 * @throws { BusinessError } 17700057 - Failed to uninstall updates because the HAP is not pre-installed. 1602 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 1603 * @throws { BusinessError } 17700067 - Failed to uninstall the HAP because uninstalling the native package failed. 1604 * @throws { BusinessError } 17700073 - Failed to install the HAP because an application with the same 1605 * <br>bundle name but different signature information exists on the device. 1606 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1607 * @systemapi 1608 * @since 13 1609 */ 1610 uninstallUpdates(bundleName: string, installParam?: InstallParam): Promise<void>; 1611 1612 /** 1613 * Add extend resources. 1614 * 1615 * @permission ohos.permission.INSTALL_BUNDLE 1616 * @param { string } bundleName - Indicates the bundleName. 1617 * @param { Array<string> } filePaths - Indicates the file path for extend resources. 1618 * @returns { Promise<void> } Returns addExtResource result. 1619 * @throws { BusinessError } 201 - Permission denied. 1620 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1621 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1622 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1623 * @throws { BusinessError } 17700301 - AddExtResource failed due to parse file failed. 1624 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1625 * @systemapi 1626 * @since 12 1627 */ 1628 addExtResource(bundleName: string, filePaths: Array<string>): Promise<void>; 1629 1630 /** 1631 * Remove extend resources. 1632 * 1633 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 1634 * @param { string } bundleName - Indicates the bundleName. 1635 * @param { Array<string> } moduleNames - Indicates the moduleNames for extend resources. 1636 * @returns { Promise<void> } Returns removeExtResource result. 1637 * @throws { BusinessError } 201 - Permission denied. 1638 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1639 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1640 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1641 * @throws { BusinessError } 17700302 - RemoveExtResource failed due to module does not exist. 1642 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1643 * @systemapi 1644 * @since 12 1645 */ 1646 removeExtResource(bundleName: string, moduleNames: Array<string>): Promise<void>; 1647 1648 /** 1649 * Create clone instance for an application. 1650 * 1651 * @permission ohos.permission.INSTALL_CLONE_BUNDLE 1652 * @param { string } bundleName - Indicates the path where the HAP of the application is stored. 1653 * @param { CreateAppCloneParam } [createAppCloneParam] Indicates the optional params of create clone app. 1654 * @returns { Promise<number> } Return the appIndex of the clone application. 1655 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_CLONE_BUNDLE'. 1656 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1657 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1658 * @throws { BusinessError } 17700001 - The specified bundleName cannot be found or the bundle is not installed by the specified user. 1659 * @throws { BusinessError } 17700004 - The userId is invalid. 1660 * @throws { BusinessError } 17700061 - The appIndex is not in valid range or already exists. 1661 * @throws { BusinessError } 17700069 - The app does not support the creation of an appClone instance. 1662 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1663 * @systemapi 1664 * @since 12 1665 */ 1666 createAppClone(bundleName: string, createAppCloneParam?: CreateAppCloneParam): Promise<number>; 1667 1668 /** 1669 * Destroy clone instance for an application. 1670 * 1671 * @permission ohos.permission.UNINSTALL_CLONE_BUNDLE 1672 * @param { string } bundleName - Indicates the path where the HAP of the application is stored. 1673 * @param { number } appIndex - Indicates the clone application's index. 1674 * @param { number } [userId] - userId Indicates the user ID. 1675 * @returns { Promise<void> } 1676 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.UNINSTALL_CLONE_BUNDLE'. 1677 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1678 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1679 * @throws { BusinessError } 17700001 - The specified bundleName cannot be found or the bundle is not installed by the specified user. 1680 * @throws { BusinessError } 17700004 - The userId is invalid. 1681 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 1682 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1683 * @systemapi 1684 * @since 12 1685 */ 1686 destroyAppClone(bundleName: string, appIndex: number, userId?: number): Promise<void>; 1687 1688 /** 1689 * Destroy clone instance for an application. 1690 * 1691 * @permission ohos.permission.UNINSTALL_CLONE_BUNDLE 1692 * @param { string } bundleName - Indicates the bundleName of clone app. 1693 * @param { number } appIndex - Indicates the clone application's index. 1694 * @param { DestroyAppCloneParam } [destroyAppCloneParam] - Indicates other parameters required for the uninstallation. 1695 * @returns { Promise<void> } 1696 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.UNINSTALL_CLONE_BUNDLE'. 1697 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1698 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1699 * @throws { BusinessError } 17700001 - The specified bundleName cannot be found or the bundle is not installed by the specified user. 1700 * @throws { BusinessError } 17700004 - The userId is invalid. 1701 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 1702 * @throws { BusinessError } 17700062 - Failed to uninstall the app because the app is locked. 1703 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1704 * @systemapi 1705 * @since 15 1706 */ 1707 destroyAppClone(bundleName: string, appIndex: number, destroyAppCloneParam?: DestroyAppCloneParam): Promise<void>; 1708 1709 /** 1710 * Install application by bundle name with specified user. 1711 * 1712 * @permission ohos.permission.INSTALL_BUNDLE 1713 * @param { string } bundleName - Indicates the bundle name of application. 1714 * @param { number } [userId] - userId Indicates the user ID. 1715 * @returns { Promise<void> } 1716 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 1717 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1718 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1719 * @throws { BusinessError } 17700001 - The specified bundleName cannot be found or the bundle is not installed by the specified user. 1720 * @throws { BusinessError } 17700004 - The userId is invalid. 1721 * @throws { BusinessError } 17700071 - It is not allowed to install the enterprise bundle. 1722 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1723 * @systemapi 1724 * @since 12 1725 */ 1726 /** 1727 * Install application by bundle name with specified user. 1728 * 1729 * @permission ohos.permission.INSTALL_BUNDLE 1730 * @param { string } bundleName - Indicates the bundle name of application. 1731 * @param { number } [userId] - userId Indicates the user ID. 1732 * @returns { Promise<void> } 1733 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 1734 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1735 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1736 * @throws { BusinessError } 17700001 - The specified bundleName cannot be found or the bundle is not installed by the specified user. 1737 * @throws { BusinessError } 17700004 - The userId is invalid. 1738 * @throws { BusinessError } 17700071 - It is not allowed to install the enterprise bundle. 1739 * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited 1740 * <br>from being installed on this device or by specified users. 1741 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1742 * @systemapi 1743 * @since 14 1744 */ 1745 installPreexistingApp(bundleName: string, userId?: number): Promise<void>; 1746 } 1747 1748 /** 1749 * Provides parameters required for hashParam. 1750 * 1751 * @typedef HashParam 1752 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1753 * @systemapi 1754 * @since 9 1755 */ 1756 export interface HashParam { 1757 /** 1758 * Indicates the moduleName 1759 * 1760 * @type { string } 1761 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1762 * @systemapi 1763 * @since 9 1764 */ 1765 moduleName: string; 1766 1767 /** 1768 * Indicates the hash value 1769 * 1770 * @type { string } 1771 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1772 * @systemapi 1773 * @since 9 1774 */ 1775 hashValue: string; 1776 } 1777 1778 /** 1779 * Provides parameters required for VerifyCodeParam. 1780 * 1781 * @typedef VerifyCodeParam 1782 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1783 * @systemapi 1784 * @since 10 1785 * @deprecated since 11 1786 */ 1787 export interface VerifyCodeParam { 1788 /** 1789 * Indicates the moduleName which hopes to be processed with code signature. 1790 * 1791 * @type { string } 1792 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1793 * @systemapi 1794 * @since 10 1795 * @deprecated since 11 1796 */ 1797 moduleName: string; 1798 1799 /** 1800 * Indicates the path where the code signature file of the corresponding HAP is stored. 1801 * 1802 * @type { string } 1803 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1804 * @systemapi 1805 * @since 10 1806 * @deprecated since 11 1807 */ 1808 signatureFilePath: string; 1809 } 1810 1811 /** 1812 * Provides parameters required for PGOParam. 1813 * 1814 * @typedef PGOParam 1815 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1816 * @systemapi 1817 * @since 11 1818 */ 1819 export interface PGOParam { 1820 /** 1821 * Indicates the moduleName that need to store profile-guided optimization(PGO) file. 1822 * 1823 * @type { string } 1824 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1825 * @systemapi 1826 * @since 11 1827 */ 1828 moduleName: string; 1829 1830 /** 1831 * Indicates the path where the profile-guided optimization(PGO) file is stored. 1832 * 1833 * @type { string } 1834 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1835 * @systemapi 1836 * @since 11 1837 */ 1838 pgoFilePath: string; 1839 } 1840 1841 /** 1842 * Provides parameters required for Parameters. 1843 * 1844 * @typedef Parameters 1845 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1846 * @systemapi 1847 * @since 15 1848 */ 1849 export interface Parameters { 1850 /** 1851 * Indicates key. 1852 * 1853 * @type { string } 1854 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1855 * @systemapi 1856 * @since 15 1857 */ 1858 key: string; 1859 1860 /** 1861 * Indicates value. 1862 * 1863 * @type { string } 1864 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1865 * @systemapi 1866 * @since 15 1867 */ 1868 value: string; 1869 } 1870 1871 /** 1872 * Provides parameters required for installing or uninstalling an application. 1873 * 1874 * @typedef InstallParam 1875 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1876 * @systemapi 1877 * @since 9 1878 */ 1879 export interface InstallParam { 1880 /** 1881 * Indicates the user id 1882 * 1883 * @type { ?number } 1884 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1885 * @systemapi 1886 * @since 9 1887 */ 1888 userId?: number; 1889 1890 /** 1891 * Indicates the installation type. The value 0x00 means normal installation, 0x01 means overwrite installation, and 0x10 means installation-free. 1892 * 1893 * @type { ?number } 1894 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1895 * @systemapi 1896 * @since 9 1897 */ 1898 installFlag?: number; 1899 1900 /** 1901 * Indicates whether the param has data 1902 * 1903 * @type { ?boolean } 1904 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1905 * @systemapi 1906 * @since 9 1907 */ 1908 isKeepData?: boolean; 1909 1910 /** 1911 * Indicates the hash params 1912 * 1913 * @type { ?Array<HashParam> } 1914 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1915 * @systemapi 1916 * @since 9 1917 */ 1918 hashParams?: Array<HashParam>; 1919 1920 /** 1921 * Indicates the deadline of the crowdtesting bundle 1922 * 1923 * @type { ?number } 1924 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1925 * @systemapi 1926 * @since 9 1927 */ 1928 crowdtestDeadline?: number; 1929 1930 /** 1931 * Indicates the shared bundle dir paths. 1932 * 1933 * @type { ?Array<String> } 1934 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1935 * @systemapi 1936 * @since 10 1937 */ 1938 sharedBundleDirPaths?: Array<String>; 1939 1940 /** 1941 * Indicates the distribution type specified during bundle installation. 1942 * 1943 * @type { ?string } 1944 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1945 * @systemapi 1946 * @since 10 1947 */ 1948 specifiedDistributionType?: string; 1949 1950 /** 1951 * Indicates the additional information during bundle installation. 1952 * 1953 * @type { ?string } 1954 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1955 * @systemapi 1956 * @since 10 1957 */ 1958 additionalInfo?: string; 1959 1960 /** 1961 * Indicates the verification code param. 1962 * 1963 * @type { ?Array<VerifyCodeParam> } 1964 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1965 * @systemapi 1966 * @since 10 1967 * @deprecated since 11 1968 */ 1969 verifyCodeParams?: Array<VerifyCodeParam>; 1970 1971 /** 1972 * Indicates the profile-guided optimization(PGO) params. 1973 * 1974 * @type { ?Array<PGOParam> } 1975 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1976 * @systemapi 1977 * @since 11 1978 */ 1979 pgoParams?: Array<PGOParam>; 1980 1981 /** 1982 * Indicates parameters. 1983 * 1984 * @type { ?Array<Parameters> } 1985 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1986 * @systemapi 1987 * @since 15 1988 */ 1989 parameters?: Array<Parameters>; 1990 } 1991 1992 /** 1993 * Provides parameters required for uninstalling shared bundle. 1994 * 1995 * @typedef UninstallParam 1996 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1997 * @systemapi 1998 * @since 10 1999 */ 2000 export interface UninstallParam { 2001 /** 2002 * Indicates the shared bundle name 2003 * 2004 * @type { string } 2005 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2006 * @systemapi 2007 * @since 10 2008 */ 2009 bundleName: string; 2010 2011 /** 2012 * Indicates the shared version code. If default, indicates that all version sharing bundles are uninstalled 2013 * 2014 * @type { ?number } 2015 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2016 * @systemapi 2017 * @since 10 2018 */ 2019 versionCode?: number; 2020 } 2021 2022 /** 2023 * Provides parameters required for creating clone app. 2024 * 2025 * @typedef CreateAppCloneParam 2026 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2027 * @systemapi 2028 * @since 12 2029 */ 2030 export interface CreateAppCloneParam { 2031 /** 2032 * Indicates the user id 2033 * 2034 * @type { ?number } 2035 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2036 * @systemapi 2037 * @since 12 2038 */ 2039 userId?: number; 2040 /** 2041 * Indicates the appIndex of MultiApp 2042 * 2043 * @type { ?number } 2044 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2045 * @systemapi 2046 * @since 12 2047 */ 2048 appIndex?: number; 2049 } 2050 2051 /** 2052 * Provides parameters required for destroy clone app. 2053 * 2054 * @typedef DestroyAppCloneParam 2055 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2056 * @systemapi 2057 * @since 15 2058 */ 2059 export interface DestroyAppCloneParam { 2060 /** 2061 * Indicates the user id 2062 * 2063 * @type { ?number } 2064 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2065 * @systemapi 2066 * @since 15 2067 */ 2068 userId?: number; 2069 /** 2070 * Indicates parameters. 2071 * 2072 * @type { ?Array<Parameters> } 2073 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2074 * @systemapi 2075 * @since 15 2076 */ 2077 parameters?: Array<Parameters>; 2078 } 2079} 2080 2081export default installer; 2082