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 Want from './@ohos.app.ability.Want'; 22 23/** 24 * This module provides the capability to manage the system of the enterprise devices. 25 * 26 * @namespace systemManager 27 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 28 * @stagemodelonly 29 * @since 12 30 */ 31declare namespace systemManager { 32 /** 33 * The device system update info. 34 * 35 * @typedef SystemUpdateInfo 36 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 37 * @stagemodelonly 38 * @since 12 39 */ 40 export interface SystemUpdateInfo { 41 /** 42 * The name of version need to update. 43 * 44 * @type { string } 45 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 46 * @stagemodelonly 47 * @since 12 48 */ 49 versionName: string; 50 51 /** 52 * The time when the version first received. 53 * 54 * @type { number } 55 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 56 * @stagemodelonly 57 * @since 12 58 */ 59 firstReceivedTime: number; 60 61 /** 62 * The type of version package. 63 * 64 * @type { string } 65 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 66 * @stagemodelonly 67 * @since 12 68 */ 69 packageType: string; 70 } 71 72 /** 73 * System update policy type. 74 * 75 * @enum { number } 76 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 77 * @stagemodelonly 78 * @since 12 79 */ 80 enum PolicyType { 81 /** 82 * Default update policy 83 * 84 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 85 * @stagemodelonly 86 * @since 12 87 */ 88 DEFAULT = 0, 89 90 /** 91 * Prohibit update policy 92 * 93 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 94 * @stagemodelonly 95 * @since 12 96 */ 97 PROHIBIT = 1, 98 99 /** 100 * Update to specific software version policy 101 * 102 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 103 * @stagemodelonly 104 * @since 12 105 */ 106 UPDATE_TO_SPECIFIC_VERSION = 2, 107 108 /** 109 * Update within a specified time window 110 * 111 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 112 * @stagemodelonly 113 * @since 12 114 */ 115 WINDOWS = 3, 116 117 /** 118 * Delay the update for a period of time 119 * 120 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 121 * @stagemodelonly 122 * @since 12 123 */ 124 POSTPONE = 4 125 } 126 127 /** 128 * OTA update policy. 129 * 130 * @typedef OtaUpdatePolicy 131 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 132 * @stagemodelonly 133 * @since 12 134 */ 135 export interface OtaUpdatePolicy { 136 /** 137 * Software update type. 138 * 139 * @type { PolicyType } 140 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 141 * @stagemodelonly 142 * @since 12 143 */ 144 policyType: PolicyType; 145 146 /** 147 * Software version. 148 * 149 * @type { string } 150 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 151 * @stagemodelonly 152 * @since 12 153 */ 154 version: string; 155 156 /** 157 * The latest time of update. 158 * 159 * @type { ?number } 160 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 161 * @stagemodelonly 162 * @since 12 163 */ 164 latestUpdateTime?: number; 165 166 /** 167 * The time of delay update. 168 * 169 * @type { ?number } 170 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 171 * @stagemodelonly 172 * @since 12 173 */ 174 delayUpdateTime?: number; 175 176 /** 177 * The start time of installation window. 178 * 179 * @type { ?number } 180 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 181 * @stagemodelonly 182 * @since 12 183 */ 184 installStartTime?: number; 185 186 /** 187 * The end time of installation window. 188 * 189 * @type { ?number } 190 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 191 * @stagemodelonly 192 * @since 12 193 */ 194 installEndTime?: number; 195 196 /** 197 * True indicates system OTA update is disabled. 198 * 199 * @type { ?boolean } 200 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 201 * @stagemodelonly 202 * @since 20 203 */ 204 disableSystemOtaUpdate?: boolean; 205 } 206 207 /** 208 * The device system update package info. 209 * 210 * @typedef UpdatePackageInfo 211 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 212 * @stagemodelonly 213 * @since 12 214 */ 215 export interface UpdatePackageInfo { 216 /** 217 * The version of system update package. 218 * 219 * @type { string } 220 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 221 * @stagemodelonly 222 * @since 12 223 */ 224 version: string; 225 226 /** 227 * The detail of system update packages. 228 * 229 * @type { Array<Package> } 230 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 231 * @stagemodelonly 232 * @since 12 233 */ 234 packages: Array<Package>; 235 236 /** 237 * The description of system update package. 238 * 239 * @type { ?PackageDescription } 240 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 241 * @stagemodelonly 242 * @since 12 243 */ 244 description?: PackageDescription; 245 246 /** 247 * The authentication information of system update package. 248 * 249 * @type { ?string } 250 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 251 * @stagemodelonly 252 * @since 19 253 */ 254 authInfo?: string; 255 } 256 257 /** 258 * The detail of system update package. 259 * 260 * @typedef Package 261 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 262 * @stagemodelonly 263 * @since 12 264 */ 265 interface Package { 266 /** 267 * The type of system update package. 268 * 269 * @type { PackageType } 270 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 271 * @stagemodelonly 272 * @since 12 273 */ 274 type: PackageType; 275 276 /** 277 * The path of system update package. 278 * 279 * @type { string } 280 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 281 * @stagemodelonly 282 * @since 12 283 */ 284 path: string; 285 286 /** 287 * The file descriptor of system update package. 288 * 289 * @type { ?number } 290 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 291 * @stagemodelonly 292 * @since 12 293 */ 294 fd?: number; 295 } 296 297 /** 298 * Enum for system update package. 299 * 300 * @enum { number } 301 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 302 * @stagemodelonly 303 * @since 12 304 */ 305 enum PackageType { 306 /** 307 * FIRMWARE 308 * 309 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 310 * @stagemodelonly 311 * @since 12 312 */ 313 FIRMWARE = 1 314 } 315 316 /** 317 * The description of system update package. 318 * 319 * @typedef PackageDescription 320 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 321 * @stagemodelonly 322 * @since 12 323 */ 324 interface PackageDescription { 325 /** 326 * The custom notification of system update package. 327 * 328 * @type { ?NotifyDescription } 329 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 330 * @stagemodelonly 331 * @since 12 332 */ 333 notify?: NotifyDescription; 334 } 335 336 /** 337 * The custom notification of system update package. 338 * 339 * @typedef NotifyDescription 340 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 341 * @stagemodelonly 342 * @since 12 343 */ 344 interface NotifyDescription { 345 /** 346 * The custom notification tips of system update package. 347 * 348 * @type { ?string } 349 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 350 * @stagemodelonly 351 * @since 12 352 */ 353 installTips?: string; 354 355 /** 356 * The custom notification tips detail of system update package. 357 * 358 * @type { ?string } 359 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 360 * @stagemodelonly 361 * @since 12 362 */ 363 installTipsDetail?: string; 364 } 365 366 /** 367 * The result of system update. 368 * 369 * @typedef UpdateResult 370 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 371 * @stagemodelonly 372 * @since 12 373 */ 374 interface UpdateResult { 375 /** 376 * The current version of the system. 377 * 378 * @type { string } 379 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 380 * @stagemodelonly 381 * @since 12 382 */ 383 version: string; 384 385 /** 386 * The update status of the system. 387 * 388 * @type { UpdateStatus } 389 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 390 * @stagemodelonly 391 * @since 12 392 */ 393 status: UpdateStatus; 394 395 /** 396 * The update error message of the system. 397 * 398 * @type { ErrorInfo } 399 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 400 * @stagemodelonly 401 * @since 12 402 */ 403 errorInfo: ErrorInfo; 404 } 405 406 /** 407 * Enum for system update status. 408 * 409 * @enum { number } 410 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 411 * @stagemodelonly 412 * @since 12 413 */ 414 enum UpdateStatus { 415 /** 416 * The specified version system update package does not exist. 417 * 418 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 419 * @stagemodelonly 420 * @since 12 421 */ 422 NO_UPDATE_PACKAGE = -4, 423 424 /** 425 * The system update package waiting for installation. 426 * 427 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 428 * @stagemodelonly 429 * @since 12 430 */ 431 UPDATE_WAITING = -3, 432 433 /** 434 * The system is updating. 435 * 436 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 437 * @stagemodelonly 438 * @since 12 439 */ 440 UPDATING = -2, 441 442 /** 443 * The system update failed. 444 * 445 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 446 * @stagemodelonly 447 * @since 12 448 */ 449 UPDATE_FAILURE = -1, 450 451 /** 452 * The system update successful. 453 * 454 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 455 * @stagemodelonly 456 * @since 12 457 */ 458 UPDATE_SUCCESS = 0 459 } 460 461 /** 462 * The update error information of the system. 463 * 464 * @typedef ErrorInfo 465 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 466 * @stagemodelonly 467 * @since 12 468 */ 469 interface ErrorInfo { 470 /** 471 * The update error code of the system. 472 * 473 * @type { number } 474 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 475 * @stagemodelonly 476 * @since 12 477 */ 478 code: number; 479 480 /** 481 * The update error message of the system. 482 * 483 * @type { string } 484 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 485 * @stagemodelonly 486 * @since 12 487 */ 488 message: string; 489 } 490 491 /** 492 * Sets NTP server. 493 * This function can be called by a super administrator. 494 * 495 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 496 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 497 * The admin must have the corresponding permission. 498 * @param { string } server - the address of NTP server. 499 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 500 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 501 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 502 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 503 * 2. Incorrect parameter types; 3. Parameter verification failed. 504 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 505 * @stagemodelonly 506 * @since 12 507 */ 508 function setNTPServer(admin: Want, server: string): void; 509 510 /** 511 * Gets NTP server. 512 * This function can be called by a super administrator. 513 * 514 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 515 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 516 * The admin must have the corresponding permission. 517 * @returns { string } the address of NTP server. 518 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 519 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 520 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 521 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 522 * 2. Incorrect parameter types; 3. Parameter verification failed. 523 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 524 * @stagemodelonly 525 * @since 12 526 */ 527 function getNTPServer(admin: Want): string; 528 529 /** 530 * Sets device OTA update policy. 531 * This function can be called by a super administrator. 532 * 533 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 534 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 535 * The admin must have the corresponding permission. 536 * @param { OtaUpdatePolicy } policy - OTA update policy. 537 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 538 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 539 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 540 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 541 * 2. Incorrect parameter types; 3. Parameter verification failed. 542 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 543 * @stagemodelonly 544 * @since 12 545 */ 546 function setOtaUpdatePolicy(admin: Want, policy: OtaUpdatePolicy): void; 547 548 /** 549 * Gets device OTA update policy. 550 * This function can be called by a super administrator. 551 * 552 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 553 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 554 * The admin must have the corresponding permission. 555 * @returns { OtaUpdatePolicy } OTA update policy. 556 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 557 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 558 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 559 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 560 * 2. Incorrect parameter types; 3. Parameter verification failed. 561 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 562 * @stagemodelonly 563 * @since 12 564 */ 565 function getOtaUpdatePolicy(admin: Want): OtaUpdatePolicy; 566 567 /** 568 * Notifies the system of update packages information. 569 * This function can be called by a super administrator. 570 * 571 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 572 * @param { Want } admin - admin indicates the administrator ability information. 573 * @param { UpdatePackageInfo } packageInfo - packageInfo indicates the information of system update package. 574 * @returns { Promise<void> } the promise returned by the notifyUpdatePackages. 575 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 576 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 577 * @throws { BusinessError } 9201004 - The update packages do not exist or analyzing failed. 578 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 579 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 580 * 2. Incorrect parameter types; 3. Parameter verification failed. 581 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 582 * @stagemodelonly 583 * @since 12 584 */ 585 function notifyUpdatePackages(admin: Want, packageInfo: UpdatePackageInfo): Promise<void>; 586 587 /** 588 * Gets the result of system update. 589 * This function can be called by a super administrator. 590 * 591 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 592 * @param { Want } admin - admin indicates the administrator ability information. 593 * @param { string } version - version indicates the version of update. 594 * @returns { Promise<UpdateResult> } the promise returned by the getUpdateResult. 595 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 596 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 597 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 598 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 599 * 2. Incorrect parameter types; 3. Parameter verification failed. 600 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 601 * @stagemodelonly 602 * @since 12 603 */ 604 function getUpdateResult(admin: Want, version: string): Promise<UpdateResult>; 605 606 /** 607 * Gets the authorize data of system update. 608 * This function can be called by a super administrator. 609 * 610 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 611 * @param { Want } admin - admin indicates the administrator ability information. 612 * @returns { Promise<string> } the promise returned by the getUpdateAuthData. 613 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 614 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 615 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 616 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 617 * @stagemodelonly 618 * @since 19 619 */ 620 function getUpdateAuthData(admin: Want): Promise<string>; 621 622 /** 623 * Sets auto unlock after reboot. 624 * This function can be called by a super administrator. 625 * 626 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 627 * @param { Want } admin - admin indicates the administrator ability information. 628 * @param { boolean } isAllowed - true if allow auto unlock after reboot, otherwise false. 629 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 630 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 631 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 632 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 633 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 634 * @stagemodelonly 635 * @since 20 636 */ 637 function setAutoUnlockAfterReboot(admin: Want, isAllowed: boolean): void; 638 639 /** 640 * Gets auto unlock after reboot. 641 * This function can be called by a super administrator. 642 * 643 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 644 * @param { Want } admin - admin indicates the administrator ability information. 645 * @returns { boolean } true if allow auto unlock after reboot, otherwise false. 646 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 647 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 648 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 649 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 650 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 651 * @stagemodelonly 652 * @since 20 653 */ 654 function getAutoUnlockAfterReboot(admin: Want): boolean; 655 656 /** 657 * Sets install localEnterpriseApp enable. 658 * This function can be called by a super administrator. 659 * 660 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 661 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 662 * The admin must have the corresponding permission. 663 * @param { boolean } isEnable - true indicates whether can install localEnterpriseApp, otherwise false. 664 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 665 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 666 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 667 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 668 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 669 * @stagemodelonly 670 * @since 20 671 */ 672 function setInstallLocalEnterpriseAppEnabled(admin: Want, isEnable: boolean): void; 673 674 /** 675 * Gets install localEnterpriseApp enable. 676 * This function can be called by a super administrator. 677 * 678 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 679 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 680 * The admin must have the corresponding permission. 681 * @returns { boolean } true indicates whether can install localEnterpriseApp, otherwise false. 682 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 683 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 684 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 685 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 686 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 687 * @stagemodelonly 688 * @since 20 689 */ 690 function getInstallLocalEnterpriseAppEnabled(admin: Want): boolean; 691 692 /** 693 * Near link protocol 694 * 695 * @enum { number } 696 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 697 * @stagemodelonly 698 * @since 20 699 */ 700 enum NearLinkProtocol { 701 /** 702 * SSAP protocol. 703 * 704 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 705 * @stagemodelonly 706 * @since 20 707 */ 708 SSAP = 0, 709 710 /** 711 * DATATRANSFER protocol. 712 * 713 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 714 * @stagemodelonly 715 * @since 20 716 */ 717 DATA_TRANSFER = 1 718 } 719 720 /** 721 * Adds protocols to the list of near link server that are disallowed to use. 722 * This function can be called by a super administrator. 723 * 724 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 725 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 726 * The admin must have the corresponding permission. 727 * @param { Array<NearLinkProtocol> } protocols - protocol of the near link to be added to the list. 728 * @param { number } accountId - accountId indicates the local ID of the OS account. 729 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 730 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 731 * @throws { BusinessError } 9200012 - Parameter verification failed. 732 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 733 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 734 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 735 * @stagemodelonly 736 * @since 20 737 */ 738 function addDisallowedNearLinkProtocols(admin: Want, protocols: Array<NearLinkProtocol>, accountId: number): void; 739 740 /** 741 * Removes protocol from the list of near link server that are disallowed to use. 742 * This function can be called by a super administrator. 743 * 744 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 745 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 746 * The admin must have the corresponding permission. 747 * @param { Array<NearLinkProtocol> } protocols - protocol of the near link to be removed to the list. 748 * @param { number } accountId - accountId indicates the local ID of the OS account. 749 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 750 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 751 * @throws { BusinessError } 9200012 - Parameter verification failed. 752 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 753 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 754 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 755 * @stagemodelonly 756 * @since 20 757 */ 758 function removeDisallowedNearLinkProtocols(admin: Want, protocols: Array<NearLinkProtocol>, accountId: number): void; 759 760 /** 761 * Gets protocols from the list of near link server that are disallowed to use. 762 * This function can be called by a super administrator. 763 * 764 * @permission ohos.permission.ENTERPRISE_MANAGE_SYSTEM 765 * @param { Want } admin - admin indicates the enterprise admin extension ability information. 766 * If the admin is not empty, it must have the corresponding permission. 767 * @param { number } accountId - accountId indicates the local ID of the OS account. 768 * @returns { Array<NearLinkProtocol> } protocol of the near link list. 769 * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. 770 * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. 771 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 772 * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. 773 * @syscap SystemCapability.Customization.EnterpriseDeviceManager 774 * @stagemodelonly 775 * @since 20 776 */ 777 function getDisallowedNearLinkProtocols(admin: Want, accountId: number): Array<NearLinkProtocol>; 778} 779 780export default systemManager;