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 16import { AsyncCallback } from './@ohos.base'; 17import type { ApplicationInfo as _ApplicationInfo, ModuleMetadata as _ModuleMetadata } from './bundleManager/ApplicationInfo'; 18import { Metadata as _Metadata } from './bundleManager/Metadata'; 19import { PermissionDef as _PermissionDef } from './bundleManager/PermissionDef'; 20import { ElementName as _ElementName } from './bundleManager/ElementName'; 21import { SharedBundleInfo as _SharedBundleInfo } from './bundleManager/SharedBundleInfo'; 22import Want from './@ohos.app.ability.Want'; 23import * as _AbilityInfo from './bundleManager/AbilityInfo'; 24import * as _AppProvisionInfo from './bundleManager/AppProvisionInfo'; 25import * as _BundleInfo from './bundleManager/BundleInfo'; 26import * as _HapModuleInfo from './bundleManager/HapModuleInfo'; 27import * as _ExtensionAbilityInfo from './bundleManager/ExtensionAbilityInfo'; 28 29/** 30 * This module is used to obtain package information of various applications installed on the current device. 31 * 32 * @namespace bundleManager 33 * @syscap SystemCapability.BundleManager.BundleFramework.Core 34 * @since 9 35 */ 36declare namespace bundleManager { 37 /** 38 * Used to query the enumeration value of bundleInfo. Multiple values can be passed in the form. 39 * 40 * @enum { number } 41 * @syscap SystemCapability.BundleManager.BundleFramework.Core 42 * @since 9 43 */ 44 enum BundleFlag { 45 /** 46 * Used to obtain the default bundleInfo. The obtained bundleInfo does not contain information of 47 * signatureInfo, applicationInfo, hapModuleInfo, ability, extensionAbility and permission. 48 * 49 * @syscap SystemCapability.BundleManager.BundleFramework.Core 50 * @since 9 51 */ 52 GET_BUNDLE_INFO_DEFAULT = 0x00000000, 53 /** 54 * Used to obtain the bundleInfo containing applicationInfo. The obtained bundleInfo does not 55 * contain the information of signatureInfo, hapModuleInfo, ability, extensionAbility and permission. 56 * 57 * @syscap SystemCapability.BundleManager.BundleFramework.Core 58 * @since 9 59 */ 60 GET_BUNDLE_INFO_WITH_APPLICATION = 0x00000001, 61 /** 62 * Used to obtain the bundleInfo containing hapModuleInfo. The obtained bundleInfo does not 63 * contain the information of signatureInfo, applicationInfo, ability, extensionAbility and permission. 64 * 65 * @syscap SystemCapability.BundleManager.BundleFramework.Core 66 * @since 9 67 */ 68 GET_BUNDLE_INFO_WITH_HAP_MODULE = 0x00000002, 69 /** 70 * Used to obtain the bundleInfo containing ability. The obtained bundleInfo does not 71 * contain the information of signatureInfo, applicationInfo, extensionAbility and permission. 72 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 73 * 74 * @syscap SystemCapability.BundleManager.BundleFramework.Core 75 * @since 9 76 */ 77 GET_BUNDLE_INFO_WITH_ABILITY = 0x00000004, 78 /** 79 * Used to obtain the bundleInfo containing extensionAbility. The obtained bundleInfo does not 80 * contain the information of signatureInfo, applicationInfo, ability and permission. 81 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 82 * 83 * @syscap SystemCapability.BundleManager.BundleFramework.Core 84 * @since 9 85 */ 86 GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY = 0x00000008, 87 /** 88 * Used to obtain the bundleInfo containing permission. The obtained bundleInfo does not 89 * contain the information of signatureInfo, applicationInfo, hapModuleInfo, extensionAbility and ability. 90 * 91 * @syscap SystemCapability.BundleManager.BundleFramework.Core 92 * @since 9 93 */ 94 GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION = 0x00000010, 95 /** 96 * Used to obtain the metadata contained in applicationInfo, moduleInfo and abilityInfo. 97 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_APPLICATION, 98 * GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. 99 * 100 * @syscap SystemCapability.BundleManager.BundleFramework.Core 101 * @since 9 102 */ 103 GET_BUNDLE_INFO_WITH_METADATA = 0x00000020, 104 /** 105 * Used to obtain the default bundleInfo containing disabled application and ability. 106 * The obtained bundleInfo does not contain information of signatureInfo, applicationInfo, 107 * hapModuleInfo, ability, extensionAbility and permission. 108 * 109 * @syscap SystemCapability.BundleManager.BundleFramework.Core 110 * @since 9 111 */ 112 GET_BUNDLE_INFO_WITH_DISABLE = 0x00000040, 113 /** 114 * Used to obtain the bundleInfo containing signatureInfo. The obtained bundleInfo does not 115 * contain the information of applicationInfo, hapModuleInfo, extensionAbility, ability and permission. 116 * 117 * @syscap SystemCapability.BundleManager.BundleFramework.Core 118 * @since 9 119 */ 120 GET_BUNDLE_INFO_WITH_SIGNATURE_INFO = 0x00000080 121 } 122 123 /** 124 * Used to query the enumeration value of applicationInfo. Multiple values can be passed in the form. 125 * 126 * @enum { number } 127 * @syscap SystemCapability.BundleManager.BundleFramework.Core 128 * @systemapi 129 * @since 9 130 */ 131 enum ApplicationFlag { 132 /** 133 * Used to obtain the default applicationInfo. The obtained applicationInfo does not contain the information of 134 * permission and metadata. 135 * 136 * @syscap SystemCapability.BundleManager.BundleFramework.Core 137 * @systemapi 138 * @since 9 139 */ 140 GET_APPLICATION_INFO_DEFAULT = 0x00000000, 141 /** 142 * Used to obtain the applicationInfo containing permission. 143 * 144 * @syscap SystemCapability.BundleManager.BundleFramework.Core 145 * @systemapi 146 * @since 9 147 */ 148 GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000001, 149 /** 150 * Used to obtain the applicationInfo containing metadata. 151 * 152 * @syscap SystemCapability.BundleManager.BundleFramework.Core 153 * @systemapi 154 * @since 9 155 */ 156 GET_APPLICATION_INFO_WITH_METADATA = 0x00000002, 157 /** 158 * Used to obtain the applicationInfo containing disabled application. 159 * 160 * @syscap SystemCapability.BundleManager.BundleFramework.Core 161 * @systemapi 162 * @since 9 163 */ 164 GET_APPLICATION_INFO_WITH_DISABLE = 0x00000004 165 } 166 167 /** 168 * Used to query the enumeration value of abilityInfo. Multiple values can be passed in the form. 169 * 170 * @enum { number } 171 * @syscap SystemCapability.BundleManager.BundleFramework.Core 172 * @systemapi 173 * @since 9 174 */ 175 enum AbilityFlag { 176 /** 177 * Used to obtain the default abilityInfo. The obtained abilityInfo does not contain the information of 178 * permission, metadata and disabled abilityInfo. 179 * 180 * @syscap SystemCapability.BundleManager.BundleFramework.Core 181 * @systemapi 182 * @since 9 183 */ 184 GET_ABILITY_INFO_DEFAULT = 0x00000000, 185 /** 186 * Used to obtain the abilityInfo containing permission. 187 * 188 * @syscap SystemCapability.BundleManager.BundleFramework.Core 189 * @systemapi 190 * @since 9 191 */ 192 GET_ABILITY_INFO_WITH_PERMISSION = 0x00000001, 193 /** 194 * Used to obtain the abilityInfo containing applicationInfo. 195 * 196 * @syscap SystemCapability.BundleManager.BundleFramework.Core 197 * @systemapi 198 * @since 9 199 */ 200 GET_ABILITY_INFO_WITH_APPLICATION = 0x00000002, 201 /** 202 * Used to obtain the abilityInfo containing metadata. 203 * 204 * @syscap SystemCapability.BundleManager.BundleFramework.Core 205 * @systemapi 206 * @since 9 207 */ 208 GET_ABILITY_INFO_WITH_METADATA = 0x00000004, 209 /** 210 * Used to obtain the abilityInfo containing disabled abilityInfo. 211 * 212 * @syscap SystemCapability.BundleManager.BundleFramework.Core 213 * @systemapi 214 * @since 9 215 */ 216 GET_ABILITY_INFO_WITH_DISABLE = 0x00000008, 217 /** 218 * Used to obtain the abilityInfo only for system app. 219 * 220 * @syscap SystemCapability.BundleManager.BundleFramework.Core 221 * @systemapi 222 * @since 9 223 */ 224 GET_ABILITY_INFO_ONLY_SYSTEM_APP = 0x00000010 225 } 226 227 /** 228 * Used to query the enumeration value of ExtensionAbilityInfo. Multiple values can be passed in the form. 229 * 230 * @enum { number } 231 * @syscap SystemCapability.BundleManager.BundleFramework.Core 232 * @systemapi 233 * @since 9 234 */ 235 enum ExtensionAbilityFlag { 236 /** 237 * Used to obtain the default extensionAbilityInfo. The obtained extensionAbilityInfo does not contain the information of 238 * permission, metadata and disabled abilityInfo. 239 * 240 * @syscap SystemCapability.BundleManager.BundleFramework.Core 241 * @systemapi 242 * @since 9 243 */ 244 GET_EXTENSION_ABILITY_INFO_DEFAULT = 0x00000000, 245 /** 246 * Used to obtain the extensionAbilityInfo containing permission. 247 * 248 * @syscap SystemCapability.BundleManager.BundleFramework.Core 249 * @systemapi 250 * @since 9 251 */ 252 GET_EXTENSION_ABILITY_INFO_WITH_PERMISSION = 0x00000001, 253 /** 254 * Used to obtain the extensionAbilityInfo containing applicationInfo. 255 * 256 * @syscap SystemCapability.BundleManager.BundleFramework.Core 257 * @systemapi 258 * @since 9 259 */ 260 GET_EXTENSION_ABILITY_INFO_WITH_APPLICATION = 0x00000002, 261 /** 262 * Used to obtain the extensionAbilityInfo containing metadata. 263 * 264 * @syscap SystemCapability.BundleManager.BundleFramework.Core 265 * @systemapi 266 * @since 9 267 */ 268 GET_EXTENSION_ABILITY_INFO_WITH_METADATA = 0x00000004 269 } 270 271 /** 272 * This enumeration value is used to identify various types of extension ability 273 * 274 * @enum { number } 275 * @syscap SystemCapability.BundleManager.BundleFramework.Core 276 * @since 9 277 */ 278 export enum ExtensionAbilityType { 279 /** 280 * Indicates extension info with type of form 281 * 282 * @syscap SystemCapability.BundleManager.BundleFramework.Core 283 * @since 9 284 */ 285 FORM = 0, 286 287 /** 288 * Indicates extension info with type of work schedule 289 * 290 * @syscap SystemCapability.BundleManager.BundleFramework.Core 291 * @since 9 292 */ 293 WORK_SCHEDULER = 1, 294 295 /** 296 * Indicates extension info with type of input method 297 * 298 * @syscap SystemCapability.BundleManager.BundleFramework.Core 299 * @since 9 300 */ 301 INPUT_METHOD = 2, 302 303 /** 304 * Indicates extension info with type of service 305 * 306 * @syscap SystemCapability.BundleManager.BundleFramework.Core 307 * @since 9 308 */ 309 SERVICE = 3, 310 311 /** 312 * Indicates extension info with type of accessibility 313 * 314 * @syscap SystemCapability.BundleManager.BundleFramework.Core 315 * @since 9 316 */ 317 ACCESSIBILITY = 4, 318 319 /** 320 * Indicates extension info with type of dataShare 321 * 322 * @syscap SystemCapability.BundleManager.BundleFramework.Core 323 * @since 9 324 */ 325 DATA_SHARE = 5, 326 327 /** 328 * Indicates extension info with type of filesShare 329 * 330 * @syscap SystemCapability.BundleManager.BundleFramework.Core 331 * @since 9 332 */ 333 FILE_SHARE = 6, 334 335 /** 336 * Indicates extension info with type of staticSubscriber 337 * 338 * @syscap SystemCapability.BundleManager.BundleFramework.Core 339 * @since 9 340 */ 341 STATIC_SUBSCRIBER = 7, 342 343 /** 344 * Indicates extension info with type of wallpaper 345 * 346 * @syscap SystemCapability.BundleManager.BundleFramework.Core 347 * @since 9 348 */ 349 WALLPAPER = 8, 350 351 /** 352 * Indicates extension info with type of backup 353 * 354 * @syscap SystemCapability.BundleManager.BundleFramework.Core 355 * @since 9 356 */ 357 BACKUP = 9, 358 359 /** 360 * Indicates extension info with type of window 361 * 362 * @syscap SystemCapability.BundleManager.BundleFramework.Core 363 * @since 9 364 */ 365 WINDOW = 10, 366 367 /** 368 * Indicates extension info with type of enterprise admin 369 * 370 * @syscap SystemCapability.BundleManager.BundleFramework.Core 371 * @since 9 372 */ 373 ENTERPRISE_ADMIN = 11, 374 375 /** 376 * Indicates extension info with type of thumbnail 377 * 378 * @syscap SystemCapability.BundleManager.BundleFramework.Core 379 * @since 9 380 */ 381 THUMBNAIL = 13, 382 383 /** 384 * Indicates extension info with type of preview 385 * 386 * @syscap SystemCapability.BundleManager.BundleFramework.Core 387 * @since 9 388 */ 389 PREVIEW = 14, 390 391 /** 392 * Indicates extension info with type of print 393 * 394 * @syscap SystemCapability.BundleManager.BundleFramework.Core 395 * @since 10 396 */ 397 PRINT = 15, 398 399 /** 400 * Indicates extension info with type of share 401 * 402 * @syscap SystemCapability.BundleManager.BundleFramework.Core 403 * @since 10 404 */ 405 SHARE = 16, 406 407 /** 408 * Indicates extension info with type of push 409 * 410 * @syscap SystemCapability.BundleManager.BundleFramework.Core 411 * @since 10 412 */ 413 PUSH = 17, 414 415 /** 416 * Indicates extension info with type of driver 417 * 418 * @syscap SystemCapability.BundleManager.BundleFramework.Core 419 * @since 10 420 */ 421 DRIVER = 18, 422 423 /** 424 * Indicates extension info with type of action 425 * 426 * @syscap SystemCapability.BundleManager.BundleFramework.Core 427 * @since 10 428 */ 429 ACTION = 19, 430 431 /** 432 * Indicates extension info with type of unspecified 433 * 434 * @syscap SystemCapability.BundleManager.BundleFramework.Core 435 * @since 9 436 */ 437 UNSPECIFIED = 255 438 } 439 440 /** 441 * PermissionGrantState 442 * 443 * @enum { number } 444 * @syscap SystemCapability.BundleManager.BundleFramework.Core 445 * @since 9 446 */ 447 export enum PermissionGrantState { 448 /** 449 * PERMISSION_DENIED 450 * 451 * @syscap SystemCapability.BundleManager.BundleFramework.Core 452 * @since 9 453 */ 454 PERMISSION_DENIED = -1, 455 456 /** 457 * PERMISSION_GRANTED 458 * 459 * @syscap SystemCapability.BundleManager.BundleFramework.Core 460 * @since 9 461 */ 462 PERMISSION_GRANTED = 0 463 } 464 465 /** 466 * Support window mode 467 * 468 * @enum { number } 469 * @syscap SystemCapability.BundleManager.BundleFramework.Core 470 * @since 9 471 */ 472 export enum SupportWindowMode { 473 /** 474 * Indicates supported window mode of full screen mode 475 * 476 * @syscap SystemCapability.BundleManager.BundleFramework.Core 477 * @since 9 478 */ 479 FULL_SCREEN = 0, 480 /** 481 * Indicates supported window mode of split mode 482 * 483 * @syscap SystemCapability.BundleManager.BundleFramework.Core 484 * @since 9 485 */ 486 SPLIT = 1, 487 /** 488 * Indicates supported window mode of floating mode 489 * 490 * @syscap SystemCapability.BundleManager.BundleFramework.Core 491 * @since 9 492 */ 493 FLOATING = 2 494 } 495 496 /** 497 * Launch type 498 * 499 * @enum { number } 500 * @syscap SystemCapability.BundleManager.BundleFramework.Core 501 * @since 9 502 */ 503 /** 504 * Launch type 505 * 506 * @enum { number } 507 * @syscap SystemCapability.BundleManager.BundleFramework.Core 508 * @crossplatform 509 * @since 10 510 */ 511 export enum LaunchType { 512 /** 513 * Indicates that the ability has only one instance 514 * 515 * @syscap SystemCapability.BundleManager.BundleFramework.Core 516 * @since 9 517 */ 518 /** 519 * Indicates that the ability has only one instance 520 * 521 * @syscap SystemCapability.BundleManager.BundleFramework.Core 522 * @crossplatform 523 * @since 10 524 */ 525 SINGLETON = 0, 526 527 /** 528 * Indicates that the ability can have multiple instances 529 * 530 * @syscap SystemCapability.BundleManager.BundleFramework.Core 531 * @since 9 532 */ 533 /** 534 * Indicates that the ability can have multiple instances 535 * 536 * @syscap SystemCapability.BundleManager.BundleFramework.Core 537 * @crossplatform 538 * @since 10 539 */ 540 MULTITON = 1, 541 542 /** 543 * Indicates that the ability can have specified instances 544 * 545 * @syscap SystemCapability.BundleManager.BundleFramework.Core 546 * @since 9 547 */ 548 SPECIFIED = 2 549 } 550 551 /** 552 * Indicates ability type 553 * 554 * @enum { number } 555 * @syscap SystemCapability.BundleManager.BundleFramework.Core 556 * @FAModelOnly 557 * @since 9 558 */ 559 export enum AbilityType { 560 /** 561 * Indicates that the ability has a UI 562 * 563 * @syscap SystemCapability.BundleManager.BundleFramework.Core 564 * @FAModelOnly 565 * @since 9 566 */ 567 PAGE = 1, 568 569 /** 570 * Indicates that the ability does not have a UI 571 * 572 * @syscap SystemCapability.BundleManager.BundleFramework.Core 573 * @FAModelOnly 574 * @since 9 575 */ 576 SERVICE = 2, 577 578 /** 579 * Indicates that the ability is used to provide data access services 580 * 581 * @syscap SystemCapability.BundleManager.BundleFramework.Core 582 * @FAModelOnly 583 * @since 9 584 */ 585 DATA = 3 586 } 587 588 /** 589 * Display orientation 590 * 591 * @enum { number } 592 * @syscap SystemCapability.BundleManager.BundleFramework.Core 593 * @since 9 594 */ 595 export enum DisplayOrientation { 596 /** 597 * Indicates that the system automatically determines the display orientation 598 * 599 * @syscap SystemCapability.BundleManager.BundleFramework.Core 600 * @since 9 601 */ 602 UNSPECIFIED, 603 604 /** 605 * Indicates the landscape orientation 606 * 607 * @syscap SystemCapability.BundleManager.BundleFramework.Core 608 * @since 9 609 */ 610 LANDSCAPE, 611 612 /** 613 * Indicates the portrait orientation 614 * 615 * @syscap SystemCapability.BundleManager.BundleFramework.Core 616 * @since 9 617 */ 618 PORTRAIT, 619 620 /** 621 * Indicates the page ability orientation is the same as that of the nearest ability in the stack 622 * 623 * @syscap SystemCapability.BundleManager.BundleFramework.Core 624 * @since 9 625 */ 626 FOLLOW_RECENT, 627 628 /** 629 * Indicates the inverted landscape orientation 630 * 631 * @syscap SystemCapability.BundleManager.BundleFramework.Core 632 * @since 9 633 */ 634 LANDSCAPE_INVERTED, 635 636 /** 637 * Indicates the inverted portrait orientation 638 * 639 * @syscap SystemCapability.BundleManager.BundleFramework.Core 640 * @since 9 641 */ 642 PORTRAIT_INVERTED, 643 644 /** 645 * Indicates the orientation can be auto-rotated 646 * 647 * @syscap SystemCapability.BundleManager.BundleFramework.Core 648 * @since 9 649 */ 650 AUTO_ROTATION, 651 652 /** 653 * Indicates the landscape orientation rotated with sensor 654 * 655 * @syscap SystemCapability.BundleManager.BundleFramework.Core 656 * @since 9 657 */ 658 AUTO_ROTATION_LANDSCAPE, 659 660 /** 661 * Indicates the portrait orientation rotated with sensor 662 * 663 * @syscap SystemCapability.BundleManager.BundleFramework.Core 664 * @since 9 665 */ 666 AUTO_ROTATION_PORTRAIT, 667 668 /** 669 * Indicates the sensor restricted mode 670 * 671 * @syscap SystemCapability.BundleManager.BundleFramework.Core 672 * @since 9 673 */ 674 AUTO_ROTATION_RESTRICTED, 675 676 /** 677 * Indicates the sensor landscape restricted mode 678 * 679 * @syscap SystemCapability.BundleManager.BundleFramework.Core 680 * @since 9 681 */ 682 AUTO_ROTATION_LANDSCAPE_RESTRICTED, 683 684 /** 685 * Indicates the sensor portrait restricted mode 686 * 687 * @syscap SystemCapability.BundleManager.BundleFramework.Core 688 * @since 9 689 */ 690 AUTO_ROTATION_PORTRAIT_RESTRICTED, 691 692 /** 693 * Indicates the locked orientation mode 694 * 695 * @syscap SystemCapability.BundleManager.BundleFramework.Core 696 * @since 9 697 */ 698 LOCKED 699 } 700 701 /** 702 * Indicates module type 703 * 704 * @enum { number } 705 * @syscap SystemCapability.BundleManager.BundleFramework.Core 706 * @since 9 707 */ 708 export enum ModuleType { 709 /** 710 * Indicates entry type 711 * 712 * @syscap SystemCapability.BundleManager.BundleFramework.Core 713 * @since 9 714 */ 715 ENTRY = 1, 716 /** 717 * Indicates feature type 718 * 719 * @syscap SystemCapability.BundleManager.BundleFramework.Core 720 * @since 9 721 */ 722 FEATURE = 2, 723 /** 724 * Indicates shared type 725 * 726 * @syscap SystemCapability.BundleManager.BundleFramework.Core 727 * @since 9 728 */ 729 SHARED = 3 730 } 731 732 /** 733 * Indicates bundle type 734 * 735 * @enum { number } 736 * @syscap SystemCapability.BundleManager.BundleFramework.Core 737 * @since 9 738 */ 739 export enum BundleType { 740 /** 741 * Indicates app 742 * 743 * @syscap SystemCapability.BundleManager.BundleFramework.Core 744 * @since 9 745 */ 746 APP = 0, 747 /* 748 * Indicates atomic service 749 * @syscap SystemCapability.BundleManager.BundleFramework.Core 750 * @since 9 751 */ 752 ATOMIC_SERVICE = 1 753 } 754 755 /** 756 * Shared bundle compatible policy 757 * 758 * @enum { number } 759 * @syscap SystemCapability.BundleManager.BundleFramework.Core 760 * @since 10 761 */ 762 export enum CompatiblePolicy { 763 /** 764 * Indicates that the app is a shared bundle and the shared bundle type is backward compatibility 765 * 766 * @syscap SystemCapability.BundleManager.BundleFramework.Core 767 * @since 10 768 */ 769 BACKWARD_COMPATIBILITY = 1 770 } 771 772 /** 773 * Obtains own bundleInfo. 774 * 775 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 776 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 777 * @throws { BusinessError } 401 - The parameter check failed. 778 * @syscap SystemCapability.BundleManager.BundleFramework.Core 779 * @since 9 780 */ 781 function getBundleInfoForSelf(bundleFlags: number): Promise<BundleInfo>; 782 783 /** 784 * Obtains own bundleInfo. 785 * 786 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 787 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 788 * @throws { BusinessError } 401 - The parameter check failed. 789 * @syscap SystemCapability.BundleManager.BundleFramework.Core 790 * @since 9 791 */ 792 function getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 793 794 /** 795 * Obtains own bundleInfo. 796 * 797 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 798 * @returns { BundleInfo } The result of getting the bundle info. 799 * @throws { BusinessError } 401 - The parameter check failed. 800 * @syscap SystemCapability.BundleManager.BundleFramework.Core 801 * @since 10 802 */ 803 function getBundleInfoForSelfSync(bundleFlags: number): BundleInfo; 804 805 /** 806 * Obtains bundleInfo based on bundleName, bundleFlags. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 807 * 808 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 809 * @param { string } bundleName - Indicates the application bundle name to be queried. 810 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 811 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 812 * @throws { BusinessError } 201 - Permission denied. 813 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 814 * @throws { BusinessError } 401 - The parameter check failed. 815 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 816 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 817 * @syscap SystemCapability.BundleManager.BundleFramework.Core 818 * @systemapi 819 * @since 9 820 */ 821 function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 822 823 /** 824 * Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 825 * 826 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 827 * @param { string } bundleName - Indicates the application bundle name to be queried. 828 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 829 * @param { number } userId - Indicates the user ID or do not pass user ID. 830 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 831 * @throws { BusinessError } 201 - Permission denied. 832 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 833 * @throws { BusinessError } 401 - The parameter check failed. 834 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 835 * @throws { BusinessError } 17700004 - The specified user ID is not found. 836 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 837 * @syscap SystemCapability.BundleManager.BundleFramework.Core 838 * @systemapi 839 * @since 9 840 */ 841 function getBundleInfo(bundleName: string, 842 bundleFlags: number, userId: number, callback: AsyncCallback<BundleInfo>): void; 843 844 /** 845 * Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 846 * 847 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 848 * @param { string } bundleName - Indicates the application bundle name to be queried. 849 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 850 * @param { number } userId - Indicates the user ID or do not pass user ID. 851 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 852 * @throws { BusinessError } 201 - Permission denied. 853 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 854 * @throws { BusinessError } 401 - The parameter check failed. 855 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 856 * @throws { BusinessError } 17700004 - The specified user ID is not found. 857 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 858 * @syscap SystemCapability.BundleManager.BundleFramework.Core 859 * @systemapi 860 * @since 9 861 */ 862 function getBundleInfo(bundleName: string, bundleFlags: number, userId?: number): Promise<BundleInfo>; 863 864 /** 865 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 866 * 867 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 868 * @param { string } bundleName - Indicates the application bundle name to be queried. 869 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 870 * @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result. 871 * @throws { BusinessError } 201 - Permission denied. 872 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 873 * @throws { BusinessError } 401 - The parameter check failed. 874 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 875 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 876 * @syscap SystemCapability.BundleManager.BundleFramework.Core 877 * @systemapi 878 * @since 9 879 */ 880 function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback<ApplicationInfo>): void; 881 882 /** 883 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 884 * 885 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 886 * @param { string } bundleName - Indicates the application bundle name to be queried. 887 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 888 * @param { number } userId - Indicates the user ID or do not pass user ID. 889 * @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result. 890 * @throws { BusinessError } 201 - Permission denied. 891 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 892 * @throws { BusinessError } 401 - The parameter check failed. 893 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 894 * @throws { BusinessError } 17700004 - The specified user ID is not found. 895 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 896 * @syscap SystemCapability.BundleManager.BundleFramework.Core 897 * @systemapi 898 * @since 9 899 */ 900 function getApplicationInfo(bundleName: string, 901 appFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>): void; 902 903 /** 904 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 905 * 906 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 907 * @param { string } bundleName - Indicates the application bundle name to be queried. 908 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 909 * @param { number } userId - Indicates the user ID or do not pass user ID. 910 * @returns { Promise<ApplicationInfo> } The result of getting the application info. 911 * @throws { BusinessError } 201 - Permission denied. 912 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 913 * @throws { BusinessError } 401 - The parameter check failed. 914 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 915 * @throws { BusinessError } 17700004 - The specified user ID is not found. 916 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 917 * @syscap SystemCapability.BundleManager.BundleFramework.Core 918 * @systemapi 919 * @since 9 920 */ 921 function getApplicationInfo(bundleName: string, appFlags: number, userId?: number): Promise<ApplicationInfo>; 922 923 /** 924 * Obtains BundleInfo of all bundles available in the system. 925 * 926 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 927 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 928 * @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects. 929 * @throws { BusinessError } 201 - Permission denied. 930 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 931 * @throws { BusinessError } 401 - The parameter check failed. 932 * @syscap SystemCapability.BundleManager.BundleFramework.Core 933 * @systemapi 934 * @since 9 935 */ 936 function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback<Array<BundleInfo>>): void; 937 938 /** 939 * Obtains BundleInfo of all bundles available in the system. 940 * 941 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 942 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 943 * @param { number } userId - Indicates the user id. 944 * @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects. 945 * @throws { BusinessError } 201 - Permission denied. 946 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 947 * @throws { BusinessError } 401 - The parameter check failed. 948 * @throws { BusinessError } 17700004 - The specified user ID is not found. 949 * @syscap SystemCapability.BundleManager.BundleFramework.Core 950 * @systemapi 951 * @since 9 952 */ 953 function getAllBundleInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array<BundleInfo>>): void; 954 955 /** 956 * Obtains BundleInfo of all bundles available in the system. 957 * 958 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 959 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 960 * @param { number } userId - Indicates the user id. 961 * @returns { Promise<Array<BundleInfo>> } Returns a list of BundleInfo objects. 962 * @throws { BusinessError } 201 - Permission denied. 963 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 964 * @throws { BusinessError } 401 - The parameter check failed. 965 * @throws { BusinessError } 17700004 - The specified user ID is not found. 966 * @syscap SystemCapability.BundleManager.BundleFramework.Core 967 * @systemapi 968 * @since 9 969 */ 970 function getAllBundleInfo(bundleFlags: number, userId?: number): Promise<Array<BundleInfo>>; 971 972 /** 973 * Obtains information about all installed applications of a specified user. 974 * 975 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 976 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 977 * @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects. 978 * @throws { BusinessError } 201 - Permission denied. 979 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 980 * @throws { BusinessError } 401 - The parameter check failed. 981 * @syscap SystemCapability.BundleManager.BundleFramework.Core 982 * @systemapi 983 * @since 9 984 */ 985 function getAllApplicationInfo(appFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>): void; 986 987 /** 988 * Obtains information about all installed applications of a specified user. 989 * 990 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 991 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 992 * @param { number } userId - Indicates the user ID or do not pass user ID. 993 * @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects. 994 * @throws { BusinessError } 201 - Permission denied. 995 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 996 * @throws { BusinessError } 401 - The parameter check failed. 997 * @throws { BusinessError } 17700004 - The specified user ID is not found. 998 * @syscap SystemCapability.BundleManager.BundleFramework.Core 999 * @systemapi 1000 * @since 9 1001 */ 1002 function getAllApplicationInfo(appFlags: number, 1003 userId: number, callback: AsyncCallback<Array<ApplicationInfo>>): void; 1004 1005 /** 1006 * Obtains information about all installed applications of a specified user. 1007 * 1008 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1009 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1010 * @param { number } userId - Indicates the user ID or do not pass user ID. 1011 * @returns { Promise<Array<ApplicationInfo>> } Returns a list of ApplicationInfo objects. 1012 * @throws { BusinessError } 201 - Permission denied. 1013 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1014 * @throws { BusinessError } 401 - The parameter check failed. 1015 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1016 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1017 * @systemapi 1018 * @since 9 1019 */ 1020 function getAllApplicationInfo(appFlags: number, userId?: number): Promise<Array<ApplicationInfo>>; 1021 1022 /** 1023 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1024 * 1025 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1026 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1027 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1028 * @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result. 1029 * @throws { BusinessError } 201 - Permission denied. 1030 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1031 * @throws { BusinessError } 401 - The parameter check failed. 1032 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1033 * @throws { BusinessError } 17700003 - The specified ability is not found. 1034 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1035 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1036 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1037 * @systemapi 1038 * @since 9 1039 */ 1040 function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback<Array<AbilityInfo>>): void; 1041 1042 /** 1043 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1044 * 1045 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1046 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1047 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1048 * @param { number } userId - userId Indicates the user ID. 1049 * @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result. 1050 * @throws { BusinessError } 201 - Permission denied. 1051 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1052 * @throws { BusinessError } 401 - The parameter check failed. 1053 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1054 * @throws { BusinessError } 17700003 - The specified ability is not found. 1055 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1056 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1057 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1058 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1059 * @systemapi 1060 * @since 9 1061 */ 1062 function queryAbilityInfo(want: Want, 1063 abilityFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void; 1064 1065 /** 1066 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1067 * 1068 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1069 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1070 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1071 * @param { number } userId - userId Indicates the user ID. 1072 * @returns { Promise<Array<AbilityInfo>> } Returns a list of AbilityInfo objects. 1073 * @throws { BusinessError } 201 - Permission denied. 1074 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1075 * @throws { BusinessError } 401 - The parameter check failed. 1076 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1077 * @throws { BusinessError } 17700003 - The specified ability is not found. 1078 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1079 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1080 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1081 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1082 * @systemapi 1083 * @since 9 1084 */ 1085 function queryAbilityInfo(want: Want, abilityFlags: number, userId?: number): Promise<Array<AbilityInfo>>; 1086 1087 /** 1088 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1089 * 1090 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1091 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1092 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1093 * @param { number } userId - userId Indicates the user ID. 1094 * @returns { Array<AbilityInfo> } Returns a list of AbilityInfo objects. 1095 * @throws { BusinessError } 201 - Permission denied. 1096 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1097 * @throws { BusinessError } 401 - The parameter check failed. 1098 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1099 * @throws { BusinessError } 17700003 - The specified ability is not found. 1100 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1101 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1102 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1103 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1104 * @systemapi 1105 * @since 10 1106 */ 1107 function queryAbilityInfoSync(want: Want, abilityFlags: number, userId?: number): Array<AbilityInfo>; 1108 1109 /** 1110 * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1111 * 1112 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1113 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1114 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1115 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1116 * ExtensionAbilityInfo objects that will be returned. 1117 * @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result. 1118 * @throws { BusinessError } 201 - Permission denied. 1119 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1120 * @throws { BusinessError } 401 - The parameter check failed. 1121 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1122 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1123 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1124 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1125 * @systemapi 1126 * @since 9 1127 */ 1128 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1129 extensionAbilityFlags: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void; 1130 1131 /** 1132 * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1133 * 1134 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1135 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1136 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1137 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1138 * ExtensionAbilityInfo objects that will be returned. 1139 * @param { number } userId - Indicates the user ID. 1140 * @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result. 1141 * @throws { BusinessError } 201 - Permission denied. 1142 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1143 * @throws { BusinessError } 401 - The parameter check failed. 1144 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1145 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1146 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1147 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1148 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1149 * @systemapi 1150 * @since 9 1151 */ 1152 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1153 extensionAbilityFlags: number, userId: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void; 1154 1155 /** 1156 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1157 * 1158 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1159 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1160 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1161 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1162 * ExtensionAbilityInfo objects that will be returned. 1163 * @param { number } userId - Indicates the user ID. 1164 * @returns { Promise<Array<ExtensionAbilityInfo>> } Returns a list of ExtensionAbilityInfo objects. 1165 * @throws { BusinessError } 201 - Permission denied. 1166 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1167 * @throws { BusinessError } 401 - The parameter check failed. 1168 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1169 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1170 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1171 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1173 * @systemapi 1174 * @since 9 1175 */ 1176 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1177 extensionAbilityFlags: number, userId?: number): Promise<Array<ExtensionAbilityInfo>>; 1178 1179 /** 1180 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1181 * 1182 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1183 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1184 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1185 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1186 * ExtensionAbilityInfo objects that will be returned. 1187 * @param { number } userId - Indicates the user ID. 1188 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1189 * @throws { BusinessError } 201 - Permission denied. 1190 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1191 * @throws { BusinessError } 401 - The parameter check failed. 1192 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1193 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1194 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1195 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1196 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1197 * @systemapi 1198 * @since 10 1199 */ 1200 function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: ExtensionAbilityType, 1201 extensionAbilityFlags: number, userId?: number): Array<ExtensionAbilityInfo>; 1202 1203 /** 1204 * Obtains bundle name by the given uid. 1205 * 1206 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1207 * @param { number } uid - Indicates the UID of an application. 1208 * @param { AsyncCallback<string> } callback - The callback of getting bundle name. 1209 * @throws { BusinessError } 201 - Permission denied. 1210 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1211 * @throws { BusinessError } 401 - The parameter check failed. 1212 * @throws { BusinessError } 17700021 - The uid is not found. 1213 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1214 * @systemapi 1215 * @since 9 1216 */ 1217 function getBundleNameByUid(uid: number, callback: AsyncCallback<string>): void; 1218 1219 /** 1220 * Obtains bundle name by the given uid. 1221 * 1222 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1223 * @param { number } uid - Indicates the UID of an application. 1224 * @returns { Promise<string> } Returns the bundle name. 1225 * @throws { BusinessError } 201 - Permission denied. 1226 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1227 * @throws { BusinessError } 401 - The parameter check failed. 1228 * @throws { BusinessError } 17700021 - The uid is not found. 1229 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1230 * @systemapi 1231 * @since 9 1232 */ 1233 function getBundleNameByUid(uid: number): Promise<string>; 1234 1235 /** 1236 * Obtains bundle name by the given uid. 1237 * 1238 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1239 * @param { number } uid - Indicates the UID of an application. 1240 * @returns { string } Returns the bundle name. 1241 * @throws { BusinessError } 201 - Permission denied. 1242 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1243 * @throws { BusinessError } 401 - The parameter check failed. 1244 * @throws { BusinessError } 17700021 - The uid is not found. 1245 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1246 * @systemapi 1247 * @since 10 1248 */ 1249 function getBundleNameByUidSync(uid: number): string; 1250 1251 /** 1252 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 1253 * 1254 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1255 * @param { string } hapFilePath - Indicates the path storing the HAP. 1256 * The path should be the relative path to the data directory of the current application. 1257 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 1258 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle archive info result. 1259 * @throws { BusinessError } 201 - Permission denied. 1260 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1261 * @throws { BusinessError } 401 - The parameter check failed. 1262 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 1263 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1264 * @systemapi 1265 * @since 9 1266 */ 1267 function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 1268 1269 /** 1270 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 1271 * 1272 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1273 * @param { string } hapFilePath - Indicates the path storing the HAP. 1274 * The path should be the relative path to the data directory of the current application. 1275 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 1276 * @returns { Promise<BundleInfo> } Returns the BundleInfo object. 1277 * @throws { BusinessError } 201 - Permission denied. 1278 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1279 * @throws { BusinessError } 401 - The parameter check failed. 1280 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 1281 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1282 * @systemapi 1283 * @since 9 1284 */ 1285 function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>; 1286 1287 /** 1288 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 1289 * 1290 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1291 * @param { string } hapFilePath - Indicates the path storing the HAP. 1292 * The path should be the relative path to the data directory of the current application. 1293 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 1294 * @returns { BundleInfo } Returns the BundleInfo object. 1295 * @throws { BusinessError } 201 - Permission denied. 1296 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1297 * @throws { BusinessError } 401 - The parameter check failed. 1298 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 1299 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1300 * @systemapi 1301 * @since 10 1302 */ 1303 function getBundleArchiveInfoSync(hapFilePath: string, bundleFlags: number): BundleInfo; 1304 1305 /** 1306 * Clears cache data of a specified application. 1307 * 1308 * @permission ohos.permission.REMOVE_CACHE_FILES 1309 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 1310 * @param { AsyncCallback<void> } callback - The callback of cleaning bundle cache files result. 1311 * @throws { BusinessError } 201 - Permission denied. 1312 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1313 * @throws { BusinessError } 401 - The parameter check failed. 1314 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1315 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 1316 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1317 * @systemapi 1318 * @since 9 1319 */ 1320 function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback<void>): void; 1321 1322 /** 1323 * Clears cache data of a specified application. 1324 * 1325 * @permission ohos.permission.REMOVE_CACHE_FILES 1326 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 1327 * @returns { Promise<void> } Clean bundle cache files result 1328 * @throws { BusinessError } 201 - Permission denied. 1329 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1330 * @throws { BusinessError } 401 - The parameter check failed. 1331 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1332 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 1333 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1334 * @systemapi 1335 * @since 9 1336 */ 1337 function cleanBundleCacheFiles(bundleName: string): Promise<void>; 1338 1339 /** 1340 * Sets whether to enable a specified application. 1341 * 1342 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1343 * @param { string } bundleName - Indicates the bundle name of the application. 1344 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1345 * @param { AsyncCallback<void> } callback - The callback of setting app enabled result. 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 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1351 * @systemapi 1352 * @since 9 1353 */ 1354 function setApplicationEnabled(bundleName: string, isEnabled: boolean, callback: AsyncCallback<void>): void; 1355 1356 /** 1357 * Sets whether to enable a specified application. 1358 * 1359 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1360 * @param { string } bundleName - Indicates the bundle name of the application. 1361 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1362 * @returns { Promise<void> } set app enabled result. 1363 * @throws { BusinessError } 201 - Permission denied. 1364 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1365 * @throws { BusinessError } 401 - The parameter check failed. 1366 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1367 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1368 * @systemapi 1369 * @since 9 1370 */ 1371 function setApplicationEnabled(bundleName: string, isEnabled: boolean): Promise<void>; 1372 1373 /** 1374 * Sets whether to enable a specified application. 1375 * 1376 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1377 * @param { string } bundleName - Indicates the bundle name of the application. 1378 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1379 * @throws { BusinessError } 201 - Permission denied. 1380 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1381 * @throws { BusinessError } 401 - The parameter check failed. 1382 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1383 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1384 * @systemapi 1385 * @since 10 1386 */ 1387 function setApplicationEnabledSync(bundleName: string, isEnabled: boolean): void; 1388 1389 /** 1390 * Sets whether to enable a specified ability. 1391 * 1392 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1393 * @param { AbilityInfo } info - Indicates information about the ability to set. 1394 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1395 * @param { AsyncCallback<void> } callback - The callback of setting ability enabled result. 1396 * @throws { BusinessError } 201 - Permission denied. 1397 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1398 * @throws { BusinessError } 401 - The parameter check failed. 1399 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1400 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 1401 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1402 * @systemapi 1403 * @since 9 1404 */ 1405 function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean, callback: AsyncCallback<void>): void; 1406 1407 /** 1408 * Sets whether to enable a specified ability. 1409 * 1410 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1411 * @param { AbilityInfo } info - Indicates information about the ability to set. 1412 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1413 * @returns { Promise<void> } set ability enabled result. 1414 * @throws { BusinessError } 201 - Permission denied. 1415 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1416 * @throws { BusinessError } 401 - The parameter check failed. 1417 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1418 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 1419 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1420 * @systemapi 1421 * @since 9 1422 */ 1423 function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean): Promise<void>; 1424 1425 /** 1426 * Sets whether to enable a specified ability. 1427 * 1428 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 1429 * @param { AbilityInfo } info - Indicates information about the ability to set. 1430 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 1431 * @throws { BusinessError } 201 - Permission denied. 1432 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1433 * @throws { BusinessError } 401 - The parameter check failed. 1434 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1435 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 1436 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1437 * @systemapi 1438 * @since 10 1439 */ 1440 function setAbilityEnabledSync(info: AbilityInfo, isEnabled: boolean): void; 1441 1442 /** 1443 * Checks whether a specified application is enabled. 1444 * 1445 * @param { string } bundleName - Indicates the bundle name of the application. 1446 * @param { AsyncCallback<boolean> } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise. 1447 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1448 * @throws { BusinessError } 401 - The parameter check failed. 1449 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1450 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1451 * @systemapi 1452 * @since 9 1453 */ 1454 function isApplicationEnabled(bundleName: string, callback: AsyncCallback<boolean>): void; 1455 1456 /** 1457 * Checks whether a specified application is enabled. 1458 * 1459 * @param { string } bundleName - Indicates the bundle name of the application. 1460 * @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise. 1461 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1462 * @throws { BusinessError } 401 - The parameter check failed. 1463 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1464 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1465 * @systemapi 1466 * @since 9 1467 */ 1468 function isApplicationEnabled(bundleName: string): Promise<boolean>; 1469 1470 /** 1471 * Checks whether a specified application is enabled. 1472 * 1473 * @param { string } bundleName - Indicates the bundle name of the application. 1474 * @returns { boolean } Returns true if the application is enabled; returns false otherwise. 1475 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1476 * @throws { BusinessError } 401 - The parameter check failed. 1477 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1478 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1479 * @systemapi 1480 * @since 10 1481 */ 1482 function isApplicationEnabledSync(bundleName: string): boolean; 1483 1484 /** 1485 * Checks whether a specified ability is enabled. 1486 * 1487 * @param { AbilityInfo } info - Indicates information about the ability to check. 1488 * @param { AsyncCallback<boolean> } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise. 1489 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1490 * @throws { BusinessError } 401 - The parameter check failed. 1491 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1492 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1493 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1494 * @systemapi 1495 * @since 9 1496 */ 1497 function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback<boolean>): void; 1498 1499 /** 1500 * Checks whether a specified ability is enabled. 1501 * 1502 * @param { AbilityInfo } info - Indicates information about the ability to check. 1503 * @returns { Promise<boolean> } Returns true if the ability is enabled; returns false otherwise. 1504 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1505 * @throws { BusinessError } 401 - The parameter check failed. 1506 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1507 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1508 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1509 * @systemapi 1510 * @since 9 1511 */ 1512 function isAbilityEnabled(info: AbilityInfo): Promise<boolean>; 1513 1514 /** 1515 * Checks whether a specified ability is enabled. 1516 * 1517 * @param { AbilityInfo } info - Indicates information about the ability to check. 1518 * @returns { boolean } Returns true if the ability is enabled; returns false otherwise. 1519 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1520 * @throws { BusinessError } 401 - The parameter check failed. 1521 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1522 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1523 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1524 * @systemapi 1525 * @since 10 1526 */ 1527 function isAbilityEnabledSync(info: AbilityInfo): boolean; 1528 1529 /** 1530 * Obtains the Want for starting the main ability of an application based on the 1531 * given bundle name. The main ability of an application is the ability that has the 1532 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 1533 * 1534 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1535 * @param { string } bundleName - Indicates the bundle name of the application. 1536 * @param { number } userId - Indicates the user ID or do not pass user ID. 1537 * @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability. 1538 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 1539 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1540 * @throws { BusinessError } 401 - Input parameters check failed. 1541 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1542 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1543 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1544 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1545 * @systemapi 1546 * @since 9 1547 */ 1548 function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback<Want>): void; 1549 1550 /** 1551 * Obtains the Want for starting the main ability of an application based on the 1552 * given bundle name. The main ability of an application is the ability that has the 1553 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 1554 * 1555 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1556 * @param { string } bundleName - Indicates the bundle name of the application. 1557 * @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability. 1558 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 1559 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1560 * @throws { BusinessError } 401 - Input parameters check failed. 1561 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1562 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1563 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1564 * @systemapi 1565 * @since 9 1566 */ 1567 function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback<Want>): void; 1568 1569 /** 1570 * Obtains the Want for starting the main ability of an application based on the 1571 * given bundle name. The main ability of an application is the ability that has the 1572 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 1573 * 1574 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1575 * @param { string } bundleName - Indicates the bundle name of the application. 1576 * @param { number } userId - Indicates the user ID or do not pass user ID. 1577 * @returns { Promise<Want> } the Want for starting the application's main ability. 1578 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 1579 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1580 * @throws { BusinessError } 401 - Input parameters check failed. 1581 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1582 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1583 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1584 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1585 * @systemapi 1586 * @since 9 1587 */ 1588 function getLaunchWantForBundle(bundleName: string, userId?: number): Promise<Want>; 1589 1590 /** 1591 * Obtains the Want for starting the main ability of an application based on the 1592 * given bundle name. The main ability of an application is the ability that has the 1593 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 1594 * 1595 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1596 * @param { string } bundleName - Indicates the bundle name of the application. 1597 * @param { number } userId - Indicates the user ID or do not pass user ID. 1598 * @returns { Want } the Want for starting the application's main ability. 1599 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 1600 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1601 * @throws { BusinessError } 401 - Input parameters check failed. 1602 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1603 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1604 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1605 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1606 * @systemapi 1607 * @since 10 1608 */ 1609 function getLaunchWantForBundleSync(bundleName: string, userId?: number): Want; 1610 1611 /** 1612 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 1613 * 1614 * @param { string } moduleName - Indicates the moduleName of the application. 1615 * @param { string } abilityName - Indicates the abilityName of the application. 1616 * @param { string } metadataName - Indicates the name of metadata in ability. 1617 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 1618 * @throws { BusinessError } 401 - Input parameters check failed. 1619 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 1620 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 1621 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 1622 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1623 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1624 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1625 * @since 9 1626 */ 1627 function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback<Array<string>>): void; 1628 1629 /** 1630 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 1631 * 1632 * @param { string } moduleName - Indicates the moduleName of the application. 1633 * @param { string } abilityName - Indicates the abilityName of the application. 1634 * @param { string } metadataName - Indicates the name of metadata in ability. 1635 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 1636 * @throws { BusinessError } 401 - Input parameters check failed. 1637 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 1638 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 1639 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 1640 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1641 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1642 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1643 * @since 9 1644 */ 1645 function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise<Array<string>>; 1646 1647 /** 1648 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 1649 * 1650 * @param { string } moduleName - Indicates the moduleName of the application. 1651 * @param { string } abilityName - Indicates the abilityName of the application. 1652 * @param { string } metadataName - Indicates the name of metadata in ability. 1653 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 1654 * @throws { BusinessError } 401 - Input parameters check failed. 1655 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 1656 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 1657 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 1658 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1659 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1660 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1661 * @since 10 1662 */ 1663 function getProfileByAbilitySync(moduleName: string, abilityName: string, metadataName?: string): Array<string>; 1664 1665 /** 1666 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 1667 * 1668 * @param { string } moduleName - Indicates the moduleName of the application. 1669 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 1670 * @param { string } metadataName - Indicates the name of metadata in ability. 1671 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 1672 * @throws { BusinessError } 401 - Input parameters check failed. 1673 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 1674 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 1675 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 1676 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1677 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1678 * @since 9 1679 */ 1680 function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback<Array<string>>): void; 1681 1682 /** 1683 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 1684 * 1685 * @param { string } moduleName - Indicates the moduleName of the application. 1686 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 1687 * @param { string } metadataName - Indicates the name of metadata in ability. 1688 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 1689 * @throws { BusinessError } 401 - Input parameters check failed. 1690 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 1691 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 1692 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 1693 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1694 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1695 * @since 9 1696 */ 1697 function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise<Array<string>>; 1698 1699 /** 1700 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 1701 * 1702 * @param { string } moduleName - Indicates the moduleName of the application. 1703 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 1704 * @param { string } metadataName - Indicates the name of metadata in ability. 1705 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 1706 * @throws { BusinessError } 401 - Input parameters check failed. 1707 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 1708 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 1709 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 1710 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1711 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1712 * @since 10 1713 */ 1714 function getProfileByExtensionAbilitySync(moduleName: string, extensionAbilityName: string, metadataName?: string): Array<string>; 1715 1716 /** 1717 * Get the permission details by permission name. 1718 * 1719 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1720 * @param { string } permissionName - Indicates permission name. 1721 * @param { AsyncCallback<PermissionDef> } callback - The callback of get permissionDef object result. 1722 * @throws { BusinessError } 201 - Permission denied. 1723 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1724 * @throws { BusinessError } 401 - Input parameters check failed. 1725 * @throws { BusinessError } 17700006 - The specified permission is not found. 1726 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1727 * @systemapi 1728 * @since 9 1729 */ 1730 function getPermissionDef(permissionName: string, callback: AsyncCallback<PermissionDef>): void; 1731 1732 /** 1733 * Get the permission details by permission name. 1734 * 1735 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1736 * @param { string } permissionName - Indicates permission name. 1737 * @returns { Promise<PermissionDef> } Returns permissionDef object. 1738 * @throws { BusinessError } 201 - Permission denied. 1739 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1740 * @throws { BusinessError } 401 - Input parameters check failed. 1741 * @throws { BusinessError } 17700006 - The specified permission is not found. 1742 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1743 * @systemapi 1744 * @since 9 1745 */ 1746 function getPermissionDef(permissionName: string): Promise<PermissionDef>; 1747 1748 /** 1749 * Get the permission details by permission name. 1750 * 1751 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1752 * @param { string } permissionName - Indicates permission name. 1753 * @returns { PermissionDef } Returns permissionDef object. 1754 * @throws { BusinessError } 201 - Permission denied. 1755 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1756 * @throws { BusinessError } 401 - Input parameters check failed. 1757 * @throws { BusinessError } 17700006 - The specified permission is not found. 1758 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1759 * @systemapi 1760 * @since 10 1761 */ 1762 function getPermissionDefSync(permissionName: string): PermissionDef; 1763 1764 /** 1765 * Obtains the label of a specified ability. 1766 * 1767 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1768 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 1769 * @param { string } moduleName - Indicates the module name. 1770 * @param { string } abilityName - Indicates the ability name. 1771 * @param { AsyncCallback<string> } callback - The callback of getting ability label result. 1772 * @throws { BusinessError } 201 - Permission denied. 1773 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1774 * @throws { BusinessError } 401 - The parameter check failed. 1775 * @throws { BusinessError } 801 - Capability not supported. 1776 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1777 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 1778 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1779 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1780 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1781 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 1782 * @systemapi 1783 * @since 9 1784 */ 1785 function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback<string>): void; 1786 1787 /** 1788 * Obtains the label of a specified ability. 1789 * 1790 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1791 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 1792 * @param { string } moduleName - Indicates the module name. 1793 * @param { string } abilityName - Indicates the ability name. 1794 * @returns { Promise<string> } Returns the label representing the label of the specified ability. 1795 * @throws { BusinessError } 201 - Permission denied. 1796 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1797 * @throws { BusinessError } 401 - The parameter check failed. 1798 * @throws { BusinessError } 801 - Capability not supported. 1799 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1800 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 1801 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1802 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1803 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1804 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 1805 * @systemapi 1806 * @since 9 1807 */ 1808 function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise<string>; 1809 1810 /** 1811 * Obtains the label of a specified ability. 1812 * 1813 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1814 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 1815 * @param { string } moduleName - Indicates the module name. 1816 * @param { string } abilityName - Indicates the ability name. 1817 * @returns { string } Returns the label representing the label of the specified ability. 1818 * @throws { BusinessError } 201 - Permission denied. 1819 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1820 * @throws { BusinessError } 401 - The parameter check failed. 1821 * @throws { BusinessError } 801 - Capability not supported. 1822 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1823 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 1824 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 1825 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1826 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1827 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 1828 * @systemapi 1829 * @since 10 1830 */ 1831 function getAbilityLabelSync(bundleName: string, moduleName: string, abilityName: string): string; 1832 1833 /** 1834 * Obtains applicationInfo based on a given bundleName and bundleFlags. 1835 * 1836 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1837 * @param { string } bundleName - Indicates the application bundle name to be queried. 1838 * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. 1839 * @param { number } userId - Indicates the user ID or do not pass user ID. 1840 * @returns { ApplicationInfo } - Returns the ApplicationInfo object. 1841 * @throws { BusinessError } 201 - Permission denied. 1842 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1843 * @throws { BusinessError } 401 - The parameter check failed. 1844 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1845 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1846 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1847 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1848 * @systemapi 1849 * @since 9 1850 */ 1851 function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number): ApplicationInfo; 1852 1853 /** 1854 * Obtains applicationInfo based on a given bundleName and bundleFlags. 1855 * 1856 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1857 * @param { string } bundleName - Indicates the application bundle name to be queried. 1858 * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. 1859 * @returns { ApplicationInfo } - Returns the ApplicationInfo object. 1860 * @throws { BusinessError } 201 - Permission denied. 1861 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1862 * @throws { BusinessError } 401 - The parameter check failed. 1863 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1864 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1865 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1866 * @systemapi 1867 * @since 9 1868 */ 1869 function getApplicationInfoSync(bundleName: string, applicationFlags: number): ApplicationInfo; 1870 1871 /** 1872 * Obtains bundleInfo based on bundleName, bundleFlags and userId. 1873 * 1874 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1875 * @param { string } bundleName - Indicates the application bundle name to be queried. 1876 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. 1877 * @param { number } userId - Indicates the user ID or do not pass user ID. 1878 * @returns { BundleInfo } - Returns the BundleInfo object. 1879 * @throws { BusinessError } 201 - Permission denied. 1880 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1881 * @throws { BusinessError } 401 - The parameter check failed. 1882 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1883 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1884 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1885 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1886 * @systemapi 1887 * @since 9 1888 */ 1889 function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo; 1890 1891 /** 1892 * Obtains bundleInfo based on bundleName, bundleFlags. 1893 * 1894 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1895 * @param { string } bundleName - Indicates the application bundle name to be queried. 1896 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. 1897 * @returns { BundleInfo } - Returns the BundleInfo object. 1898 * @throws { BusinessError } 201 - Permission denied. 1899 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1900 * @throws { BusinessError } 401 - The parameter check failed. 1901 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1902 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1903 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1904 * @systemapi 1905 * @since 9 1906 */ 1907 function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; 1908 1909 /** 1910 * Obtains SharedBundleInfo of all shared bundle available in the system. 1911 * 1912 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1913 * @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects. 1914 * @throws { BusinessError } 201 - Permission denied. 1915 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1916 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1917 * @systemapi 1918 * @since 10 1919 */ 1920 function getAllSharedBundleInfo(callback: AsyncCallback<Array<SharedBundleInfo>>): void; 1921 1922 /** 1923 * Obtains SharedBundleInfo of all shared bundle available in the system. 1924 * 1925 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1926 * @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects. 1927 * @throws { BusinessError } 201 - Permission denied. 1928 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1929 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1930 * @systemapi 1931 * @since 10 1932 */ 1933 function getAllSharedBundleInfo(): Promise<Array<SharedBundleInfo>>; 1934 1935 /** 1936 * Obtains SharedBundleInfo of shared bundle by bundle name and module name. 1937 * 1938 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1939 * @param { string } bundleName - Indicates the bundleName of the application. 1940 * @param { string } moduleName - Indicates the moduleName of the application. 1941 * @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects. 1942 * @throws { BusinessError } 201 - Permission denied. 1943 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1944 * @throws { BusinessError } 401 - The parameter check failed. 1945 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1946 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 1947 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1948 * @systemapi 1949 * @since 10 1950 */ 1951 function getSharedBundleInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<SharedBundleInfo>>): void; 1952 1953 /** 1954 * Obtains SharedBundleInfo of shared bundle by bundle name and module name. 1955 * 1956 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1957 * @param { string } bundleName - Indicates the bundleName of the application. 1958 * @param { string } moduleName - Indicates the moduleName of the application. 1959 * @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects. 1960 * @throws { BusinessError } 201 - Permission denied. 1961 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1962 * @throws { BusinessError } 401 - The parameter check failed. 1963 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1964 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 1965 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1966 * @systemapi 1967 * @since 10 1968 */ 1969 function getSharedBundleInfo(bundleName: string, moduleName: string): Promise<Array<SharedBundleInfo>>; 1970 1971 /** 1972 * Obtains the profile file information of a specified bundle. 1973 * 1974 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1975 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 1976 * @param { AsyncCallback<AppProvisionInfo> } callback - Indicates the callback of getting AppProvisionInfo result. 1977 * @throws { BusinessError } 201 - Permission denied. 1978 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1979 * @throws { BusinessError } 401 - The parameter check failed. 1980 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1981 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1982 * @systemapi 1983 * @since 10 1984 */ 1985 function getAppProvisionInfo(bundleName: string, callback: AsyncCallback<AppProvisionInfo>): void; 1986 1987 /** 1988 * Obtains the profile file information of a specified bundle. 1989 * 1990 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1991 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 1992 * @param { number } userId - Indicates the user ID or do not pass user ID. 1993 * @param { AsyncCallback<AppProvisionInfo> } callback - Indicates the callback of getting AppProvisionInfo result. 1994 * @throws { BusinessError } 201 - Permission denied. 1995 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1996 * @throws { BusinessError } 401 - The parameter check failed. 1997 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1998 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1999 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2000 * @systemapi 2001 * @since 10 2002 */ 2003 function getAppProvisionInfo(bundleName: string, userId: number, callback: AsyncCallback<AppProvisionInfo>): void; 2004 2005 /** 2006 * Obtains the profile file information of a specified bundle. 2007 * 2008 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2009 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2010 * @param { number } userId - Indicates the user ID or do not pass user ID. 2011 * @returns { Promise<AppProvisionInfo> } Returns the AppProvisionInfo object. 2012 * @throws { BusinessError } 201 - Permission denied. 2013 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2014 * @throws { BusinessError } 401 - The parameter check failed. 2015 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2016 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2017 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2018 * @systemapi 2019 * @since 10 2020 */ 2021 function getAppProvisionInfo(bundleName: string, userId?: number): Promise<AppProvisionInfo>; 2022 2023 /** 2024 * Obtains the profile file information of a specified bundle. 2025 * 2026 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2027 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2028 * @param { number } userId - Indicates the user ID or do not pass user ID. 2029 * @returns { AppProvisionInfo } Returns the AppProvisionInfo object. 2030 * @throws { BusinessError } 201 - Permission denied. 2031 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2032 * @throws { BusinessError } 401 - The parameter check failed. 2033 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2034 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2035 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2036 * @systemapi 2037 * @since 10 2038 */ 2039 function getAppProvisionInfoSync(bundleName: string, userId?: number): AppProvisionInfo; 2040 2041 /** 2042 * Obtains the distribution type specified during bundle installation. 2043 * 2044 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2045 * @param { string } bundleName - Indicates the application bundle name to be queried. 2046 * @returns { string } The specified distribution type. 2047 * @throws { BusinessError } 201 - Permission denied. 2048 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2049 * @throws { BusinessError } 401 - Input parameters check failed. 2050 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2051 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2052 * @systemapi 2053 * @since 10 2054 */ 2055 function getSpecifiedDistributionType(bundleName: string): string; 2056 2057 /** 2058 * Obtains the additional information during bundle installation. 2059 * 2060 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2061 * @param { string } bundleName - Indicates the application bundle name to be queried. 2062 * @returns { string } The additional information. 2063 * @throws { BusinessError } 201 - Permission denied. 2064 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2065 * @throws { BusinessError } 401 - Input parameters check failed. 2066 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2067 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2068 * @systemapi 2069 * @since 10 2070 */ 2071 function getAdditionalInfo(bundleName: string): string; 2072 2073 /** 2074 * Obtains configuration information about an application. 2075 * 2076 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2077 * @since 9 2078 */ 2079 export type ApplicationInfo = _ApplicationInfo; 2080 2081 /** 2082 * Indicates the metadata information about a module. 2083 * 2084 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2085 * @since 10 2086 */ 2087 export type ModuleMetadata = _ModuleMetadata; 2088 2089 /** 2090 * Indicates the Metadata. 2091 * 2092 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2093 * @since 9 2094 */ 2095 export type Metadata = _Metadata; 2096 2097 /** 2098 * Obtains configuration information about a bundle. 2099 * 2100 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2101 * @since 9 2102 */ 2103 export type BundleInfo = _BundleInfo.BundleInfo; 2104 2105 /** 2106 * The scene which is used. 2107 * 2108 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2109 * @since 9 2110 */ 2111 export type UsedScene = _BundleInfo.UsedScene; 2112 2113 /** 2114 * Indicates the required permissions details defined in file config.json. 2115 * 2116 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2117 * @since 9 2118 */ 2119 export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; 2120 2121 /** 2122 * Indicates the SignatureInfo. 2123 * 2124 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2125 * @since 9 2126 */ 2127 export type SignatureInfo = _BundleInfo.SignatureInfo; 2128 2129 /** 2130 * Obtains configuration information about a module. 2131 * 2132 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2133 * @since 9 2134 */ 2135 export type HapModuleInfo = _HapModuleInfo.HapModuleInfo; 2136 2137 /** 2138 * Obtains preload information about a module. 2139 * 2140 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2141 * @since 9 2142 */ 2143 export type PreloadItem = _HapModuleInfo.PreloadItem; 2144 2145 /** 2146 * Obtains dependency information about a module. 2147 * 2148 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2149 * @since 9 2150 */ 2151 export type Dependency = _HapModuleInfo.Dependency; 2152 2153 /** 2154 * Obtains configuration information about an ability. 2155 * 2156 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2157 * @since 9 2158 */ 2159 export type AbilityInfo = _AbilityInfo.AbilityInfo; 2160 2161 /** 2162 * Contains basic Ability information. Indicates the window size.. 2163 * 2164 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2165 * @since 9 2166 */ 2167 export type WindowSize = _AbilityInfo.WindowSize; 2168 2169 /** 2170 * Obtains extension information about a bundle. 2171 * 2172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2173 * @since 9 2174 */ 2175 export type ExtensionAbilityInfo = _ExtensionAbilityInfo.ExtensionAbilityInfo; 2176 2177 /** 2178 * Indicates the defined permission details in file config.json. 2179 * 2180 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2181 * @systemapi 2182 * @since 9 2183 */ 2184 export type PermissionDef = _PermissionDef; 2185 2186 /** 2187 * Contains basic Ability information, which uniquely identifies an ability. 2188 * 2189 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2190 * @since 9 2191 */ 2192 export type ElementName = _ElementName; 2193 2194 /** 2195 * Contains shared bundle info. 2196 * 2197 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2198 * @systemapi 2199 * @since 10 2200 */ 2201 export type SharedBundleInfo = _SharedBundleInfo; 2202 2203 /** 2204 * Obtains profile file information about a bundle. 2205 * 2206 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2207 * @systemapi 2208 * @since 10 2209 */ 2210 export type AppProvisionInfo = _AppProvisionInfo.AppProvisionInfo; 2211 2212 /** 2213 * Obtains profile file validity about a bundle. 2214 * 2215 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2216 * @systemapi 2217 * @since 10 2218 */ 2219 export type Validity = _AppProvisionInfo.Validity; 2220} 2221 2222export default bundleManager; 2223