1/* 2 * Copyright (c) 2022-2023 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'; 22import type { ApplicationInfo as _ApplicationInfo, ModuleMetadata as _ModuleMetadata } from './bundleManager/ApplicationInfo'; 23import { Metadata as _Metadata } from './bundleManager/Metadata'; 24import { PermissionDef as _PermissionDef } from './bundleManager/PermissionDef'; 25import { ElementName as _ElementName } from './bundleManager/ElementName'; 26import { SharedBundleInfo as _SharedBundleInfo } from './bundleManager/SharedBundleInfo'; 27import type { RecoverableApplicationInfo as _RecoverableApplicationInfo } from './bundleManager/RecoverableApplicationInfo'; 28import Want from './@ohos.app.ability.Want'; 29import * as _AbilityInfo from './bundleManager/AbilityInfo'; 30import * as _AppProvisionInfo from './bundleManager/AppProvisionInfo'; 31import * as _BundleInfo from './bundleManager/BundleInfo'; 32import * as _HapModuleInfo from './bundleManager/HapModuleInfo'; 33import * as _ExtensionAbilityInfo from './bundleManager/ExtensionAbilityInfo'; 34 35/** 36 * This module is used to obtain package information of various applications installed on the current device. 37 * 38 * @namespace bundleManager 39 * @syscap SystemCapability.BundleManager.BundleFramework.Core 40 * @since 9 41 */ 42/** 43 * This module is used to obtain package information of various applications installed on the current device. 44 * 45 * @namespace bundleManager 46 * @syscap SystemCapability.BundleManager.BundleFramework.Core 47 * @atomicservice 48 * @since 11 49 */ 50declare namespace bundleManager { 51 /** 52 * Used to query the enumeration value of bundleInfo. Multiple values can be passed in the form. 53 * 54 * @enum { number } 55 * @syscap SystemCapability.BundleManager.BundleFramework.Core 56 * @since 9 57 */ 58 /** 59 * Used to query the enumeration value of bundleInfo. Multiple values can be passed in the form. 60 * 61 * @enum { number } 62 * @syscap SystemCapability.BundleManager.BundleFramework.Core 63 * @atomicservice 64 * @since 11 65 */ 66 enum BundleFlag { 67 /** 68 * Used to obtain the default bundleInfo. The obtained bundleInfo does not contain information of 69 * signatureInfo, applicationInfo, hapModuleInfo, ability, extensionAbility and permission. 70 * 71 * @syscap SystemCapability.BundleManager.BundleFramework.Core 72 * @since 9 73 */ 74 /** 75 * Used to obtain the default bundleInfo. The obtained bundleInfo does not contain information of 76 * signatureInfo, applicationInfo, hapModuleInfo, ability, extensionAbility and permission. 77 * 78 * @syscap SystemCapability.BundleManager.BundleFramework.Core 79 * @atomicservice 80 * @since 11 81 */ 82 GET_BUNDLE_INFO_DEFAULT = 0x00000000, 83 /** 84 * Used to obtain the bundleInfo containing applicationInfo. The obtained bundleInfo does not 85 * contain the information of signatureInfo, hapModuleInfo, ability, extensionAbility and permission. 86 * 87 * @syscap SystemCapability.BundleManager.BundleFramework.Core 88 * @since 9 89 */ 90 /** 91 * Used to obtain the bundleInfo containing applicationInfo. The obtained bundleInfo does not 92 * contain the information of signatureInfo, hapModuleInfo, ability, extensionAbility and permission. 93 * 94 * @syscap SystemCapability.BundleManager.BundleFramework.Core 95 * @atomicservice 96 * @since 11 97 */ 98 GET_BUNDLE_INFO_WITH_APPLICATION = 0x00000001, 99 /** 100 * Used to obtain the bundleInfo containing hapModuleInfo. The obtained bundleInfo does not 101 * contain the information of signatureInfo, applicationInfo, ability, extensionAbility and permission. 102 * 103 * @syscap SystemCapability.BundleManager.BundleFramework.Core 104 * @since 9 105 */ 106 /** 107 * Used to obtain the bundleInfo containing hapModuleInfo. The obtained bundleInfo does not 108 * contain the information of signatureInfo, applicationInfo, ability, extensionAbility and permission. 109 * 110 * @syscap SystemCapability.BundleManager.BundleFramework.Core 111 * @atomicservice 112 * @since 11 113 */ 114 GET_BUNDLE_INFO_WITH_HAP_MODULE = 0x00000002, 115 /** 116 * Used to obtain the bundleInfo containing ability. The obtained bundleInfo does not 117 * contain the information of signatureInfo, applicationInfo, extensionAbility and permission. 118 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 119 * 120 * @syscap SystemCapability.BundleManager.BundleFramework.Core 121 * @since 9 122 */ 123 /** 124 * Used to obtain the bundleInfo containing ability. The obtained bundleInfo does not 125 * contain the information of signatureInfo, applicationInfo, extensionAbility and permission. 126 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 127 * 128 * @syscap SystemCapability.BundleManager.BundleFramework.Core 129 * @atomicservice 130 * @since 11 131 */ 132 GET_BUNDLE_INFO_WITH_ABILITY = 0x00000004, 133 /** 134 * Used to obtain the bundleInfo containing extensionAbility. The obtained bundleInfo does not 135 * contain the information of signatureInfo, applicationInfo, ability and permission. 136 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 137 * 138 * @syscap SystemCapability.BundleManager.BundleFramework.Core 139 * @since 9 140 */ 141 /** 142 * Used to obtain the bundleInfo containing extensionAbility. The obtained bundleInfo does not 143 * contain the information of signatureInfo, applicationInfo, ability and permission. 144 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 145 * 146 * @syscap SystemCapability.BundleManager.BundleFramework.Core 147 * @atomicservice 148 * @since 11 149 */ 150 GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY = 0x00000008, 151 /** 152 * Used to obtain the bundleInfo containing permission. The obtained bundleInfo does not 153 * contain the information of signatureInfo, applicationInfo, hapModuleInfo, extensionAbility and ability. 154 * 155 * @syscap SystemCapability.BundleManager.BundleFramework.Core 156 * @since 9 157 */ 158 /** 159 * Used to obtain the bundleInfo containing permission. The obtained bundleInfo does not 160 * contain the information of signatureInfo, applicationInfo, hapModuleInfo, extensionAbility and ability. 161 * 162 * @syscap SystemCapability.BundleManager.BundleFramework.Core 163 * @atomicservice 164 * @since 11 165 */ 166 GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION = 0x00000010, 167 /** 168 * Used to obtain the metadata contained in applicationInfo, moduleInfo and abilityInfo. 169 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_APPLICATION, 170 * GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. 171 * 172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 173 * @since 9 174 */ 175 /** 176 * Used to obtain the metadata contained in applicationInfo, moduleInfo and abilityInfo. 177 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_APPLICATION, 178 * GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. 179 * 180 * @syscap SystemCapability.BundleManager.BundleFramework.Core 181 * @atomicservice 182 * @since 11 183 */ 184 GET_BUNDLE_INFO_WITH_METADATA = 0x00000020, 185 /** 186 * Used to obtain the default bundleInfo containing disabled application and ability. 187 * The obtained bundleInfo does not contain information of signatureInfo, applicationInfo, 188 * hapModuleInfo, ability, extensionAbility and permission. 189 * 190 * @syscap SystemCapability.BundleManager.BundleFramework.Core 191 * @since 9 192 */ 193 /** 194 * Used to obtain the default bundleInfo containing disabled application and ability. 195 * The obtained bundleInfo does not contain information of signatureInfo, applicationInfo, 196 * hapModuleInfo, ability, extensionAbility and permission. 197 * 198 * @syscap SystemCapability.BundleManager.BundleFramework.Core 199 * @atomicservice 200 * @since 11 201 */ 202 GET_BUNDLE_INFO_WITH_DISABLE = 0x00000040, 203 /** 204 * Used to obtain the bundleInfo containing signatureInfo. The obtained bundleInfo does not 205 * contain the information of applicationInfo, hapModuleInfo, extensionAbility, ability and permission. 206 * 207 * @syscap SystemCapability.BundleManager.BundleFramework.Core 208 * @since 9 209 */ 210 /** 211 * Used to obtain the bundleInfo containing signatureInfo. The obtained bundleInfo does not 212 * contain the information of applicationInfo, hapModuleInfo, extensionAbility, ability and permission. 213 * 214 * @syscap SystemCapability.BundleManager.BundleFramework.Core 215 * @atomicservice 216 * @since 11 217 */ 218 GET_BUNDLE_INFO_WITH_SIGNATURE_INFO = 0x00000080, 219 /** 220 * Used to obtain the bundleInfo containing menu configuration in hapModuleInfo. 221 * The obtained bundleInfo does not contain the information of applicationInfo, extensionAbility, ability and permission. 222 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 223 * 224 * @syscap SystemCapability.BundleManager.BundleFramework.Core 225 * @atomicservice 226 * @since 11 227 */ 228 GET_BUNDLE_INFO_WITH_MENU = 0x00000100 229 } 230 231 /** 232 * Used to query the enumeration value of applicationInfo. Multiple values can be passed in the form. 233 * 234 * @enum { number } 235 * @syscap SystemCapability.BundleManager.BundleFramework.Core 236 * @systemapi 237 * @since 9 238 */ 239 enum ApplicationFlag { 240 /** 241 * Used to obtain the default applicationInfo. The obtained applicationInfo does not contain the information of 242 * permission and metadata. 243 * 244 * @syscap SystemCapability.BundleManager.BundleFramework.Core 245 * @systemapi 246 * @since 9 247 */ 248 GET_APPLICATION_INFO_DEFAULT = 0x00000000, 249 /** 250 * Used to obtain the applicationInfo containing permission. 251 * 252 * @syscap SystemCapability.BundleManager.BundleFramework.Core 253 * @systemapi 254 * @since 9 255 */ 256 GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000001, 257 /** 258 * Used to obtain the applicationInfo containing metadata. 259 * 260 * @syscap SystemCapability.BundleManager.BundleFramework.Core 261 * @systemapi 262 * @since 9 263 */ 264 GET_APPLICATION_INFO_WITH_METADATA = 0x00000002, 265 /** 266 * Used to obtain the applicationInfo containing disabled application. 267 * 268 * @syscap SystemCapability.BundleManager.BundleFramework.Core 269 * @systemapi 270 * @since 9 271 */ 272 GET_APPLICATION_INFO_WITH_DISABLE = 0x00000004 273 } 274 275 /** 276 * Used to query the enumeration value of abilityInfo. Multiple values can be passed in the form. 277 * 278 * @enum { number } 279 * @syscap SystemCapability.BundleManager.BundleFramework.Core 280 * @systemapi 281 * @since 9 282 */ 283 enum AbilityFlag { 284 /** 285 * Used to obtain the default abilityInfo. The obtained abilityInfo does not contain the information of 286 * permission, metadata and disabled abilityInfo. 287 * 288 * @syscap SystemCapability.BundleManager.BundleFramework.Core 289 * @systemapi 290 * @since 9 291 */ 292 GET_ABILITY_INFO_DEFAULT = 0x00000000, 293 /** 294 * Used to obtain the abilityInfo containing permission. 295 * 296 * @syscap SystemCapability.BundleManager.BundleFramework.Core 297 * @systemapi 298 * @since 9 299 */ 300 GET_ABILITY_INFO_WITH_PERMISSION = 0x00000001, 301 /** 302 * Used to obtain the abilityInfo containing applicationInfo. 303 * 304 * @syscap SystemCapability.BundleManager.BundleFramework.Core 305 * @systemapi 306 * @since 9 307 */ 308 GET_ABILITY_INFO_WITH_APPLICATION = 0x00000002, 309 /** 310 * Used to obtain the abilityInfo containing metadata. 311 * 312 * @syscap SystemCapability.BundleManager.BundleFramework.Core 313 * @systemapi 314 * @since 9 315 */ 316 GET_ABILITY_INFO_WITH_METADATA = 0x00000004, 317 /** 318 * Used to obtain the abilityInfo containing disabled abilityInfo. 319 * 320 * @syscap SystemCapability.BundleManager.BundleFramework.Core 321 * @systemapi 322 * @since 9 323 */ 324 GET_ABILITY_INFO_WITH_DISABLE = 0x00000008, 325 /** 326 * Used to obtain the abilityInfo only for system app. 327 * 328 * @syscap SystemCapability.BundleManager.BundleFramework.Core 329 * @systemapi 330 * @since 9 331 */ 332 /** 333 * Used to obtain the abilityInfo only for system app. 334 * 335 * @syscap SystemCapability.BundleManager.BundleFramework.Core 336 * @systemapi 337 * @atomicservice 338 * @since 11 339 */ 340 GET_ABILITY_INFO_ONLY_SYSTEM_APP = 0x00000010 341 } 342 343 /** 344 * Used to query the enumeration value of ExtensionAbilityInfo. Multiple values can be passed in the form. 345 * 346 * @enum { number } 347 * @syscap SystemCapability.BundleManager.BundleFramework.Core 348 * @systemapi 349 * @since 9 350 */ 351 enum ExtensionAbilityFlag { 352 /** 353 * Used to obtain the default extensionAbilityInfo. The obtained extensionAbilityInfo does not contain the information of 354 * permission, metadata and disabled abilityInfo. 355 * 356 * @syscap SystemCapability.BundleManager.BundleFramework.Core 357 * @systemapi 358 * @since 9 359 */ 360 GET_EXTENSION_ABILITY_INFO_DEFAULT = 0x00000000, 361 /** 362 * Used to obtain the extensionAbilityInfo containing permission. 363 * 364 * @syscap SystemCapability.BundleManager.BundleFramework.Core 365 * @systemapi 366 * @since 9 367 */ 368 GET_EXTENSION_ABILITY_INFO_WITH_PERMISSION = 0x00000001, 369 /** 370 * Used to obtain the extensionAbilityInfo containing applicationInfo. 371 * 372 * @syscap SystemCapability.BundleManager.BundleFramework.Core 373 * @systemapi 374 * @since 9 375 */ 376 GET_EXTENSION_ABILITY_INFO_WITH_APPLICATION = 0x00000002, 377 /** 378 * Used to obtain the extensionAbilityInfo containing metadata. 379 * 380 * @syscap SystemCapability.BundleManager.BundleFramework.Core 381 * @systemapi 382 * @since 9 383 */ 384 GET_EXTENSION_ABILITY_INFO_WITH_METADATA = 0x00000004 385 } 386 387 /** 388 * This enumeration value is used to identify various types of extension ability 389 * 390 * @enum { number } 391 * @syscap SystemCapability.BundleManager.BundleFramework.Core 392 * @since 9 393 */ 394 /** 395 * This enumeration value is used to identify various types of extension ability 396 * 397 * @enum { number } 398 * @syscap SystemCapability.BundleManager.BundleFramework.Core 399 * @atomicservice 400 * @since 11 401 */ 402 export enum ExtensionAbilityType { 403 /** 404 * Indicates extension info with type of form 405 * 406 * @syscap SystemCapability.BundleManager.BundleFramework.Core 407 * @since 9 408 */ 409 /** 410 * Indicates extension info with type of form 411 * 412 * @syscap SystemCapability.BundleManager.BundleFramework.Core 413 * @atomicservice 414 * @since 11 415 */ 416 FORM = 0, 417 418 /** 419 * Indicates extension info with type of work schedule 420 * 421 * @syscap SystemCapability.BundleManager.BundleFramework.Core 422 * @since 9 423 */ 424 WORK_SCHEDULER = 1, 425 426 /** 427 * Indicates extension info with type of input method 428 * 429 * @syscap SystemCapability.BundleManager.BundleFramework.Core 430 * @since 9 431 */ 432 INPUT_METHOD = 2, 433 434 /** 435 * Indicates extension info with type of service 436 * 437 * @syscap SystemCapability.BundleManager.BundleFramework.Core 438 * @since 9 439 */ 440 SERVICE = 3, 441 442 /** 443 * Indicates extension info with type of accessibility 444 * 445 * @syscap SystemCapability.BundleManager.BundleFramework.Core 446 * @since 9 447 */ 448 ACCESSIBILITY = 4, 449 450 /** 451 * Indicates extension info with type of dataShare 452 * 453 * @syscap SystemCapability.BundleManager.BundleFramework.Core 454 * @since 9 455 */ 456 DATA_SHARE = 5, 457 458 /** 459 * Indicates extension info with type of filesShare 460 * 461 * @syscap SystemCapability.BundleManager.BundleFramework.Core 462 * @since 9 463 */ 464 FILE_SHARE = 6, 465 466 /** 467 * Indicates extension info with type of staticSubscriber 468 * 469 * @syscap SystemCapability.BundleManager.BundleFramework.Core 470 * @since 9 471 */ 472 STATIC_SUBSCRIBER = 7, 473 474 /** 475 * Indicates extension info with type of wallpaper 476 * 477 * @syscap SystemCapability.BundleManager.BundleFramework.Core 478 * @since 9 479 */ 480 WALLPAPER = 8, 481 482 /** 483 * Indicates extension info with type of backup 484 * 485 * @syscap SystemCapability.BundleManager.BundleFramework.Core 486 * @since 9 487 */ 488 BACKUP = 9, 489 490 /** 491 * Indicates extension info with type of window 492 * 493 * @syscap SystemCapability.BundleManager.BundleFramework.Core 494 * @since 9 495 */ 496 WINDOW = 10, 497 498 /** 499 * Indicates extension info with type of enterprise admin 500 * 501 * @syscap SystemCapability.BundleManager.BundleFramework.Core 502 * @since 9 503 */ 504 ENTERPRISE_ADMIN = 11, 505 506 /** 507 * Indicates extension info with type of thumbnail 508 * 509 * @syscap SystemCapability.BundleManager.BundleFramework.Core 510 * @since 9 511 */ 512 THUMBNAIL = 13, 513 514 /** 515 * Indicates extension info with type of preview 516 * 517 * @syscap SystemCapability.BundleManager.BundleFramework.Core 518 * @since 9 519 */ 520 PREVIEW = 14, 521 522 /** 523 * Indicates extension info with type of print 524 * 525 * @syscap SystemCapability.BundleManager.BundleFramework.Core 526 * @since 10 527 */ 528 PRINT = 15, 529 530 /** 531 * Indicates extension info with type of share 532 * 533 * @syscap SystemCapability.BundleManager.BundleFramework.Core 534 * @since 10 535 */ 536 SHARE = 16, 537 538 /** 539 * Indicates extension info with type of push 540 * 541 * @syscap SystemCapability.BundleManager.BundleFramework.Core 542 * @since 10 543 */ 544 PUSH = 17, 545 546 /** 547 * Indicates extension info with type of driver 548 * 549 * @syscap SystemCapability.BundleManager.BundleFramework.Core 550 * @since 10 551 */ 552 DRIVER = 18, 553 554 /** 555 * Indicates extension info with type of action 556 * 557 * @syscap SystemCapability.BundleManager.BundleFramework.Core 558 * @since 10 559 */ 560 ACTION = 19, 561 562 /** 563 * Indicates extension info with type of ads service 564 * 565 * @syscap SystemCapability.BundleManager.BundleFramework.Core 566 * @since 11 567 */ 568 ADS_SERVICE = 20, 569 570 /** 571 * Indicates extension info with type of unspecified 572 * 573 * @syscap SystemCapability.BundleManager.BundleFramework.Core 574 * @since 9 575 */ 576 UNSPECIFIED = 255 577 } 578 579 /** 580 * PermissionGrantState 581 * 582 * @enum { number } 583 * @syscap SystemCapability.BundleManager.BundleFramework.Core 584 * @since 9 585 */ 586 /** 587 * PermissionGrantState 588 * 589 * @enum { number } 590 * @syscap SystemCapability.BundleManager.BundleFramework.Core 591 * @atomicservice 592 * @since 11 593 */ 594 export enum PermissionGrantState { 595 /** 596 * PERMISSION_DENIED 597 * 598 * @syscap SystemCapability.BundleManager.BundleFramework.Core 599 * @since 9 600 */ 601 /** 602 * PERMISSION_DENIED 603 * 604 * @syscap SystemCapability.BundleManager.BundleFramework.Core 605 * @atomicservice 606 * @since 11 607 */ 608 PERMISSION_DENIED = -1, 609 610 /** 611 * PERMISSION_GRANTED 612 * 613 * @syscap SystemCapability.BundleManager.BundleFramework.Core 614 * @since 9 615 */ 616 /** 617 * PERMISSION_GRANTED 618 * 619 * @syscap SystemCapability.BundleManager.BundleFramework.Core 620 * @atomicservice 621 * @since 11 622 */ 623 PERMISSION_GRANTED = 0 624 } 625 626 /** 627 * Support window mode 628 * 629 * @enum { number } 630 * @syscap SystemCapability.BundleManager.BundleFramework.Core 631 * @since 9 632 */ 633 /** 634 * Support window mode 635 * 636 * @enum { number } 637 * @syscap SystemCapability.BundleManager.BundleFramework.Core 638 * @atomicservice 639 * @since 11 640 */ 641 export enum SupportWindowMode { 642 /** 643 * Indicates supported window mode of full screen mode 644 * 645 * @syscap SystemCapability.BundleManager.BundleFramework.Core 646 * @since 9 647 */ 648 /** 649 * Indicates supported window mode of full screen mode 650 * 651 * @syscap SystemCapability.BundleManager.BundleFramework.Core 652 * @atomicservice 653 * @since 11 654 */ 655 FULL_SCREEN = 0, 656 /** 657 * Indicates supported window mode of split mode 658 * 659 * @syscap SystemCapability.BundleManager.BundleFramework.Core 660 * @since 9 661 */ 662 /** 663 * Indicates supported window mode of split mode 664 * 665 * @syscap SystemCapability.BundleManager.BundleFramework.Core 666 * @atomicservice 667 * @since 11 668 */ 669 SPLIT = 1, 670 /** 671 * Indicates supported window mode of floating mode 672 * 673 * @syscap SystemCapability.BundleManager.BundleFramework.Core 674 * @since 9 675 */ 676 /** 677 * Indicates supported window mode of floating mode 678 * 679 * @syscap SystemCapability.BundleManager.BundleFramework.Core 680 * @atomicservice 681 * @since 11 682 */ 683 FLOATING = 2 684 } 685 686 /** 687 * Launch type 688 * 689 * @enum { number } 690 * @syscap SystemCapability.BundleManager.BundleFramework.Core 691 * @since 9 692 */ 693 /** 694 * Launch type 695 * 696 * @enum { number } 697 * @syscap SystemCapability.BundleManager.BundleFramework.Core 698 * @crossplatform 699 * @since 10 700 */ 701 /** 702 * Launch type 703 * 704 * @enum { number } 705 * @syscap SystemCapability.BundleManager.BundleFramework.Core 706 * @crossplatform 707 * @atomicservice 708 * @since 11 709 */ 710 export enum LaunchType { 711 /** 712 * Indicates that the ability has only one instance 713 * 714 * @syscap SystemCapability.BundleManager.BundleFramework.Core 715 * @since 9 716 */ 717 /** 718 * Indicates that the ability has only one instance 719 * 720 * @syscap SystemCapability.BundleManager.BundleFramework.Core 721 * @crossplatform 722 * @since 10 723 */ 724 /** 725 * Indicates that the ability has only one instance 726 * 727 * @syscap SystemCapability.BundleManager.BundleFramework.Core 728 * @crossplatform 729 * @atomicservice 730 * @since 11 731 */ 732 SINGLETON = 0, 733 734 /** 735 * Indicates that the ability can have multiple instances 736 * 737 * @syscap SystemCapability.BundleManager.BundleFramework.Core 738 * @since 9 739 */ 740 /** 741 * Indicates that the ability can have multiple instances 742 * 743 * @syscap SystemCapability.BundleManager.BundleFramework.Core 744 * @crossplatform 745 * @since 10 746 */ 747 /** 748 * Indicates that the ability can have multiple instances 749 * 750 * @syscap SystemCapability.BundleManager.BundleFramework.Core 751 * @crossplatform 752 * @atomicservice 753 * @since 11 754 */ 755 MULTITON = 1, 756 757 /** 758 * Indicates that the ability can have specified instances 759 * 760 * @syscap SystemCapability.BundleManager.BundleFramework.Core 761 * @since 9 762 */ 763 /** 764 * Indicates that the ability can have specified instances 765 * 766 * @syscap SystemCapability.BundleManager.BundleFramework.Core 767 * @atomicservice 768 * @since 11 769 */ 770 SPECIFIED = 2 771 } 772 773 /** 774 * Indicates ability type 775 * 776 * @enum { number } 777 * @syscap SystemCapability.BundleManager.BundleFramework.Core 778 * @FAModelOnly 779 * @since 9 780 */ 781 export enum AbilityType { 782 /** 783 * Indicates that the ability has a UI 784 * 785 * @syscap SystemCapability.BundleManager.BundleFramework.Core 786 * @FAModelOnly 787 * @since 9 788 */ 789 PAGE = 1, 790 791 /** 792 * Indicates that the ability does not have a UI 793 * 794 * @syscap SystemCapability.BundleManager.BundleFramework.Core 795 * @FAModelOnly 796 * @since 9 797 */ 798 SERVICE = 2, 799 800 /** 801 * Indicates that the ability is used to provide data access services 802 * 803 * @syscap SystemCapability.BundleManager.BundleFramework.Core 804 * @FAModelOnly 805 * @since 9 806 */ 807 DATA = 3 808 } 809 810 /** 811 * Display orientation 812 * 813 * @enum { number } 814 * @syscap SystemCapability.BundleManager.BundleFramework.Core 815 * @since 9 816 */ 817 /** 818 * Display orientation 819 * 820 * @enum { number } 821 * @syscap SystemCapability.BundleManager.BundleFramework.Core 822 * @atomicservice 823 * @since 11 824 */ 825 export enum DisplayOrientation { 826 /** 827 * Indicates that the system automatically determines the display orientation 828 * 829 * @syscap SystemCapability.BundleManager.BundleFramework.Core 830 * @since 9 831 */ 832 /** 833 * Indicates that the system automatically determines the display orientation 834 * 835 * @syscap SystemCapability.BundleManager.BundleFramework.Core 836 * @atomicservice 837 * @since 11 838 */ 839 UNSPECIFIED, 840 841 /** 842 * Indicates the landscape orientation 843 * 844 * @syscap SystemCapability.BundleManager.BundleFramework.Core 845 * @since 9 846 */ 847 /** 848 * Indicates the landscape orientation 849 * 850 * @syscap SystemCapability.BundleManager.BundleFramework.Core 851 * @atomicservice 852 * @since 11 853 */ 854 LANDSCAPE, 855 856 /** 857 * Indicates the portrait orientation 858 * 859 * @syscap SystemCapability.BundleManager.BundleFramework.Core 860 * @since 9 861 */ 862 /** 863 * Indicates the portrait orientation 864 * 865 * @syscap SystemCapability.BundleManager.BundleFramework.Core 866 * @atomicservice 867 * @since 11 868 */ 869 PORTRAIT, 870 871 /** 872 * Indicates the page ability orientation is the same as that of the nearest ability in the stack 873 * 874 * @syscap SystemCapability.BundleManager.BundleFramework.Core 875 * @since 9 876 */ 877 /** 878 * Indicates the page ability orientation is the same as that of the nearest ability in the stack 879 * 880 * @syscap SystemCapability.BundleManager.BundleFramework.Core 881 * @atomicservice 882 * @since 11 883 */ 884 FOLLOW_RECENT, 885 886 /** 887 * Indicates the inverted landscape orientation 888 * 889 * @syscap SystemCapability.BundleManager.BundleFramework.Core 890 * @since 9 891 */ 892 /** 893 * Indicates the inverted landscape orientation 894 * 895 * @syscap SystemCapability.BundleManager.BundleFramework.Core 896 * @atomicservice 897 * @since 11 898 */ 899 LANDSCAPE_INVERTED, 900 901 /** 902 * Indicates the inverted portrait orientation 903 * 904 * @syscap SystemCapability.BundleManager.BundleFramework.Core 905 * @since 9 906 */ 907 /** 908 * Indicates the inverted portrait orientation 909 * 910 * @syscap SystemCapability.BundleManager.BundleFramework.Core 911 * @atomicservice 912 * @since 11 913 */ 914 PORTRAIT_INVERTED, 915 916 /** 917 * Indicates the orientation can be auto-rotated 918 * 919 * @syscap SystemCapability.BundleManager.BundleFramework.Core 920 * @since 9 921 */ 922 /** 923 * Indicates the orientation can be auto-rotated 924 * 925 * @syscap SystemCapability.BundleManager.BundleFramework.Core 926 * @atomicservice 927 * @since 11 928 */ 929 AUTO_ROTATION, 930 931 /** 932 * Indicates the landscape orientation rotated with sensor 933 * 934 * @syscap SystemCapability.BundleManager.BundleFramework.Core 935 * @since 9 936 */ 937 /** 938 * Indicates the landscape orientation rotated with sensor 939 * 940 * @syscap SystemCapability.BundleManager.BundleFramework.Core 941 * @atomicservice 942 * @since 11 943 */ 944 AUTO_ROTATION_LANDSCAPE, 945 946 /** 947 * Indicates the portrait orientation rotated with sensor 948 * 949 * @syscap SystemCapability.BundleManager.BundleFramework.Core 950 * @since 9 951 */ 952 /** 953 * Indicates the portrait orientation rotated with sensor 954 * 955 * @syscap SystemCapability.BundleManager.BundleFramework.Core 956 * @atomicservice 957 * @since 11 958 */ 959 AUTO_ROTATION_PORTRAIT, 960 961 /** 962 * Indicates the sensor restricted mode 963 * 964 * @syscap SystemCapability.BundleManager.BundleFramework.Core 965 * @since 9 966 */ 967 /** 968 * Indicates the sensor restricted mode 969 * 970 * @syscap SystemCapability.BundleManager.BundleFramework.Core 971 * @atomicservice 972 * @since 11 973 */ 974 AUTO_ROTATION_RESTRICTED, 975 976 /** 977 * Indicates the sensor landscape restricted mode 978 * 979 * @syscap SystemCapability.BundleManager.BundleFramework.Core 980 * @since 9 981 */ 982 /** 983 * Indicates the sensor landscape restricted mode 984 * 985 * @syscap SystemCapability.BundleManager.BundleFramework.Core 986 * @atomicservice 987 * @since 11 988 */ 989 AUTO_ROTATION_LANDSCAPE_RESTRICTED, 990 991 /** 992 * Indicates the sensor portrait restricted mode 993 * 994 * @syscap SystemCapability.BundleManager.BundleFramework.Core 995 * @since 9 996 */ 997 /** 998 * Indicates the sensor portrait restricted mode 999 * 1000 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1001 * @atomicservice 1002 * @since 11 1003 */ 1004 AUTO_ROTATION_PORTRAIT_RESTRICTED, 1005 1006 /** 1007 * Indicates the locked orientation mode 1008 * 1009 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1010 * @since 9 1011 */ 1012 /** 1013 * Indicates the locked orientation mode 1014 * 1015 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1016 * @atomicservice 1017 * @since 11 1018 */ 1019 LOCKED 1020 } 1021 1022 /** 1023 * Indicates module type 1024 * 1025 * @enum { number } 1026 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1027 * @since 9 1028 */ 1029 /** 1030 * Indicates module type 1031 * 1032 * @enum { number } 1033 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1034 * @atomicservice 1035 * @since 11 1036 */ 1037 export enum ModuleType { 1038 /** 1039 * Indicates entry type 1040 * 1041 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1042 * @since 9 1043 */ 1044 /** 1045 * Indicates entry type 1046 * 1047 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1048 * @atomicservice 1049 * @since 11 1050 */ 1051 ENTRY = 1, 1052 /** 1053 * Indicates feature type 1054 * 1055 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1056 * @since 9 1057 */ 1058 /** 1059 * Indicates feature type 1060 * 1061 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1062 * @atomicservice 1063 * @since 11 1064 */ 1065 FEATURE = 2, 1066 /** 1067 * Indicates shared type 1068 * 1069 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1070 * @since 9 1071 */ 1072 /** 1073 * Indicates shared type 1074 * 1075 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1076 * @atomicservice 1077 * @since 11 1078 */ 1079 SHARED = 3 1080 } 1081 1082 /** 1083 * Indicates bundle type 1084 * 1085 * @enum { number } 1086 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1087 * @since 9 1088 */ 1089 /** 1090 * Indicates bundle type 1091 * 1092 * @enum { number } 1093 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1094 * @atomicservice 1095 * @since 11 1096 */ 1097 export enum BundleType { 1098 /** 1099 * Indicates app 1100 * 1101 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1102 * @since 9 1103 */ 1104 /** 1105 * Indicates app 1106 * 1107 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1108 * @atomicservice 1109 * @since 11 1110 */ 1111 APP = 0, 1112 /** 1113 * Indicates atomic service 1114 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1115 * @since 9 1116 */ 1117 /** 1118 * Indicates atomic service 1119 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1120 * @atomicservice 1121 * @since 11 1122 */ 1123 ATOMIC_SERVICE = 1 1124 } 1125 1126 /** 1127 * Shared bundle compatible policy 1128 * 1129 * @enum { number } 1130 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1131 * @since 10 1132 */ 1133 /** 1134 * Shared bundle compatible policy 1135 * 1136 * @enum { number } 1137 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1138 * @atomicservice 1139 * @since 11 1140 */ 1141 export enum CompatiblePolicy { 1142 /** 1143 * Indicates that the app is a shared bundle and the shared bundle type is backward compatibility 1144 * 1145 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1146 * @since 10 1147 */ 1148 /** 1149 * Indicates that the app is a shared bundle and the shared bundle type is backward compatibility 1150 * 1151 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1152 * @atomicservice 1153 * @since 11 1154 */ 1155 BACKWARD_COMPATIBILITY = 1 1156 } 1157 1158 /** 1159 * This enumeration value is used to identify various types of JSON profile. 1160 * 1161 * @enum { number } 1162 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1163 * @systemapi 1164 * @since 11 1165 */ 1166 export enum ProfileType { 1167 /** 1168 * Indicates JSON profile about intent framework. 1169 * 1170 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1171 * @systemapi 1172 * @since 11 1173 */ 1174 INTENT_PROFILE = 1 1175 } 1176 1177 /** 1178 * Obtains own bundleInfo. 1179 * 1180 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1181 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 1182 * @throws { BusinessError } 401 - The parameter check failed. 1183 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1184 * @since 9 1185 */ 1186 /** 1187 * Obtains own bundleInfo. 1188 * 1189 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1190 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 1191 * @throws { BusinessError } 401 - The parameter check failed. 1192 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1193 * @atomicservice 1194 * @since 11 1195 */ 1196 function getBundleInfoForSelf(bundleFlags: number): Promise<BundleInfo>; 1197 1198 /** 1199 * Obtains own bundleInfo. 1200 * 1201 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1202 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1203 * @throws { BusinessError } 401 - The parameter check failed. 1204 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1205 * @since 9 1206 */ 1207 /** 1208 * Obtains own bundleInfo. 1209 * 1210 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1211 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1212 * @throws { BusinessError } 401 - The parameter check failed. 1213 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1214 * @atomicservice 1215 * @since 11 1216 */ 1217 function getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 1218 1219 /** 1220 * Obtains own bundleInfo. 1221 * 1222 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1223 * @returns { BundleInfo } The result of getting the bundle info. 1224 * @throws { BusinessError } 401 - The parameter check failed. 1225 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1226 * @since 10 1227 */ 1228 /** 1229 * Obtains own bundleInfo. 1230 * 1231 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1232 * @returns { BundleInfo } The result of getting the bundle info. 1233 * @throws { BusinessError } 401 - The parameter check failed. 1234 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1235 * @atomicservice 1236 * @since 11 1237 */ 1238 function getBundleInfoForSelfSync(bundleFlags: number): BundleInfo; 1239 1240 /** 1241 * Obtains bundleInfo based on bundleName, bundleFlags. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1242 * 1243 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1244 * @param { string } bundleName - Indicates the application bundle name to be queried. 1245 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1246 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1247 * @throws { BusinessError } 201 - Permission denied. 1248 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1249 * @throws { BusinessError } 401 - The parameter check failed. 1250 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1251 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1252 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1253 * @systemapi 1254 * @since 9 1255 */ 1256 function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 1257 1258 /** 1259 * Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1260 * 1261 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1262 * @param { string } bundleName - Indicates the application bundle name to be queried. 1263 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1264 * @param { number } userId - Indicates the user ID or do not pass user ID. 1265 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1266 * @throws { BusinessError } 201 - Permission denied. 1267 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1268 * @throws { BusinessError } 401 - The parameter check failed. 1269 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1270 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1271 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1272 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1273 * @systemapi 1274 * @since 9 1275 */ 1276 function getBundleInfo(bundleName: string, 1277 bundleFlags: number, userId: number, callback: AsyncCallback<BundleInfo>): void; 1278 1279 /** 1280 * Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1281 * 1282 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1283 * @param { string } bundleName - Indicates the application bundle name to be queried. 1284 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1285 * @param { number } userId - Indicates the user ID or do not pass user ID. 1286 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 1287 * @throws { BusinessError } 201 - Permission denied. 1288 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1289 * @throws { BusinessError } 401 - The parameter check failed. 1290 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1291 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1292 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1293 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1294 * @systemapi 1295 * @since 9 1296 */ 1297 function getBundleInfo(bundleName: string, bundleFlags: number, userId?: number): Promise<BundleInfo>; 1298 1299 /** 1300 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1301 * 1302 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1303 * @param { string } bundleName - Indicates the application bundle name to be queried. 1304 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1305 * @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result. 1306 * @throws { BusinessError } 201 - Permission denied. 1307 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1308 * @throws { BusinessError } 401 - The parameter check failed. 1309 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1310 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1311 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1312 * @systemapi 1313 * @since 9 1314 */ 1315 function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback<ApplicationInfo>): void; 1316 1317 /** 1318 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1319 * 1320 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1321 * @param { string } bundleName - Indicates the application bundle name to be queried. 1322 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1323 * @param { number } userId - Indicates the user ID or do not pass user ID. 1324 * @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result. 1325 * @throws { BusinessError } 201 - Permission denied. 1326 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1327 * @throws { BusinessError } 401 - The parameter check failed. 1328 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1329 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1330 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1331 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1332 * @systemapi 1333 * @since 9 1334 */ 1335 function getApplicationInfo(bundleName: string, 1336 appFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>): void; 1337 1338 /** 1339 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1340 * 1341 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1342 * @param { string } bundleName - Indicates the application bundle name to be queried. 1343 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1344 * @param { number } userId - Indicates the user ID or do not pass user ID. 1345 * @returns { Promise<ApplicationInfo> } The result of getting the application info. 1346 * @throws { BusinessError } 201 - Permission denied. 1347 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1348 * @throws { BusinessError } 401 - The parameter check failed. 1349 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1350 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1351 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1352 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1353 * @systemapi 1354 * @since 9 1355 */ 1356 function getApplicationInfo(bundleName: string, appFlags: number, userId?: number): Promise<ApplicationInfo>; 1357 1358 /** 1359 * Obtains BundleInfo of all bundles available in the system. 1360 * 1361 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1362 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 1363 * @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects. 1364 * @throws { BusinessError } 201 - Permission denied. 1365 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1366 * @throws { BusinessError } 401 - The parameter check failed. 1367 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1368 * @systemapi 1369 * @since 9 1370 */ 1371 function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback<Array<BundleInfo>>): void; 1372 1373 /** 1374 * Obtains BundleInfo of all bundles available in the system. 1375 * 1376 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1377 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 1378 * @param { number } userId - Indicates the user id. 1379 * @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects. 1380 * @throws { BusinessError } 201 - Permission denied. 1381 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1382 * @throws { BusinessError } 401 - The parameter check failed. 1383 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1384 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1385 * @systemapi 1386 * @since 9 1387 */ 1388 function getAllBundleInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array<BundleInfo>>): void; 1389 1390 /** 1391 * Obtains BundleInfo of all bundles available in the system. 1392 * 1393 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1394 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 1395 * @param { number } userId - Indicates the user id. 1396 * @returns { Promise<Array<BundleInfo>> } Returns a list of BundleInfo objects. 1397 * @throws { BusinessError } 201 - Permission denied. 1398 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1399 * @throws { BusinessError } 401 - The parameter check failed. 1400 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1401 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1402 * @systemapi 1403 * @since 9 1404 */ 1405 function getAllBundleInfo(bundleFlags: number, userId?: number): Promise<Array<BundleInfo>>; 1406 1407 /** 1408 * Obtains information about all installed applications of a specified user. 1409 * 1410 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1411 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1412 * @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects. 1413 * @throws { BusinessError } 201 - Permission denied. 1414 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1415 * @throws { BusinessError } 401 - The parameter check failed. 1416 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1417 * @systemapi 1418 * @since 9 1419 */ 1420 function getAllApplicationInfo(appFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>): void; 1421 1422 /** 1423 * Obtains information about all installed applications of a specified user. 1424 * 1425 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1426 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1427 * @param { number } userId - Indicates the user ID or do not pass user ID. 1428 * @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects. 1429 * @throws { BusinessError } 201 - Permission denied. 1430 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1431 * @throws { BusinessError } 401 - The parameter check failed. 1432 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1433 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1434 * @systemapi 1435 * @since 9 1436 */ 1437 function getAllApplicationInfo(appFlags: number, 1438 userId: number, callback: AsyncCallback<Array<ApplicationInfo>>): void; 1439 1440 /** 1441 * Obtains information about all installed applications of a specified user. 1442 * 1443 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1444 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1445 * @param { number } userId - Indicates the user ID or do not pass user ID. 1446 * @returns { Promise<Array<ApplicationInfo>> } Returns a list of ApplicationInfo objects. 1447 * @throws { BusinessError } 201 - Permission denied. 1448 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1449 * @throws { BusinessError } 401 - The parameter check failed. 1450 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1451 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1452 * @systemapi 1453 * @since 9 1454 */ 1455 function getAllApplicationInfo(appFlags: number, userId?: number): Promise<Array<ApplicationInfo>>; 1456 1457 /** 1458 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1459 * 1460 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1461 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1462 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1463 * @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result. 1464 * @throws { BusinessError } 201 - Permission denied. 1465 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1466 * @throws { BusinessError } 401 - The parameter check failed. 1467 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1468 * @throws { BusinessError } 17700003 - The specified ability is not found. 1469 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1470 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1471 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1472 * @systemapi 1473 * @since 9 1474 */ 1475 function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback<Array<AbilityInfo>>): void; 1476 1477 /** 1478 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1479 * 1480 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1481 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1482 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1483 * @param { number } userId - userId Indicates the user ID. 1484 * @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result. 1485 * @throws { BusinessError } 201 - Permission denied. 1486 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1487 * @throws { BusinessError } 401 - The parameter check failed. 1488 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1489 * @throws { BusinessError } 17700003 - The specified ability is not found. 1490 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1491 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1492 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1493 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1494 * @systemapi 1495 * @since 9 1496 */ 1497 function queryAbilityInfo(want: Want, 1498 abilityFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void; 1499 1500 /** 1501 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1502 * 1503 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1504 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1505 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1506 * @param { number } userId - userId Indicates the user ID. 1507 * @returns { Promise<Array<AbilityInfo>> } Returns a list of AbilityInfo objects. 1508 * @throws { BusinessError } 201 - Permission denied. 1509 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1510 * @throws { BusinessError } 401 - The parameter check failed. 1511 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1512 * @throws { BusinessError } 17700003 - The specified ability is not found. 1513 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1514 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1515 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1516 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1517 * @systemapi 1518 * @since 9 1519 */ 1520 function queryAbilityInfo(want: Want, abilityFlags: number, userId?: number): Promise<Array<AbilityInfo>>; 1521 1522 /** 1523 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1524 * 1525 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1526 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1527 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1528 * @param { number } userId - userId Indicates the user ID. 1529 * @returns { Array<AbilityInfo> } Returns a list of AbilityInfo objects. 1530 * @throws { BusinessError } 201 - Permission denied. 1531 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1532 * @throws { BusinessError } 401 - The parameter check failed. 1533 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1534 * @throws { BusinessError } 17700003 - The specified ability is not found. 1535 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1536 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1537 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1538 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1539 * @systemapi 1540 * @since 10 1541 */ 1542 function queryAbilityInfoSync(want: Want, abilityFlags: number, userId?: number): Array<AbilityInfo>; 1543 1544 /** 1545 * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1546 * 1547 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1548 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1549 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1550 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1551 * ExtensionAbilityInfo objects that will be returned. 1552 * @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result. 1553 * @throws { BusinessError } 201 - Permission denied. 1554 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1555 * @throws { BusinessError } 401 - The parameter check failed. 1556 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1557 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1558 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1559 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1560 * @systemapi 1561 * @since 9 1562 */ 1563 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1564 extensionAbilityFlags: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void; 1565 1566 /** 1567 * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1568 * 1569 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1570 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1571 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1572 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1573 * ExtensionAbilityInfo objects that will be returned. 1574 * @param { number } userId - Indicates the user ID. 1575 * @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result. 1576 * @throws { BusinessError } 201 - Permission denied. 1577 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1578 * @throws { BusinessError } 401 - The parameter check failed. 1579 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1580 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1581 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1582 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1583 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1584 * @systemapi 1585 * @since 9 1586 */ 1587 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1588 extensionAbilityFlags: number, userId: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void; 1589 1590 /** 1591 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1592 * 1593 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1594 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1595 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1596 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1597 * ExtensionAbilityInfo objects that will be returned. 1598 * @param { number } userId - Indicates the user ID. 1599 * @returns { Promise<Array<ExtensionAbilityInfo>> } Returns a list of ExtensionAbilityInfo objects. 1600 * @throws { BusinessError } 201 - Permission denied. 1601 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1602 * @throws { BusinessError } 401 - The parameter check failed. 1603 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1604 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1605 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1606 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1607 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1608 * @systemapi 1609 * @since 9 1610 */ 1611 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1612 extensionAbilityFlags: number, userId?: number): Promise<Array<ExtensionAbilityInfo>>; 1613 1614 /** 1615 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1616 * 1617 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1618 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1619 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1620 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1621 * ExtensionAbilityInfo objects that will be returned. 1622 * @param { number } userId - Indicates the user ID. 1623 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1624 * @throws { BusinessError } 201 - Permission denied. 1625 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1626 * @throws { BusinessError } 401 - The parameter check failed. 1627 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1628 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1629 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1630 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1631 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1632 * @systemapi 1633 * @since 10 1634 */ 1635 function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: ExtensionAbilityType, 1636 extensionAbilityFlags: number, userId?: number): Array<ExtensionAbilityInfo>; 1637 1638 /** 1639 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1640 * 1641 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1642 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1643 * @param { string } extensionAbilityType - Indicates extensionAbilityType. 1644 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1645 * ExtensionAbilityInfo objects that will be returned. 1646 * @param { number } userId - Indicates the user ID. 1647 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1648 * @throws { BusinessError } 201 - Permission denied. 1649 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1650 * @throws { BusinessError } 401 - The parameter check failed. 1651 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1652 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1653 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1654 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1655 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1656 * @systemapi 1657 * @since 11 1658 */ 1659 function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: string, 1660 extensionAbilityFlags: number, userId?: number): Array<ExtensionAbilityInfo>; 1661 1662 /** 1663 * Query the ExtensionAbilityInfo by extension ability type. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1664 * 1665 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1666 * @param { string } extensionAbilityType - Indicates ExtensionAbilityType. 1667 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1668 * ExtensionAbilityInfo objects that will be returned. 1669 * @param { number } userId - Indicates the user ID. 1670 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1671 * @throws { BusinessError } 201 - Permission denied. 1672 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1673 * @throws { BusinessError } 401 - The parameter check failed. 1674 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1675 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1676 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1677 * @systemapi 1678 * @since 11 1679 */ 1680 function queryExtensionAbilityInfoSync(extensionAbilityType: string, extensionAbilityFlags: number, 1681 userId?: number): Array<ExtensionAbilityInfo>; 1682 1683 /** 1684 * Obtains bundle name by the given uid. 1685 * 1686 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1687 * @param { number } uid - Indicates the UID of an application. 1688 * @param { AsyncCallback<string> } callback - The callback of getting bundle name. 1689 * @throws { BusinessError } 201 - Permission denied. 1690 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1691 * @throws { BusinessError } 401 - The parameter check failed. 1692 * @throws { BusinessError } 17700021 - The uid is not found. 1693 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1694 * @systemapi 1695 * @since 9 1696 */ 1697 function getBundleNameByUid(uid: number, callback: AsyncCallback<string>): void; 1698 1699 /** 1700 * Obtains bundle name by the given uid. 1701 * 1702 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1703 * @param { number } uid - Indicates the UID of an application. 1704 * @returns { Promise<string> } Returns the bundle name. 1705 * @throws { BusinessError } 201 - Permission denied. 1706 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1707 * @throws { BusinessError } 401 - The parameter check failed. 1708 * @throws { BusinessError } 17700021 - The uid is not found. 1709 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1710 * @systemapi 1711 * @since 9 1712 */ 1713 function getBundleNameByUid(uid: number): Promise<string>; 1714 1715 /** 1716 * Obtains bundle name by the given uid. 1717 * 1718 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1719 * @param { number } uid - Indicates the UID of an application. 1720 * @returns { string } Returns the bundle name. 1721 * @throws { BusinessError } 201 - Permission denied. 1722 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1723 * @throws { BusinessError } 401 - The parameter check failed. 1724 * @throws { BusinessError } 17700021 - The uid is not found. 1725 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1726 * @systemapi 1727 * @since 10 1728 */ 1729 function getBundleNameByUidSync(uid: number): string; 1730 1731 /** 1732 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 1733 * 1734 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1735 * @param { string } hapFilePath - Indicates the path storing the HAP. 1736 * The path should be the relative path to the data directory of the current application. 1737 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 1738 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle archive info result. 1739 * @throws { BusinessError } 201 - Permission denied. 1740 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1741 * @throws { BusinessError } 401 - The parameter check failed. 1742 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 1743 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1744 * @systemapi 1745 * @since 9 1746 */ 1747 function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 1748 1749 /** 1750 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 1751 * 1752 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1753 * @param { string } hapFilePath - Indicates the path storing the HAP. 1754 * The path should be the relative path to the data directory of the current application. 1755 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 1756 * @returns { Promise<BundleInfo> } Returns the BundleInfo object. 1757 * @throws { BusinessError } 201 - Permission denied. 1758 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1759 * @throws { BusinessError } 401 - The parameter check failed. 1760 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 1761 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1762 * @systemapi 1763 * @since 9 1764 */ 1765 function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>; 1766 1767 /** 1768 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 1769 * 1770 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1771 * @param { string } hapFilePath - Indicates the path storing the HAP. 1772 * The path should be the relative path to the data directory of the current application. 1773 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 1774 * @returns { BundleInfo } Returns the BundleInfo object. 1775 * @throws { BusinessError } 201 - Permission denied. 1776 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1777 * @throws { BusinessError } 401 - The parameter check failed. 1778 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 1779 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1780 * @systemapi 1781 * @since 10 1782 */ 1783 function getBundleArchiveInfoSync(hapFilePath: string, bundleFlags: number): BundleInfo; 1784 1785 /** 1786 * Clears cache data of a specified application. 1787 * 1788 * @permission ohos.permission.REMOVE_CACHE_FILES 1789 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 1790 * @param { AsyncCallback<void> } callback - The callback of cleaning bundle cache files result. 1791 * @throws { BusinessError } 201 - Permission denied. 1792 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1793 * @throws { BusinessError } 401 - The parameter check failed. 1794 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1795 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 1796 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1797 * @systemapi 1798 * @since 9 1799 */ 1800 function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback<void>): void; 1801 1802 /** 1803 * Clears cache data of a specified application. 1804 * 1805 * @permission ohos.permission.REMOVE_CACHE_FILES 1806 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 1807 * @returns { Promise<void> } Clean bundle cache files result 1808 * @throws { BusinessError } 201 - Permission denied. 1809 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1810 * @throws { BusinessError } 401 - The parameter check failed. 1811 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1812 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 1813 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1814 * @systemapi 1815 * @since 9 1816 */ 1817 function cleanBundleCacheFiles(bundleName: string): Promise<void>; 1818 1819 /** 1820 * Sets whether to enable a specified application. 1821 * 1822 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1823 * @param { string } bundleName - Indicates the bundle name of the application. 1824 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1825 * @param { AsyncCallback<void> } callback - The callback of setting app enabled result. 1826 * @throws { BusinessError } 201 - Permission denied. 1827 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1828 * @throws { BusinessError } 401 - The parameter check failed. 1829 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1830 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1831 * @systemapi 1832 * @since 9 1833 */ 1834 function setApplicationEnabled(bundleName: string, isEnabled: boolean, callback: AsyncCallback<void>): void; 1835 1836 /** 1837 * Sets whether to enable a specified application. 1838 * 1839 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1840 * @param { string } bundleName - Indicates the bundle name of the application. 1841 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1842 * @returns { Promise<void> } set app enabled result. 1843 * @throws { BusinessError } 201 - Permission denied. 1844 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1845 * @throws { BusinessError } 401 - The parameter check failed. 1846 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1847 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1848 * @systemapi 1849 * @since 9 1850 */ 1851 function setApplicationEnabled(bundleName: string, isEnabled: boolean): Promise<void>; 1852 1853 /** 1854 * Sets whether to enable a specified application. 1855 * 1856 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1857 * @param { string } bundleName - Indicates the bundle name of the application. 1858 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1859 * @throws { BusinessError } 201 - Permission denied. 1860 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1861 * @throws { BusinessError } 401 - The parameter check failed. 1862 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1863 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1864 * @systemapi 1865 * @since 10 1866 */ 1867 function setApplicationEnabledSync(bundleName: string, isEnabled: boolean): void; 1868 1869 /** 1870 * Sets whether to enable a specified ability. 1871 * 1872 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1873 * @param { AbilityInfo } info - Indicates information about the ability to set. 1874 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1875 * @param { AsyncCallback<void> } callback - The callback of setting ability enabled result. 1876 * @throws { BusinessError } 201 - Permission denied. 1877 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1878 * @throws { BusinessError } 401 - The parameter check failed. 1879 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1880 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 1881 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1882 * @systemapi 1883 * @since 9 1884 */ 1885 function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean, callback: AsyncCallback<void>): void; 1886 1887 /** 1888 * Sets whether to enable a specified ability. 1889 * 1890 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1891 * @param { AbilityInfo } info - Indicates information about the ability to set. 1892 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1893 * @returns { Promise<void> } set ability enabled result. 1894 * @throws { BusinessError } 201 - Permission denied. 1895 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1896 * @throws { BusinessError } 401 - The parameter check failed. 1897 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1898 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 1899 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1900 * @systemapi 1901 * @since 9 1902 */ 1903 function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean): Promise<void>; 1904 1905 /** 1906 * Sets whether to enable a specified ability. 1907 * 1908 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1909 * @param { AbilityInfo } info - Indicates information about the ability to set. 1910 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1911 * @throws { BusinessError } 201 - Permission denied. 1912 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1913 * @throws { BusinessError } 401 - The parameter check failed. 1914 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1915 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 1916 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1917 * @systemapi 1918 * @since 10 1919 */ 1920 function setAbilityEnabledSync(info: AbilityInfo, isEnabled: boolean): void; 1921 1922 /** 1923 * Checks whether a specified application is enabled. 1924 * 1925 * @param { string } bundleName - Indicates the bundle name of the application. 1926 * @param { AsyncCallback<boolean> } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise. 1927 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1928 * @throws { BusinessError } 401 - The parameter check failed. 1929 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1930 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1931 * @systemapi 1932 * @since 9 1933 */ 1934 function isApplicationEnabled(bundleName: string, callback: AsyncCallback<boolean>): void; 1935 1936 /** 1937 * Checks whether a specified application is enabled. 1938 * 1939 * @param { string } bundleName - Indicates the bundle name of the application. 1940 * @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise. 1941 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1942 * @throws { BusinessError } 401 - The parameter check failed. 1943 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1944 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1945 * @systemapi 1946 * @since 9 1947 */ 1948 function isApplicationEnabled(bundleName: string): Promise<boolean>; 1949 1950 /** 1951 * Checks whether a specified application is enabled. 1952 * 1953 * @param { string } bundleName - Indicates the bundle name of the application. 1954 * @returns { boolean } Returns true if the application is enabled; returns false otherwise. 1955 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1956 * @throws { BusinessError } 401 - The parameter check failed. 1957 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1958 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1959 * @systemapi 1960 * @since 10 1961 */ 1962 function isApplicationEnabledSync(bundleName: string): boolean; 1963 1964 /** 1965 * Checks whether a specified ability is enabled. 1966 * 1967 * @param { AbilityInfo } info - Indicates information about the ability to check. 1968 * @param { AsyncCallback<boolean> } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise. 1969 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1970 * @throws { BusinessError } 401 - The parameter check failed. 1971 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1972 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1973 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1974 * @systemapi 1975 * @since 9 1976 */ 1977 function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback<boolean>): void; 1978 1979 /** 1980 * Checks whether a specified ability is enabled. 1981 * 1982 * @param { AbilityInfo } info - Indicates information about the ability to check. 1983 * @returns { Promise<boolean> } Returns true if the ability is enabled; returns false otherwise. 1984 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1985 * @throws { BusinessError } 401 - The parameter check failed. 1986 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1987 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1988 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1989 * @systemapi 1990 * @since 9 1991 */ 1992 function isAbilityEnabled(info: AbilityInfo): Promise<boolean>; 1993 1994 /** 1995 * Checks whether a specified ability is enabled. 1996 * 1997 * @param { AbilityInfo } info - Indicates information about the ability to check. 1998 * @returns { boolean } Returns true if the ability is enabled; returns false otherwise. 1999 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2000 * @throws { BusinessError } 401 - The parameter check failed. 2001 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2002 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2003 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2004 * @systemapi 2005 * @since 10 2006 */ 2007 function isAbilityEnabledSync(info: AbilityInfo): boolean; 2008 2009 /** 2010 * Obtains the Want for starting the main ability of an application based on the 2011 * given bundle name. The main ability of an application is the ability that has the 2012 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2013 * 2014 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2015 * @param { string } bundleName - Indicates the bundle name of the application. 2016 * @param { number } userId - Indicates the user ID or do not pass user ID. 2017 * @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability. 2018 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2019 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2020 * @throws { BusinessError } 401 - Input parameters check failed. 2021 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2022 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2023 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2024 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2025 * @systemapi 2026 * @since 9 2027 */ 2028 function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback<Want>): void; 2029 2030 /** 2031 * Obtains the Want for starting the main ability of an application based on the 2032 * given bundle name. The main ability of an application is the ability that has the 2033 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2034 * 2035 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2036 * @param { string } bundleName - Indicates the bundle name of the application. 2037 * @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability. 2038 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2039 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2040 * @throws { BusinessError } 401 - Input parameters check failed. 2041 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2042 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2043 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2044 * @systemapi 2045 * @since 9 2046 */ 2047 function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback<Want>): void; 2048 2049 /** 2050 * Obtains the Want for starting the main ability of an application based on the 2051 * given bundle name. The main ability of an application is the ability that has the 2052 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2053 * 2054 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2055 * @param { string } bundleName - Indicates the bundle name of the application. 2056 * @param { number } userId - Indicates the user ID or do not pass user ID. 2057 * @returns { Promise<Want> } the Want for starting the application's main ability. 2058 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2059 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2060 * @throws { BusinessError } 401 - Input parameters check failed. 2061 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2062 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2063 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2064 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2065 * @systemapi 2066 * @since 9 2067 */ 2068 function getLaunchWantForBundle(bundleName: string, userId?: number): Promise<Want>; 2069 2070 /** 2071 * Obtains the Want for starting the main ability of an application based on the 2072 * given bundle name. The main ability of an application is the ability that has the 2073 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2074 * 2075 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2076 * @param { string } bundleName - Indicates the bundle name of the application. 2077 * @param { number } userId - Indicates the user ID or do not pass user ID. 2078 * @returns { Want } the Want for starting the application's main ability. 2079 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2080 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2081 * @throws { BusinessError } 401 - Input parameters check failed. 2082 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2083 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2084 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2085 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2086 * @systemapi 2087 * @since 10 2088 */ 2089 function getLaunchWantForBundleSync(bundleName: string, userId?: number): Want; 2090 2091 /** 2092 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2093 * 2094 * @param { string } moduleName - Indicates the moduleName of the application. 2095 * @param { string } abilityName - Indicates the abilityName of the application. 2096 * @param { string } metadataName - Indicates the name of metadata in ability. 2097 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2098 * @throws { BusinessError } 401 - Input parameters check failed. 2099 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2100 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2101 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2102 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2103 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2104 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2105 * @since 9 2106 */ 2107 /** 2108 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2109 * 2110 * @param { string } moduleName - Indicates the moduleName of the application. 2111 * @param { string } abilityName - Indicates the abilityName of the application. 2112 * @param { string } metadataName - Indicates the name of metadata in ability. 2113 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2114 * @throws { BusinessError } 401 - Input parameters check failed. 2115 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2116 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2117 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2118 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2119 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2120 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2121 * @atomicservice 2122 * @since 11 2123 */ 2124 function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback<Array<string>>): void; 2125 2126 /** 2127 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2128 * 2129 * @param { string } moduleName - Indicates the moduleName of the application. 2130 * @param { string } abilityName - Indicates the abilityName of the application. 2131 * @param { string } metadataName - Indicates the name of metadata in ability. 2132 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2133 * @throws { BusinessError } 401 - Input parameters check failed. 2134 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2135 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2136 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2137 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2138 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2139 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2140 * @since 9 2141 */ 2142 /** 2143 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2144 * 2145 * @param { string } moduleName - Indicates the moduleName of the application. 2146 * @param { string } abilityName - Indicates the abilityName of the application. 2147 * @param { string } metadataName - Indicates the name of metadata in ability. 2148 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2149 * @throws { BusinessError } 401 - Input parameters check failed. 2150 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2151 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2152 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2153 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2154 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2155 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2156 * @atomicservice 2157 * @since 11 2158 */ 2159 function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise<Array<string>>; 2160 2161 /** 2162 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2163 * 2164 * @param { string } moduleName - Indicates the moduleName of the application. 2165 * @param { string } abilityName - Indicates the abilityName of the application. 2166 * @param { string } metadataName - Indicates the name of metadata in ability. 2167 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2168 * @throws { BusinessError } 401 - Input parameters check failed. 2169 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2170 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2171 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2172 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2173 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2174 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2175 * @since 10 2176 */ 2177 /** 2178 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2179 * 2180 * @param { string } moduleName - Indicates the moduleName of the application. 2181 * @param { string } abilityName - Indicates the abilityName of the application. 2182 * @param { string } metadataName - Indicates the name of metadata in ability. 2183 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2184 * @throws { BusinessError } 401 - Input parameters check failed. 2185 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2186 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2187 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2188 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2189 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2190 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2191 * @atomicservice 2192 * @since 11 2193 */ 2194 function getProfileByAbilitySync(moduleName: string, abilityName: string, metadataName?: string): Array<string>; 2195 2196 /** 2197 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2198 * 2199 * @param { string } moduleName - Indicates the moduleName of the application. 2200 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2201 * @param { string } metadataName - Indicates the name of metadata in ability. 2202 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2203 * @throws { BusinessError } 401 - Input parameters check failed. 2204 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2205 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2206 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2207 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2208 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2209 * @since 9 2210 */ 2211 /** 2212 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2213 * 2214 * @param { string } moduleName - Indicates the moduleName of the application. 2215 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2216 * @param { string } metadataName - Indicates the name of metadata in ability. 2217 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2218 * @throws { BusinessError } 401 - Input parameters check failed. 2219 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2220 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2221 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2222 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2223 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2224 * @atomicservice 2225 * @since 11 2226 */ 2227 function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback<Array<string>>): void; 2228 2229 /** 2230 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2231 * 2232 * @param { string } moduleName - Indicates the moduleName of the application. 2233 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2234 * @param { string } metadataName - Indicates the name of metadata in ability. 2235 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2236 * @throws { BusinessError } 401 - Input parameters check failed. 2237 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2238 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2239 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2240 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2241 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2242 * @since 9 2243 */ 2244 /** 2245 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2246 * 2247 * @param { string } moduleName - Indicates the moduleName of the application. 2248 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2249 * @param { string } metadataName - Indicates the name of metadata in ability. 2250 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2251 * @throws { BusinessError } 401 - Input parameters check failed. 2252 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2253 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2254 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2255 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2256 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2257 * @atomicservice 2258 * @since 11 2259 */ 2260 function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise<Array<string>>; 2261 2262 /** 2263 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2264 * 2265 * @param { string } moduleName - Indicates the moduleName of the application. 2266 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2267 * @param { string } metadataName - Indicates the name of metadata in ability. 2268 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2269 * @throws { BusinessError } 401 - Input parameters check failed. 2270 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2271 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2272 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2273 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2274 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2275 * @since 10 2276 */ 2277 /** 2278 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2279 * 2280 * @param { string } moduleName - Indicates the moduleName of the application. 2281 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2282 * @param { string } metadataName - Indicates the name of metadata in ability. 2283 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2284 * @throws { BusinessError } 401 - Input parameters check failed. 2285 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2286 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2287 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2288 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2289 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2290 * @atomicservice 2291 * @since 11 2292 */ 2293 function getProfileByExtensionAbilitySync(moduleName: string, extensionAbilityName: string, metadataName?: string): Array<string>; 2294 2295 /** 2296 * Get the permission details by permission name. 2297 * 2298 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2299 * @param { string } permissionName - Indicates permission name. 2300 * @param { AsyncCallback<PermissionDef> } callback - The callback of get permissionDef object result. 2301 * @throws { BusinessError } 201 - Permission denied. 2302 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2303 * @throws { BusinessError } 401 - Input parameters check failed. 2304 * @throws { BusinessError } 17700006 - The specified permission is not found. 2305 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2306 * @systemapi 2307 * @since 9 2308 */ 2309 function getPermissionDef(permissionName: string, callback: AsyncCallback<PermissionDef>): void; 2310 2311 /** 2312 * Get the permission details by permission name. 2313 * 2314 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2315 * @param { string } permissionName - Indicates permission name. 2316 * @returns { Promise<PermissionDef> } Returns permissionDef object. 2317 * @throws { BusinessError } 201 - Permission denied. 2318 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2319 * @throws { BusinessError } 401 - Input parameters check failed. 2320 * @throws { BusinessError } 17700006 - The specified permission is not found. 2321 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2322 * @systemapi 2323 * @since 9 2324 */ 2325 function getPermissionDef(permissionName: string): Promise<PermissionDef>; 2326 2327 /** 2328 * Get the permission details by permission name. 2329 * 2330 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2331 * @param { string } permissionName - Indicates permission name. 2332 * @returns { PermissionDef } Returns permissionDef object. 2333 * @throws { BusinessError } 201 - Permission denied. 2334 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2335 * @throws { BusinessError } 401 - Input parameters check failed. 2336 * @throws { BusinessError } 17700006 - The specified permission is not found. 2337 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2338 * @systemapi 2339 * @since 10 2340 */ 2341 function getPermissionDefSync(permissionName: string): PermissionDef; 2342 2343 /** 2344 * Obtains the label of a specified ability. 2345 * 2346 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2347 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2348 * @param { string } moduleName - Indicates the module name. 2349 * @param { string } abilityName - Indicates the ability name. 2350 * @param { AsyncCallback<string> } callback - The callback of getting ability label result. 2351 * @throws { BusinessError } 201 - Permission denied. 2352 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2353 * @throws { BusinessError } 401 - The parameter check failed. 2354 * @throws { BusinessError } 801 - Capability not supported. 2355 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2356 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2357 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2358 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2359 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2360 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 2361 * @systemapi 2362 * @since 9 2363 */ 2364 function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback<string>): void; 2365 2366 /** 2367 * Obtains the label of a specified ability. 2368 * 2369 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2370 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2371 * @param { string } moduleName - Indicates the module name. 2372 * @param { string } abilityName - Indicates the ability name. 2373 * @returns { Promise<string> } Returns the label representing the label of the specified ability. 2374 * @throws { BusinessError } 201 - Permission denied. 2375 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2376 * @throws { BusinessError } 401 - The parameter check failed. 2377 * @throws { BusinessError } 801 - Capability not supported. 2378 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2379 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2380 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2381 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2382 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2383 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 2384 * @systemapi 2385 * @since 9 2386 */ 2387 function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise<string>; 2388 2389 /** 2390 * Obtains the label of a specified ability. 2391 * 2392 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2393 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2394 * @param { string } moduleName - Indicates the module name. 2395 * @param { string } abilityName - Indicates the ability name. 2396 * @returns { string } Returns the label representing the label of the specified ability. 2397 * @throws { BusinessError } 201 - Permission denied. 2398 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2399 * @throws { BusinessError } 401 - The parameter check failed. 2400 * @throws { BusinessError } 801 - Capability not supported. 2401 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2402 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2403 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2404 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2405 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2406 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 2407 * @systemapi 2408 * @since 10 2409 */ 2410 function getAbilityLabelSync(bundleName: string, moduleName: string, abilityName: string): string; 2411 2412 /** 2413 * Obtains applicationInfo based on a given bundleName and bundleFlags. 2414 * 2415 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2416 * @param { string } bundleName - Indicates the application bundle name to be queried. 2417 * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. 2418 * @param { number } userId - Indicates the user ID or do not pass user ID. 2419 * @returns { ApplicationInfo } - Returns the ApplicationInfo object. 2420 * @throws { BusinessError } 201 - Permission denied. 2421 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2422 * @throws { BusinessError } 401 - The parameter check failed. 2423 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2424 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2425 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2426 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2427 * @systemapi 2428 * @since 9 2429 */ 2430 function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number): ApplicationInfo; 2431 2432 /** 2433 * Obtains applicationInfo based on a given bundleName and bundleFlags. 2434 * 2435 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2436 * @param { string } bundleName - Indicates the application bundle name to be queried. 2437 * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. 2438 * @returns { ApplicationInfo } - Returns the ApplicationInfo object. 2439 * @throws { BusinessError } 201 - Permission denied. 2440 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2441 * @throws { BusinessError } 401 - The parameter check failed. 2442 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2443 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2444 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2445 * @systemapi 2446 * @since 9 2447 */ 2448 function getApplicationInfoSync(bundleName: string, applicationFlags: number): ApplicationInfo; 2449 2450 /** 2451 * Obtains bundleInfo based on bundleName, bundleFlags and userId. 2452 * 2453 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2454 * @param { string } bundleName - Indicates the application bundle name to be queried. 2455 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. 2456 * @param { number } userId - Indicates the user ID or do not pass user ID. 2457 * @returns { BundleInfo } - Returns the BundleInfo object. 2458 * @throws { BusinessError } 201 - Permission denied. 2459 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2460 * @throws { BusinessError } 401 - The parameter check failed. 2461 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2462 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2463 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2464 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2465 * @systemapi 2466 * @since 9 2467 */ 2468 function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo; 2469 2470 /** 2471 * Obtains bundleInfo based on bundleName, bundleFlags. 2472 * 2473 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2474 * @param { string } bundleName - Indicates the application bundle name to be queried. 2475 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. 2476 * @returns { BundleInfo } - Returns the BundleInfo object. 2477 * @throws { BusinessError } 201 - Permission denied. 2478 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2479 * @throws { BusinessError } 401 - The parameter check failed. 2480 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2481 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2482 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2483 * @systemapi 2484 * @since 9 2485 */ 2486 function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; 2487 2488 /** 2489 * Obtains SharedBundleInfo of all shared bundle available in the system. 2490 * 2491 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2492 * @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects. 2493 * @throws { BusinessError } 201 - Permission denied. 2494 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2495 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2496 * @systemapi 2497 * @since 10 2498 */ 2499 function getAllSharedBundleInfo(callback: AsyncCallback<Array<SharedBundleInfo>>): void; 2500 2501 /** 2502 * Obtains SharedBundleInfo of all shared bundle available in the system. 2503 * 2504 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2505 * @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects. 2506 * @throws { BusinessError } 201 - Permission denied. 2507 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2508 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2509 * @systemapi 2510 * @since 10 2511 */ 2512 function getAllSharedBundleInfo(): Promise<Array<SharedBundleInfo>>; 2513 2514 /** 2515 * Obtains SharedBundleInfo of shared bundle by bundle name and module name. 2516 * 2517 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2518 * @param { string } bundleName - Indicates the bundleName of the application. 2519 * @param { string } moduleName - Indicates the moduleName of the application. 2520 * @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects. 2521 * @throws { BusinessError } 201 - Permission denied. 2522 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2523 * @throws { BusinessError } 401 - The parameter check failed. 2524 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2525 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2526 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2527 * @systemapi 2528 * @since 10 2529 */ 2530 function getSharedBundleInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<SharedBundleInfo>>): void; 2531 2532 /** 2533 * Obtains SharedBundleInfo of shared bundle by bundle name and module name. 2534 * 2535 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2536 * @param { string } bundleName - Indicates the bundleName of the application. 2537 * @param { string } moduleName - Indicates the moduleName of the application. 2538 * @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects. 2539 * @throws { BusinessError } 201 - Permission denied. 2540 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2541 * @throws { BusinessError } 401 - The parameter check failed. 2542 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2543 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2544 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2545 * @systemapi 2546 * @since 10 2547 */ 2548 function getSharedBundleInfo(bundleName: string, moduleName: string): Promise<Array<SharedBundleInfo>>; 2549 2550 /** 2551 * Obtains the profile file information of a specified bundle. 2552 * 2553 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2554 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2555 * @param { AsyncCallback<AppProvisionInfo> } callback - Indicates the callback of getting AppProvisionInfo result. 2556 * @throws { BusinessError } 201 - Permission denied. 2557 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2558 * @throws { BusinessError } 401 - The parameter check failed. 2559 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2560 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2561 * @systemapi 2562 * @since 10 2563 */ 2564 function getAppProvisionInfo(bundleName: string, callback: AsyncCallback<AppProvisionInfo>): void; 2565 2566 /** 2567 * Obtains the profile file information of a specified bundle. 2568 * 2569 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2570 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2571 * @param { number } userId - Indicates the user ID or do not pass user ID. 2572 * @param { AsyncCallback<AppProvisionInfo> } callback - Indicates the callback of getting AppProvisionInfo result. 2573 * @throws { BusinessError } 201 - Permission denied. 2574 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2575 * @throws { BusinessError } 401 - The parameter check failed. 2576 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2577 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2578 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2579 * @systemapi 2580 * @since 10 2581 */ 2582 function getAppProvisionInfo(bundleName: string, userId: number, callback: AsyncCallback<AppProvisionInfo>): void; 2583 2584 /** 2585 * Obtains the profile file information of a specified bundle. 2586 * 2587 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2588 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2589 * @param { number } userId - Indicates the user ID or do not pass user ID. 2590 * @returns { Promise<AppProvisionInfo> } Returns the AppProvisionInfo object. 2591 * @throws { BusinessError } 201 - Permission denied. 2592 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2593 * @throws { BusinessError } 401 - The parameter check failed. 2594 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2595 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2596 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2597 * @systemapi 2598 * @since 10 2599 */ 2600 function getAppProvisionInfo(bundleName: string, userId?: number): Promise<AppProvisionInfo>; 2601 2602 /** 2603 * Obtains the profile file information of a specified bundle. 2604 * 2605 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2606 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2607 * @param { number } userId - Indicates the user ID or do not pass user ID. 2608 * @returns { AppProvisionInfo } Returns the AppProvisionInfo object. 2609 * @throws { BusinessError } 201 - Permission denied. 2610 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2611 * @throws { BusinessError } 401 - The parameter check failed. 2612 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2613 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2614 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2615 * @systemapi 2616 * @since 10 2617 */ 2618 function getAppProvisionInfoSync(bundleName: string, userId?: number): AppProvisionInfo; 2619 2620 /** 2621 * Obtains the distribution type specified during bundle installation. 2622 * 2623 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2624 * @param { string } bundleName - Indicates the application bundle name to be queried. 2625 * @returns { string } The specified distribution type. 2626 * @throws { BusinessError } 201 - Permission denied. 2627 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2628 * @throws { BusinessError } 401 - Input parameters check failed. 2629 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2630 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2631 * @systemapi 2632 * @since 10 2633 */ 2634 function getSpecifiedDistributionType(bundleName: string): string; 2635 2636 /** 2637 * Obtains the additional information during bundle installation. 2638 * 2639 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2640 * @param { string } bundleName - Indicates the application bundle name to be queried. 2641 * @returns { string } The additional information. 2642 * @throws { BusinessError } 201 - Permission denied. 2643 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2644 * @throws { BusinessError } 401 - Input parameters check failed. 2645 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2646 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2647 * @systemapi 2648 * @since 10 2649 */ 2650 function getAdditionalInfo(bundleName: string): string; 2651 2652 /** 2653 * Obtains the JSON profile designated by profileType, bundleName and moduleName. 2654 * 2655 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2656 * @param { ProfileType } profileType - Indicates the type of profile to be obtained. 2657 * @param { string } bundleName - Indicates the name of the bundle to which the profile belongs. 2658 * @param { string } moduleName - Indicates the name of the module to which the profile belongs. 2659 * @returns { string } Returns string in json-format of the designated profile. 2660 * @throws { BusinessError } 201 - Permission denied. 2661 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2662 * @throws { BusinessError } 401 - The parameter check failed. 2663 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2664 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2665 * @throws { BusinessError } 17700024 - Failed to get the profile because the specified profile is not found in the HAP. 2666 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2667 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2668 * @systemapi 2669 * @since 11 2670 */ 2671 function getJsonProfile(profileType: ProfileType, bundleName: string, moduleName?: string): string; 2672 2673 /** 2674 * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. 2675 * 2676 * @permission ohos.permission.RUN_DYN_CODE 2677 * @param { Array<string> } abcPaths - The abc path. 2678 * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. 2679 * @param { AsyncCallback<void> } callback - Indicates the callback of verifyAbc result. 2680 * @throws { BusinessError } 201 - Permission denied. 2681 * @throws { BusinessError } 401 - The parameter check failed. 2682 * @throws { BusinessError } 17700201 - verifyAbc failed. 2683 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2684 * @since 11 2685 */ 2686 function verifyAbc(abcPaths: Array<string>, deleteOriginalFiles: boolean, callback: AsyncCallback<void>): void; 2687 2688 /** 2689 * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. 2690 * 2691 * @permission ohos.permission.RUN_DYN_CODE 2692 * @param { Array<string> } abcPaths - The abc path. 2693 * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. 2694 * @returns { Promise<void> } Returns verifyAbc result. 2695 * @throws { BusinessError } 201 - Permission denied. 2696 * @throws { BusinessError } 401 - The parameter check failed. 2697 * @throws { BusinessError } 17700201 - verifyAbc failed. 2698 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2699 * @since 11 2700 */ 2701 function verifyAbc(abcPaths: Array<string>, deleteOriginalFiles: boolean): Promise<void>; 2702 2703 /** 2704 * Obtains recoverable preinstalled applications. 2705 * 2706 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2707 * @param { AsyncCallback<Array<RecoverableApplicationInfo>> } callback - The callback of getting a list of RecoverableApplicationInfo objects. 2708 * @throws { BusinessError } 201 - Permission denied. 2709 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2710 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2711 * @systemapi 2712 * @since 11 2713 */ 2714 function getRecoverableApplicationInfo(callback: AsyncCallback<Array<RecoverableApplicationInfo>>): void; 2715 2716 /** 2717 * Obtains recoverable preinstalled applications. 2718 * 2719 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2720 * @returns { Promise<Array<RecoverableApplicationInfo>> } Returns a list of RecoverableApplicationInfo objects. 2721 * @throws { BusinessError } 201 - Permission denied. 2722 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2723 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2724 * @systemapi 2725 * @since 11 2726 */ 2727 function getRecoverableApplicationInfo(): Promise<Array<RecoverableApplicationInfo>>; 2728 2729 /** 2730 * Set additional information to the specified application. 2731 * 2732 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2733 * @param { string } bundleName - Indicates the bundle name of the application. 2734 * @param { string } additionalInfo - The additional information. 2735 * @throws { BusinessError } 201 - Permission denied. 2736 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2737 * @throws { BusinessError } 401 - The parameter check failed. 2738 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2739 * @throws { BusinessError } 17700053 - Not app gallery call. 2740 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2741 * @systemapi 2742 * @since 11 2743 */ 2744 function setAdditionalInfo(bundleName: string, additionalInfo: string): void; 2745 2746 /** 2747 * Delete the verified .abc file. 2748 * 2749 * @permission ohos.permission.RUN_DYN_CODE 2750 * @param { string } abcPath - The abc path. 2751 * @returns { Promise<void> } Returns deleteAbc result. 2752 * @throws { BusinessError } 201 - Permission denied. 2753 * @throws { BusinessError } 401 - The parameter check failed. 2754 * @throws { BusinessError } 17700202 - deleteAbc failed. 2755 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2756 * @since 11 2757 */ 2758 function deleteAbc(abcPath: string): Promise<void>; 2759 2760 /** 2761 * Obtains configuration information about an application. 2762 * 2763 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2764 * @since 9 2765 */ 2766 /** 2767 * Obtains configuration information about an application. 2768 * 2769 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2770 * @atomicservice 2771 * @since 11 2772 */ 2773 export type ApplicationInfo = _ApplicationInfo; 2774 2775 /** 2776 * Indicates the metadata information about a module. 2777 * 2778 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2779 * @since 10 2780 */ 2781 /** 2782 * Indicates the metadata information about a module. 2783 * 2784 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2785 * @atomicservice 2786 * @since 11 2787 */ 2788 export type ModuleMetadata = _ModuleMetadata; 2789 2790 /** 2791 * Indicates the Metadata. 2792 * 2793 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2794 * @since 9 2795 */ 2796 /** 2797 * Indicates the Metadata. 2798 * 2799 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2800 * @atomicservice 2801 * @since 11 2802 */ 2803 export type Metadata = _Metadata; 2804 2805 /** 2806 * Obtains configuration information about a bundle. 2807 * 2808 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2809 * @since 9 2810 */ 2811 /** 2812 * Obtains configuration information about a bundle. 2813 * 2814 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2815 * @atomicservice 2816 * @since 11 2817 */ 2818 export type BundleInfo = _BundleInfo.BundleInfo; 2819 2820 /** 2821 * The scene which is used. 2822 * 2823 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2824 * @since 9 2825 */ 2826 /** 2827 * The scene which is used. 2828 * 2829 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2830 * @atomicservice 2831 * @since 11 2832 */ 2833 export type UsedScene = _BundleInfo.UsedScene; 2834 2835 /** 2836 * Indicates the required permissions details defined in file config.json. 2837 * 2838 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2839 * @since 9 2840 */ 2841 /** 2842 * Indicates the required permissions details defined in file config.json. 2843 * 2844 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2845 * @atomicservice 2846 * @since 11 2847 */ 2848 export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; 2849 2850 /** 2851 * Indicates the SignatureInfo. 2852 * 2853 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2854 * @since 9 2855 */ 2856 /** 2857 * Indicates the SignatureInfo. 2858 * 2859 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2860 * @atomicservice 2861 * @since 11 2862 */ 2863 export type SignatureInfo = _BundleInfo.SignatureInfo; 2864 2865 /** 2866 * Obtains configuration information about a module. 2867 * 2868 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2869 * @since 9 2870 */ 2871 /** 2872 * Obtains configuration information about a module. 2873 * 2874 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2875 * @atomicservice 2876 * @since 11 2877 */ 2878 export type HapModuleInfo = _HapModuleInfo.HapModuleInfo; 2879 2880 /** 2881 * Obtains preload information about a module. 2882 * 2883 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2884 * @since 9 2885 */ 2886 /** 2887 * Obtains preload information about a module. 2888 * 2889 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2890 * @atomicservice 2891 * @since 11 2892 */ 2893 export type PreloadItem = _HapModuleInfo.PreloadItem; 2894 2895 /** 2896 * Obtains dependency information about a module. 2897 * 2898 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2899 * @since 9 2900 */ 2901 /** 2902 * Obtains dependency information about a module. 2903 * 2904 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2905 * @atomicservice 2906 * @since 11 2907 */ 2908 export type Dependency = _HapModuleInfo.Dependency; 2909 2910 /** 2911 * Obtains configuration information about an ability. 2912 * 2913 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2914 * @since 9 2915 */ 2916 /** 2917 * Obtains configuration information about an ability. 2918 * 2919 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2920 * @atomicservice 2921 * @since 11 2922 */ 2923 export type AbilityInfo = _AbilityInfo.AbilityInfo; 2924 2925 /** 2926 * Contains basic Ability information. Indicates the window size.. 2927 * 2928 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2929 * @since 9 2930 */ 2931 /** 2932 * Contains basic Ability information. Indicates the window size.. 2933 * 2934 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2935 * @atomicservice 2936 * @since 11 2937 */ 2938 export type WindowSize = _AbilityInfo.WindowSize; 2939 2940 /** 2941 * Obtains extension information about a bundle. 2942 * 2943 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2944 * @since 9 2945 */ 2946 /** 2947 * Obtains extension information about a bundle. 2948 * 2949 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2950 * @atomicservice 2951 * @since 11 2952 */ 2953 export type ExtensionAbilityInfo = _ExtensionAbilityInfo.ExtensionAbilityInfo; 2954 2955 /** 2956 * Indicates the defined permission details in file config.json. 2957 * 2958 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2959 * @systemapi 2960 * @since 9 2961 */ 2962 export type PermissionDef = _PermissionDef; 2963 2964 /** 2965 * Contains basic Ability information, which uniquely identifies an ability. 2966 * 2967 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2968 * @since 9 2969 */ 2970 /** 2971 * Contains basic Ability information, which uniquely identifies an ability. 2972 * 2973 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2974 * @atomicservice 2975 * @since 11 2976 */ 2977 export type ElementName = _ElementName; 2978 2979 /** 2980 * Contains shared bundle info. 2981 * 2982 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2983 * @systemapi 2984 * @since 10 2985 */ 2986 export type SharedBundleInfo = _SharedBundleInfo; 2987 2988 /** 2989 * Obtains profile file information about a bundle. 2990 * 2991 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2992 * @systemapi 2993 * @since 10 2994 */ 2995 export type AppProvisionInfo = _AppProvisionInfo.AppProvisionInfo; 2996 2997 /** 2998 * Obtains profile file validity about a bundle. 2999 * 3000 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3001 * @systemapi 3002 * @since 10 3003 */ 3004 export type Validity = _AppProvisionInfo.Validity; 3005 3006 /** 3007 * Obtains information about a recoverable preinstalled application. 3008 * 3009 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3010 * @systemapi 3011 * @since 11 3012 */ 3013 export type RecoverableApplicationInfo = _RecoverableApplicationInfo; 3014} 3015 3016export default bundleManager; 3017