1/* 2 * Copyright (c) 2023-2024 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 MDMKit 19 */ 20 21import type { AsyncCallback } from './@ohos.base'; 22import type Want from './@ohos.app.ability.Want'; 23 24/** 25 * This module provides the capability to manage the applications of the enterprise devices. 26 * 27 * @namespace applicationManager 28 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 29 * @since 10 30 */ 31declare namespace applicationManager { 32 /** 33 * Enum for Kiosk Feature. 34 * 35 * @enum { number } 36 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 37 * @stagemodelonly 38 * @since 20 39 */ 40 enum KioskFeature { 41 /** 42 * Allow notification center. 43 * 44 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 45 * @stagemodelonly 46 * @since 20 47 */ 48 ALLOW_NOTIFICATION_CENTER = 1, 49 50 /** 51 * Allow control center. 52 * 53 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 54 * @stagemodelonly 55 * @since 20 56 */ 57 ALLOW_CONTROL_CENTER = 2 58 } 59 60 /** 61 * Add appid list of bundles that is disallowed to run in the device. 62 * This function can be called by a super administrator. 63 * 64 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 65 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 66 * The admin must have the corresponding permission. 67 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 68 * cannot be greater than 200. 69 * @param { AsyncCallback<void> } callback - the callback of addDisallowedRunningBundles. 70 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 71 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 72 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 73 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 74 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 75 * 2. Incorrect parameter types; 3. Parameter verification failed. 76 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 77 * @systemapi 78 * @StageModelOnly 79 * @since 10 80 */ 81 function addDisallowedRunningBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void; 82 83 /** 84 * Add appid list of bundles that is disallowed to run in the device. 85 * This function can be called by a super administrator. 86 * 87 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 88 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 89 * The admin must have the corresponding permission. 90 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 91 * cannot be greater than 200. 92 * @param { number } userId - userId indicates the user ID. 93 * @param { AsyncCallback<void> } callback - the callback of addDisallowedRunningBundles. 94 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 95 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 96 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 97 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 98 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 99 * 2. Incorrect parameter types; 3. Parameter verification failed. 100 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 101 * @systemapi 102 * @StageModelOnly 103 * @since 10 104 */ 105 function addDisallowedRunningBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void; 106 107 /** 108 * Add appid list of bundles that is disallowed to run in the device. 109 * This function can be called by a super administrator. 110 * 111 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 112 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 113 * The admin must have the corresponding permission. 114 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 115 * cannot be greater than 200. 116 * @param { number } userId - userId indicates the user ID. 117 * @returns { Promise<void> } the promise returned by the addDisallowedRunningBundles. 118 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 119 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 120 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 121 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 122 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 123 * 2. Incorrect parameter types; 3. Parameter verification failed. 124 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 125 * @systemapi 126 * @StageModelOnly 127 * @since 10 128 */ 129 function addDisallowedRunningBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>; 130 131 /** 132 * Add appid list of bundles that is disallowed to run in the device. 133 * This function can be called by a super administrator. 134 * 135 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 136 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 137 * The admin must have the corresponding permission. 138 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 139 * cannot be greater than 200. 140 * @param { number } [accountId] - accountId indicates the account ID. 141 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 142 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 143 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 144 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 145 * 2. Incorrect parameter types; 3. Parameter verification failed. 146 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 147 * @StageModelOnly 148 * @since 12 149 */ 150 function addDisallowedRunningBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void; 151 152 /** 153 * Remove appid list of bundles that is disallowed to run in the device. 154 * This function can be called by a super administrator. 155 * 156 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 157 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 158 * The admin must have the corresponding permission. 159 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 160 * cannot be greater than 200. 161 * @param { AsyncCallback<void> } callback - the callback of removeDisallowedRunningBundles. 162 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 163 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 164 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 165 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 166 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 167 * 2. Incorrect parameter types; 3. Parameter verification failed. 168 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 169 * @systemapi 170 * @StageModelOnly 171 * @since 10 172 */ 173 function removeDisallowedRunningBundles(admin: Want, appIds: Array<string>, callback: AsyncCallback<void>): void; 174 175 /** 176 * Remove appid list of bundles that is disallowed to run in the device. 177 * This function can be called by a super administrator. 178 * 179 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 180 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 181 * The admin must have the corresponding permission. 182 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 183 * cannot be greater than 200. 184 * @param { number } userId - userId indicates the user ID. 185 * @param { AsyncCallback<void> } callback - the callback of removeDisallowedRunningBundles. 186 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 187 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 188 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 189 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 190 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 191 * 2. Incorrect parameter types; 3. Parameter verification failed. 192 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 193 * @systemapi 194 * @StageModelOnly 195 * @since 10 196 */ 197 function removeDisallowedRunningBundles(admin: Want, appIds: Array<string>, userId: number, callback: AsyncCallback<void>): void; 198 199 /** 200 * Remove appid list of bundles that is disallowed to run in the device. 201 * This function can be called by a super administrator. 202 * 203 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 204 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 205 * The admin must have the corresponding permission. 206 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 207 * cannot be greater than 200. 208 * @param { number } userId - userId indicates the user ID. 209 * @returns { Promise<void> } the promise returned by the removeDisallowedRunningBundles. 210 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 211 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 212 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 213 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 214 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 215 * 2. Incorrect parameter types; 3. Parameter verification failed. 216 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 217 * @systemapi 218 * @StageModelOnly 219 * @since 10 220 */ 221 function removeDisallowedRunningBundles(admin: Want, appIds: Array<string>, userId?: number): Promise<void>; 222 223 /** 224 * Remove appid list of bundles that is disallowed to run in the device. 225 * This function can be called by a super administrator. 226 * 227 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 228 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 229 * The admin must have the corresponding permission. 230 * @param { Array<string> } appIds - ids of the bundle are disallowed to run. The size of the array after setting 231 * cannot be greater than 200. 232 * @param { number } [accountId] - accountId indicates the user ID. 233 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 234 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 235 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 236 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 237 * 2. Incorrect parameter types; 3. Parameter verification failed. 238 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 239 * @StageModelOnly 240 * @since 12 241 */ 242 function removeDisallowedRunningBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void; 243 244 /** 245 * Get appid list of bundles that is disallowed to run in the device. 246 * This function can be called by a super administrator. 247 * 248 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 249 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 250 * The admin must have the corresponding permission. 251 * @param { AsyncCallback<Array<string>> } callback - the callback of getDisallowedRunningBundles. 252 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 253 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 254 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 255 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 256 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 257 * 2. Incorrect parameter types; 3. Parameter verification failed. 258 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 259 * @systemapi 260 * @StageModelOnly 261 * @since 10 262 */ 263 function getDisallowedRunningBundles(admin: Want, callback: AsyncCallback<Array<string>>): void; 264 265 /** 266 * Get appid list of bundles that is disallowed to run in the device. 267 * This function can be called by a super administrator. 268 * 269 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 270 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 271 * The admin must have the corresponding permission. 272 * @param { number } userId - userId indicates the user ID. 273 * @param { AsyncCallback<Array<string>> } callback - the callback of getDisallowedRunningBundles. 274 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 275 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 276 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 277 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 278 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 279 * 2. Incorrect parameter types; 3. Parameter verification failed. 280 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 281 * @systemapi 282 * @StageModelOnly 283 * @since 10 284 */ 285 function getDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void; 286 287 /** 288 * Get appid list of bundles that is disallowed to run in the device. 289 * This function can be called by a super administrator. 290 * 291 * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY 292 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 293 * The admin must have the corresponding permission. 294 * @param { number } userId - userId indicates the user ID. 295 * @returns { Promise<Array<string>> } the promise returned by the getDisallowedRunningBundles. 296 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 297 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 298 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 299 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 300 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 301 * 2. Incorrect parameter types; 3. Parameter verification failed. 302 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 303 * @systemapi 304 * @StageModelOnly 305 * @since 10 306 */ 307 function getDisallowedRunningBundles(admin: Want, userId?: number): Promise<Array<string>>; 308 309 /** 310 * Get appid list of bundles that is disallowed to run in the device. 311 * This function can be called by a super administrator. 312 * 313 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 314 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 315 * The admin must have the corresponding permission. 316 * @param { number } [accountId] - accountId indicates the user ID. 317 * @returns { Array<string> } ids of the bundle are disallowed to run. 318 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 319 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 320 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 321 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 322 * 2. Incorrect parameter types; 3. Parameter verification failed. 323 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 324 * @StageModelOnly 325 * @since 12 326 */ 327 function getDisallowedRunningBundlesSync(admin: Want, accountId?: number): Array<string>; 328 329 /** 330 * Adds auto start applications. 331 * This function can be called by a super administrator. 332 * 333 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 334 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 335 * The admin must have the corresponding permission. 336 * @param { Array<Want> } autoStartApps - autoStartApps indicates the information of auto start app ability. 337 * The bundleName and abilityName of the want cannot be non-exist. 338 * The size of the array after setting cannot be greater than 10. 339 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 340 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 341 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 342 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 343 * 2. Incorrect parameter types; 3. Parameter verification failed. 344 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 345 * @stagemodelonly 346 * @since 12 347 */ 348 function addAutoStartApps(admin: Want, autoStartApps: Array<Want>): void; 349 350 /** 351 * Adds auto start applications which are not allowed to modify their auto start settings. 352 * This function can be called by a super administrator. 353 * 354 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 355 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 356 * The admin must have the corresponding permission. 357 * @param { Array<Want> } autoStartApps - autoStartApps indicates the information of auto start app ability. 358 * The bundleName and abilityName of the want cannot be non-exist. 359 * The size of the array after setting cannot be greater than 10. 360 * @param { number } accountId - accountId indicates the local ID of the OS account. 361 * @param { boolean } disallowModify - disallowModify specifies whether the applications are 362 * disallowed to modify their auto start setting. 363 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 364 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 365 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 366 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 367 * @stagemodelonly 368 * @since 20 369 */ 370 function addAutoStartApps(admin: Want, autoStartApps: Array<Want>, accountId: number, disallowModify: boolean): void; 371 372 /** 373 * Removes auto start applications. 374 * This function can be called by a super administrator. 375 * 376 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 377 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 378 * The admin must have the corresponding permission. 379 * @param { Array<Want> } autoStartApps - autoStartApps indicates the information of auto start app ability. 380 * The bundleName and abilityName of the want cannot be non-exist. 381 * The size of the array after setting cannot be greater 10. 382 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 383 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 384 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 385 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 386 * 2. Incorrect parameter types; 3. Parameter verification failed. 387 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 388 * @stagemodelonly 389 * @since 12 390 */ 391 function removeAutoStartApps(admin: Want, autoStartApps: Array<Want>): void; 392 393 /** 394 * Removes auto start applications. 395 * This function can be called by a super administrator. 396 * 397 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 398 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 399 * The admin must have the corresponding permission. 400 * @param { Array<Want> } autoStartApps - autoStartApps indicates the information of auto start app ability. 401 * The bundleName and abilityName of the want cannot be non-exist. 402 * The size of the array after setting cannot be greater 10. 403 * @param { number } accountId - accountId indicates the local ID of the OS account. 404 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 405 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 406 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 407 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 408 * @stagemodelonly 409 * @since 20 410 */ 411 function removeAutoStartApps(admin: Want, autoStartApps: Array<Want>, accountId: number): void; 412 413 /** 414 * Gets information of auto start applications. 415 * This function can be called by a super administrator. 416 * 417 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 418 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 419 * The admin must have the corresponding permission. 420 * @returns { Array<Want> } the information of auto start applications. 421 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 422 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 423 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 424 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 425 * 2. Incorrect parameter types; 3. Parameter verification failed. 426 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 427 * @stagemodelonly 428 * @since 12 429 */ 430 function getAutoStartApps(admin: Want): Array<Want>; 431 432 /** 433 * Gets information of auto start applications. 434 * This function can be called by a super administrator. 435 * 436 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 437 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 438 * The admin must have the corresponding permission. 439 * @param { number } accountId - accountId indicates the local ID of the OS account. 440 * @returns { Array<Want> } the information of auto start applications. 441 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 442 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 443 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 444 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 445 * @stagemodelonly 446 * @since 20 447 */ 448 function getAutoStartApps(admin: Want, accountId: number): Array<Want>; 449 450 /** 451 * Checks whether the specified application is allowed to modify its auto start setting. 452 * This function can be called by a super administrator. 453 * 454 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 455 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 456 * The admin must have the corresponding permission. 457 * @param { Want } autoStartApp - autoStartApp indicates the information of auto start app ability to be checked. 458 * The bundleName and abilityName of the want cannot be non-exist. 459 * @param { number } accountId - accountId indicates the local ID of the OS account. 460 * @returns { boolean } true indicates the application is not allowed to modify its auto start setting. 461 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 462 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 463 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 464 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 465 * @stagemodelonly 466 * @since 20 467 */ 468 function isModifyAutoStartAppsDisallowed(admin: Want, autoStartApp: Want, accountId: number): boolean; 469 470 /** 471 * Adds the keep alive applications. 472 * This function can be called by a super administrator. 473 * 474 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 475 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 476 * The admin must have the corresponding permission. 477 * @param { Array<string> } bundleNames - bundleNames indicates the bundle names of applications added to the keep 478 * alive list. 479 * @param { number } accountId - accountId indicates the local ID of the OS account. 480 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 481 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 482 * @throws { BusinessError } 9200010 - A conflict policy has been configured. 483 * @throws { BusinessError } 9201005 - Add keep alive applications failed. 484 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 485 * required to call the API 486 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 487 * 2.Incorrect parameter types;3.Parameter verification failed. 488 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 489 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 490 * @stagemodelonly 491 * @since 14 492 */ 493 function addKeepAliveApps(admin: Want, bundleNames: Array<string>, accountId: number): void; 494 495 /** 496 * Adds keep alive applications which are not allowed to modify their keep alive settings. 497 * This function can be called by a super administrator. 498 * 499 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 500 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 501 * The admin must have the corresponding permission. 502 * @param { Array<string> } bundleNames - bundleNames indicates the bundle names of applications added to the keep 503 * alive list. 504 * @param { number } accountId - accountId indicates the local ID of the OS account. 505 * @param { boolean } disallowModify - disallowModify specifies whether the applications 506 * are disallowed to modify their keep alive setting. 507 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 508 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 509 * @throws { BusinessError } 9200010 - A conflict policy has been configured. 510 * @throws { BusinessError } 9201005 - Add keep alive applications failed. 511 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 512 * required to call the API 513 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 514 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 515 * @stagemodelonly 516 * @since 20 517 */ 518 function addKeepAliveApps(admin: Want, bundleNames: Array<string>, accountId: number, disallowModify: boolean): void; 519 520 /** 521 * Removes the keep alive applications. 522 * This function can be called by a super administrator. 523 * 524 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 525 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 526 * The admin must have the corresponding permission. 527 * @param { Array<string> } bundleNames - bundleNames indicates the bundle names of applications removed from the keep 528 * alive list. 529 * @param { number } accountId - accountId indicates the local ID of the OS account. 530 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 531 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 532 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 533 * required to call the API 534 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 535 * 2.Incorrect parameter types;3.Parameter verification failed. 536 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 537 * @stagemodelonly 538 * @since 14 539 */ 540 function removeKeepAliveApps(admin: Want, bundleNames: Array<string>, accountId: number): void; 541 542 /** 543 * Gets the keep alive applications. 544 * This function can be called by a super administrator. 545 * 546 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 547 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 548 * The admin must have the corresponding permission. 549 * @param { number } accountId - accountId indicates the local ID of the OS account. 550 * @returns { Array<string> } the bundle names of keep alive applications. 551 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 552 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 553 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 554 * required to call the API 555 * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified; 556 * 2.Incorrect parameter types;3.Parameter verification failed. 557 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 558 * @stagemodelonly 559 * @since 14 560 */ 561 function getKeepAliveApps(admin: Want, accountId: number): Array<string>; 562 563 /** 564 * Checks whether the specified application is allowed to modify its keep alive setting. 565 * This function can be called by a super administrator. 566 * 567 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 568 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 569 * The admin must have the corresponding permission. 570 * @param { number } accountId - accountId indicates the local ID of the OS account. 571 * @param { string } bundleName - bundleName indicates the bundle name of application to be checked. 572 * @returns { boolean } true indicates the application is not allowed to modify its keep alive setting. 573 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 574 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 575 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 576 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 577 * @stagemodelonly 578 * @since 20 579 */ 580 function isModifyKeepAliveAppsDisallowed(admin: Want, accountId: number, bundleName: string): boolean; 581 582 /** 583 * Clear up application data. 584 * This function can be called by a super administrator. 585 * 586 * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION 587 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 588 * The admin must have the corresponding permission. 589 * @param { string } bundleName - bundleName indicates the bundle name of application. 590 * @param { number } appIndex - appIndex indicates the index of bundle. 591 * @param { number } accountId - accountId indicates the local ID of the OS account. 592 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 593 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 594 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 595 * required to call the API 596 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 597 * @stagemodelonly 598 * @since 20 599 */ 600 function clearUpApplicationData(admin: Want, bundleName: string, appIndex: number, accountId: number): void; 601 602 /** 603 * Set applications allowed running in kiosk mode. 604 * This function can be called by a super administrator. 605 * 606 * @permission ohos.permission.ENTERPRISE_SET_KIOSK 607 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 608 * The admin must have the corresponding permission. 609 * @param { Array<string> } appIdentifiers - appIdentifiers indicates the appIdentifiers of applications. 610 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 611 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 612 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 613 * required to call the API. 614 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 615 * @stagemodelonly 616 * @since 20 617 */ 618 function setAllowedKioskApps(admin: Want, appIdentifiers: Array<string>): void; 619 620 /** 621 * Get applications allowed running in kiosk mode. 622 * This function can be called by a super administrator. 623 * 624 * @permission ohos.permission.ENTERPRISE_SET_KIOSK 625 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 626 * The admin must have the corresponding permission. 627 * @returns { Array<string> } the appIdentifiers of applications that allowed running in kiosk mode. 628 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 629 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 630 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 631 * required to call the API 632 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 633 * @stagemodelonly 634 * @since 20 635 */ 636 function getAllowedKioskApps(admin: Want): Array<string>; 637 638 /** 639 * Check target application allowed running in kiosk mode. 640 * 641 * @param { string } appIdentifier - appIdentifier indicates the appIdentifier of application. 642 * @returns { boolean } true means the application allowed running in kiosk mode, otherwise false. 643 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 644 * @stagemodelonly 645 * @since 20 646 */ 647 function isAppKioskAllowed(appIdentifier: string): boolean; 648 649 /** 650 * Sets kiosk feature in kiosk mode. 651 * This function can be called by a super administrator. 652 * 653 * @permission ohos.permission.ENTERPRISE_SET_KIOSK 654 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 655 * The admin must have the corresponding permission. 656 * @param { Array<KioskFeature> } features - kiosk feature to allow custom ui. 657 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 658 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 659 * @throws { BusinessError } 9200012 - Parameter verification failed. 660 * @throws { BusinessError } 201 - Permission verification failed.The application does not have the permission 661 * required to call the API. 662 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 663 * @stagemodelonly 664 * @since 20 665 */ 666 function setKioskFeatures(admin: Want, features: Array<KioskFeature>): void; 667} 668 669export default applicationManager;