1/* 2 * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import type { ApplicationInfo as _ApplicationInfo, ModuleMetadata as _ModuleMetadata, 23 PreinstalledApplicationInfo as _PreinstalledApplicationInfo } from './bundleManager/ApplicationInfo'; 24import { Metadata as _Metadata } from './bundleManager/Metadata'; 25import { PermissionDef as _PermissionDef } from './bundleManager/PermissionDef'; 26import { ElementName as _ElementName } from './bundleManager/ElementName'; 27import { SharedBundleInfo as _SharedBundleInfo } from './bundleManager/SharedBundleInfo'; 28import type { RecoverableApplicationInfo as _RecoverableApplicationInfo } from './bundleManager/RecoverableApplicationInfo'; 29import Want from './@ohos.app.ability.Want'; 30import * as _AbilityInfo from './bundleManager/AbilityInfo'; 31import * as _AppProvisionInfo from './bundleManager/AppProvisionInfo'; 32import * as _BundleInfo from './bundleManager/BundleInfo'; 33import * as _HapModuleInfo from './bundleManager/HapModuleInfo'; 34import * as _ExtensionAbilityInfo from './bundleManager/ExtensionAbilityInfo'; 35import * as _Skill from './bundleManager/Skill'; 36/** 37 * This module is used to obtain package information of various applications installed on the current device. 38 * 39 * @namespace bundleManager 40 * @syscap SystemCapability.BundleManager.BundleFramework.Core 41 * @since 9 42 */ 43/** 44 * This module is used to obtain package information of various applications installed on the current device. 45 * 46 * @namespace bundleManager 47 * @syscap SystemCapability.BundleManager.BundleFramework.Core 48 * @atomicservice 49 * @since 11 50 */ 51/** 52 * This module is used to obtain package information of various applications installed on the current device. 53 * 54 * @namespace bundleManager 55 * @syscap SystemCapability.BundleManager.BundleFramework.Core 56 * @crossplatform 57 * @atomicservice 58 * @since 12 59 */ 60declare namespace bundleManager { 61 /** 62 * Used to query the enumeration value of bundleInfo. Multiple values can be passed in the form. 63 * 64 * @enum { number } 65 * @syscap SystemCapability.BundleManager.BundleFramework.Core 66 * @since 9 67 */ 68 /** 69 * Used to query the enumeration value of bundleInfo. Multiple values can be passed in the form. 70 * 71 * @enum { number } 72 * @syscap SystemCapability.BundleManager.BundleFramework.Core 73 * @atomicservice 74 * @since 11 75 */ 76 enum BundleFlag { 77 /** 78 * Used to obtain the default bundleInfo. The obtained bundleInfo does not contain information of 79 * signatureInfo, applicationInfo, hapModuleInfo, ability, extensionAbility and permission. 80 * 81 * @syscap SystemCapability.BundleManager.BundleFramework.Core 82 * @since 9 83 */ 84 /** 85 * Used to obtain the default bundleInfo. The obtained bundleInfo does not contain information of 86 * signatureInfo, applicationInfo, hapModuleInfo, ability, extensionAbility and permission. 87 * 88 * @syscap SystemCapability.BundleManager.BundleFramework.Core 89 * @atomicservice 90 * @since 11 91 */ 92 GET_BUNDLE_INFO_DEFAULT = 0x00000000, 93 /** 94 * Used to obtain the bundleInfo containing applicationInfo. The obtained bundleInfo does not 95 * contain the information of signatureInfo, hapModuleInfo, ability, extensionAbility and permission. 96 * 97 * @syscap SystemCapability.BundleManager.BundleFramework.Core 98 * @since 9 99 */ 100 /** 101 * Used to obtain the bundleInfo containing applicationInfo. The obtained bundleInfo does not 102 * contain the information of signatureInfo, hapModuleInfo, ability, extensionAbility and permission. 103 * 104 * @syscap SystemCapability.BundleManager.BundleFramework.Core 105 * @atomicservice 106 * @since 11 107 */ 108 GET_BUNDLE_INFO_WITH_APPLICATION = 0x00000001, 109 /** 110 * Used to obtain the bundleInfo containing hapModuleInfo. The obtained bundleInfo does not 111 * contain the information of signatureInfo, applicationInfo, ability, extensionAbility and permission. 112 * 113 * @syscap SystemCapability.BundleManager.BundleFramework.Core 114 * @since 9 115 */ 116 /** 117 * Used to obtain the bundleInfo containing hapModuleInfo. The obtained bundleInfo does not 118 * contain the information of signatureInfo, applicationInfo, ability, extensionAbility and permission. 119 * 120 * @syscap SystemCapability.BundleManager.BundleFramework.Core 121 * @atomicservice 122 * @since 11 123 */ 124 GET_BUNDLE_INFO_WITH_HAP_MODULE = 0x00000002, 125 /** 126 * Used to obtain the bundleInfo containing ability. The obtained bundleInfo does not 127 * contain the information of signatureInfo, applicationInfo, extensionAbility and permission. 128 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 129 * 130 * @syscap SystemCapability.BundleManager.BundleFramework.Core 131 * @since 9 132 */ 133 /** 134 * Used to obtain the bundleInfo containing ability. The obtained bundleInfo does not 135 * contain the information of signatureInfo, applicationInfo, extensionAbility and permission. 136 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 137 * 138 * @syscap SystemCapability.BundleManager.BundleFramework.Core 139 * @atomicservice 140 * @since 11 141 */ 142 GET_BUNDLE_INFO_WITH_ABILITY = 0x00000004, 143 /** 144 * Used to obtain the bundleInfo containing extensionAbility. The obtained bundleInfo does not 145 * contain the information of signatureInfo, applicationInfo, ability and permission. 146 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 147 * 148 * @syscap SystemCapability.BundleManager.BundleFramework.Core 149 * @since 9 150 */ 151 /** 152 * Used to obtain the bundleInfo containing extensionAbility. The obtained bundleInfo does not 153 * contain the information of signatureInfo, applicationInfo, ability and permission. 154 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 155 * 156 * @syscap SystemCapability.BundleManager.BundleFramework.Core 157 * @atomicservice 158 * @since 11 159 */ 160 GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY = 0x00000008, 161 /** 162 * Used to obtain the bundleInfo containing permission. The obtained bundleInfo does not 163 * contain the information of signatureInfo, applicationInfo, hapModuleInfo, extensionAbility and ability. 164 * 165 * @syscap SystemCapability.BundleManager.BundleFramework.Core 166 * @since 9 167 */ 168 /** 169 * Used to obtain the bundleInfo containing permission. The obtained bundleInfo does not 170 * contain the information of signatureInfo, applicationInfo, hapModuleInfo, extensionAbility and ability. 171 * 172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 173 * @atomicservice 174 * @since 11 175 */ 176 GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION = 0x00000010, 177 /** 178 * Used to obtain the metadata contained in applicationInfo, moduleInfo and abilityInfo. 179 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_APPLICATION, 180 * GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. 181 * 182 * @syscap SystemCapability.BundleManager.BundleFramework.Core 183 * @since 9 184 */ 185 /** 186 * Used to obtain the metadata contained in applicationInfo, moduleInfo and abilityInfo. 187 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_APPLICATION, 188 * GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. 189 * 190 * @syscap SystemCapability.BundleManager.BundleFramework.Core 191 * @atomicservice 192 * @since 11 193 */ 194 GET_BUNDLE_INFO_WITH_METADATA = 0x00000020, 195 /** 196 * Used to obtain the default bundleInfo containing disabled application and ability. 197 * The obtained bundleInfo does not contain information of signatureInfo, applicationInfo, 198 * hapModuleInfo, ability, extensionAbility and permission. 199 * 200 * @syscap SystemCapability.BundleManager.BundleFramework.Core 201 * @since 9 202 */ 203 /** 204 * Used to obtain the default bundleInfo containing disabled application and ability. 205 * The obtained bundleInfo does not contain information of signatureInfo, applicationInfo, 206 * hapModuleInfo, ability, extensionAbility and permission. 207 * 208 * @syscap SystemCapability.BundleManager.BundleFramework.Core 209 * @atomicservice 210 * @since 11 211 */ 212 GET_BUNDLE_INFO_WITH_DISABLE = 0x00000040, 213 /** 214 * Used to obtain the bundleInfo containing signatureInfo. The obtained bundleInfo does not 215 * contain the information of applicationInfo, hapModuleInfo, extensionAbility, ability and permission. 216 * 217 * @syscap SystemCapability.BundleManager.BundleFramework.Core 218 * @since 9 219 */ 220 /** 221 * Used to obtain the bundleInfo containing signatureInfo. The obtained bundleInfo does not 222 * contain the information of applicationInfo, hapModuleInfo, extensionAbility, ability and permission. 223 * 224 * @syscap SystemCapability.BundleManager.BundleFramework.Core 225 * @atomicservice 226 * @since 11 227 */ 228 GET_BUNDLE_INFO_WITH_SIGNATURE_INFO = 0x00000080, 229 /** 230 * Used to obtain the bundleInfo containing menu configuration in hapModuleInfo. 231 * The obtained bundleInfo does not contain the information of applicationInfo, extensionAbility, ability and permission. 232 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 233 * 234 * @syscap SystemCapability.BundleManager.BundleFramework.Core 235 * @atomicservice 236 * @since 11 237 */ 238 GET_BUNDLE_INFO_WITH_MENU = 0x00000100, 239 /** 240 * Used to obtain the bundleInfo containing router map configuration in hapModuleInfo. 241 * The obtained bundleInfo does not contain the information of applicationInfo, extensionAbility, ability and permission. 242 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. 243 * 244 * @syscap SystemCapability.BundleManager.BundleFramework.Core 245 * @atomicservice 246 * @since 12 247 */ 248 GET_BUNDLE_INFO_WITH_ROUTER_MAP = 0x00000200, 249 /** 250 * Used to obtain the skillInfo contained in abilityInfo and extensionInfo. 251 * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE, 252 * GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. 253 * 254 * @syscap SystemCapability.BundleManager.BundleFramework.Core 255 * @atomicservice 256 * @since 12 257 */ 258 GET_BUNDLE_INFO_WITH_SKILL = 0x00000800, 259 /** 260 * Used to return only the applications that have an icon displayed on the homescreen. 261 * Only effective on {@link getAllBundleInfo} 262 * 263 * @syscap SystemCapability.BundleManager.BundleFramework.Core 264 * @systemapi 265 * @since 12 266 */ 267 GET_BUNDLE_INFO_ONLY_WITH_LAUNCHER_ABILITY = 0x00001000, 268 /** 269 * Used to obtain the bundleInfo only if any user installed 270 * 271 * @syscap SystemCapability.BundleManager.BundleFramework.Core 272 * @systemapi 273 * @since 12 274 */ 275 GET_BUNDLE_INFO_OF_ANY_USER = 0x00002000, 276 277 /** 278 * Used to return all applications that exclude app clone information. 279 * Only effective on {@link getAllBundleInfo} 280 * 281 * @syscap SystemCapability.BundleManager.BundleFramework.Core 282 * @systemapi 283 * @since 12 284 */ 285 GET_BUNDLE_INFO_EXCLUDE_CLONE = 0x00004000, 286 } 287 288 /** 289 * Used to query the enumeration value of applicationInfo. Multiple values can be passed in the form. 290 * 291 * @enum { number } 292 * @syscap SystemCapability.BundleManager.BundleFramework.Core 293 * @systemapi 294 * @since 9 295 */ 296 enum ApplicationFlag { 297 /** 298 * Used to obtain the default applicationInfo. The obtained applicationInfo does not contain the information of 299 * permission and metadata. 300 * 301 * @syscap SystemCapability.BundleManager.BundleFramework.Core 302 * @systemapi 303 * @since 9 304 */ 305 GET_APPLICATION_INFO_DEFAULT = 0x00000000, 306 /** 307 * Used to obtain the applicationInfo containing permission. 308 * 309 * @syscap SystemCapability.BundleManager.BundleFramework.Core 310 * @systemapi 311 * @since 9 312 */ 313 GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000001, 314 /** 315 * Used to obtain the applicationInfo containing metadata. 316 * 317 * @syscap SystemCapability.BundleManager.BundleFramework.Core 318 * @systemapi 319 * @since 9 320 */ 321 GET_APPLICATION_INFO_WITH_METADATA = 0x00000002, 322 /** 323 * Used to obtain the applicationInfo containing disabled application. 324 * 325 * @syscap SystemCapability.BundleManager.BundleFramework.Core 326 * @systemapi 327 * @since 9 328 */ 329 GET_APPLICATION_INFO_WITH_DISABLE = 0x00000004 330 } 331 332 /** 333 * Used to query the enumeration value of abilityInfo. Multiple values can be passed in the form. 334 * 335 * @enum { number } 336 * @syscap SystemCapability.BundleManager.BundleFramework.Core 337 * @systemapi 338 * @since 9 339 */ 340 enum AbilityFlag { 341 /** 342 * Used to obtain the default abilityInfo. The obtained abilityInfo does not contain the information of 343 * permission, metadata and disabled abilityInfo. 344 * 345 * @syscap SystemCapability.BundleManager.BundleFramework.Core 346 * @systemapi 347 * @since 9 348 */ 349 GET_ABILITY_INFO_DEFAULT = 0x00000000, 350 /** 351 * Used to obtain the abilityInfo containing permission. 352 * 353 * @syscap SystemCapability.BundleManager.BundleFramework.Core 354 * @systemapi 355 * @since 9 356 */ 357 GET_ABILITY_INFO_WITH_PERMISSION = 0x00000001, 358 /** 359 * Used to obtain the abilityInfo containing applicationInfo. 360 * 361 * @syscap SystemCapability.BundleManager.BundleFramework.Core 362 * @systemapi 363 * @since 9 364 */ 365 GET_ABILITY_INFO_WITH_APPLICATION = 0x00000002, 366 /** 367 * Used to obtain the abilityInfo containing metadata. 368 * 369 * @syscap SystemCapability.BundleManager.BundleFramework.Core 370 * @systemapi 371 * @since 9 372 */ 373 GET_ABILITY_INFO_WITH_METADATA = 0x00000004, 374 /** 375 * Used to obtain the abilityInfo containing disabled abilityInfo. 376 * 377 * @syscap SystemCapability.BundleManager.BundleFramework.Core 378 * @systemapi 379 * @since 9 380 */ 381 GET_ABILITY_INFO_WITH_DISABLE = 0x00000008, 382 /** 383 * Used to obtain the abilityInfo only for system app. 384 * 385 * @syscap SystemCapability.BundleManager.BundleFramework.Core 386 * @systemapi 387 * @since 9 388 */ 389 /** 390 * Used to obtain the abilityInfo only for system app. 391 * 392 * @syscap SystemCapability.BundleManager.BundleFramework.Core 393 * @systemapi 394 * @since 11 395 */ 396 GET_ABILITY_INFO_ONLY_SYSTEM_APP = 0x00000010, 397 /** 398 * Used to obtain the abilityInfo with domain verification. 399 * 400 * @syscap SystemCapability.BundleManager.BundleFramework.Core 401 * @systemapi 402 * @since 12 403 */ 404 GET_ABILITY_INFO_WITH_APP_LINKING = 0x00000040, 405 /** 406 * Used to obtain the abilityInfo with Skill 407 * 408 * @syscap SystemCapability.BundleManager.BundleFramework.Core 409 * @systemapi 410 * @since 12 411 */ 412 GET_ABILITY_INFO_WITH_SKILL = 0x00000080, 413 } 414 415 /** 416 * Used to query the enumeration value of ExtensionAbilityInfo. Multiple values can be passed in the form. 417 * 418 * @enum { number } 419 * @syscap SystemCapability.BundleManager.BundleFramework.Core 420 * @systemapi 421 * @since 9 422 */ 423 enum ExtensionAbilityFlag { 424 /** 425 * Used to obtain the default extensionAbilityInfo. The obtained extensionAbilityInfo does not contain the information of 426 * permission, metadata and disabled abilityInfo. 427 * 428 * @syscap SystemCapability.BundleManager.BundleFramework.Core 429 * @systemapi 430 * @since 9 431 */ 432 GET_EXTENSION_ABILITY_INFO_DEFAULT = 0x00000000, 433 /** 434 * Used to obtain the extensionAbilityInfo containing permission. 435 * 436 * @syscap SystemCapability.BundleManager.BundleFramework.Core 437 * @systemapi 438 * @since 9 439 */ 440 GET_EXTENSION_ABILITY_INFO_WITH_PERMISSION = 0x00000001, 441 /** 442 * Used to obtain the extensionAbilityInfo containing applicationInfo. 443 * 444 * @syscap SystemCapability.BundleManager.BundleFramework.Core 445 * @systemapi 446 * @since 9 447 */ 448 GET_EXTENSION_ABILITY_INFO_WITH_APPLICATION = 0x00000002, 449 /** 450 * Used to obtain the extensionAbilityInfo containing metadata. 451 * 452 * @syscap SystemCapability.BundleManager.BundleFramework.Core 453 * @systemapi 454 * @since 9 455 */ 456 GET_EXTENSION_ABILITY_INFO_WITH_METADATA = 0x00000004, 457 /** 458 * Used to obtain the extensionAbilityInfo with Skill 459 * 460 * @syscap SystemCapability.BundleManager.BundleFramework.Core 461 * @systemapi 462 * @since 12 463 */ 464 GET_EXTENSION_ABILITY_INFO_WITH_SKILL = 0x00000010, 465 } 466 467 /** 468 * This enumeration value is used to identify various types of extension ability 469 * 470 * @enum { number } 471 * @syscap SystemCapability.BundleManager.BundleFramework.Core 472 * @since 9 473 */ 474 /** 475 * This enumeration value is used to identify various types of extension ability 476 * 477 * @enum { number } 478 * @syscap SystemCapability.BundleManager.BundleFramework.Core 479 * @atomicservice 480 * @since 11 481 */ 482 export enum ExtensionAbilityType { 483 /** 484 * Indicates extension info with type of form 485 * 486 * @syscap SystemCapability.BundleManager.BundleFramework.Core 487 * @since 9 488 */ 489 /** 490 * Indicates extension info with type of form 491 * 492 * @syscap SystemCapability.BundleManager.BundleFramework.Core 493 * @atomicservice 494 * @since 11 495 */ 496 FORM = 0, 497 498 /** 499 * Indicates extension info with type of work schedule 500 * 501 * @syscap SystemCapability.BundleManager.BundleFramework.Core 502 * @since 9 503 */ 504 WORK_SCHEDULER = 1, 505 506 /** 507 * Indicates extension info with type of input method 508 * 509 * @syscap SystemCapability.BundleManager.BundleFramework.Core 510 * @since 9 511 */ 512 INPUT_METHOD = 2, 513 514 /** 515 * Indicates extension info with type of service 516 * 517 * @syscap SystemCapability.BundleManager.BundleFramework.Core 518 * @since 9 519 */ 520 SERVICE = 3, 521 522 /** 523 * Indicates extension info with type of accessibility 524 * 525 * @syscap SystemCapability.BundleManager.BundleFramework.Core 526 * @since 9 527 */ 528 ACCESSIBILITY = 4, 529 530 /** 531 * Indicates extension info with type of dataShare 532 * 533 * @syscap SystemCapability.BundleManager.BundleFramework.Core 534 * @since 9 535 */ 536 DATA_SHARE = 5, 537 538 /** 539 * Indicates extension info with type of filesShare 540 * 541 * @syscap SystemCapability.BundleManager.BundleFramework.Core 542 * @since 9 543 */ 544 FILE_SHARE = 6, 545 546 /** 547 * Indicates extension info with type of staticSubscriber 548 * 549 * @syscap SystemCapability.BundleManager.BundleFramework.Core 550 * @since 9 551 */ 552 STATIC_SUBSCRIBER = 7, 553 554 /** 555 * Indicates extension info with type of wallpaper 556 * 557 * @syscap SystemCapability.BundleManager.BundleFramework.Core 558 * @since 9 559 */ 560 WALLPAPER = 8, 561 562 /** 563 * Indicates extension info with type of backup 564 * 565 * @syscap SystemCapability.BundleManager.BundleFramework.Core 566 * @since 9 567 */ 568 BACKUP = 9, 569 570 /** 571 * Indicates extension info with type of window 572 * 573 * @syscap SystemCapability.BundleManager.BundleFramework.Core 574 * @since 9 575 */ 576 WINDOW = 10, 577 578 /** 579 * Indicates extension info with type of enterprise admin 580 * 581 * @syscap SystemCapability.BundleManager.BundleFramework.Core 582 * @since 9 583 */ 584 ENTERPRISE_ADMIN = 11, 585 586 /** 587 * Indicates extension info with type of thumbnail 588 * 589 * @syscap SystemCapability.BundleManager.BundleFramework.Core 590 * @since 9 591 */ 592 THUMBNAIL = 13, 593 594 /** 595 * Indicates extension info with type of preview 596 * 597 * @syscap SystemCapability.BundleManager.BundleFramework.Core 598 * @since 9 599 */ 600 PREVIEW = 14, 601 602 /** 603 * Indicates extension info with type of print 604 * 605 * @syscap SystemCapability.BundleManager.BundleFramework.Core 606 * @since 10 607 */ 608 PRINT = 15, 609 610 /** 611 * Indicates extension info with type of share 612 * 613 * @syscap SystemCapability.BundleManager.BundleFramework.Core 614 * @since 10 615 */ 616 SHARE = 16, 617 618 /** 619 * Indicates extension info with type of push 620 * 621 * @syscap SystemCapability.BundleManager.BundleFramework.Core 622 * @since 10 623 */ 624 PUSH = 17, 625 626 /** 627 * Indicates extension info with type of driver 628 * 629 * @syscap SystemCapability.BundleManager.BundleFramework.Core 630 * @since 10 631 */ 632 DRIVER = 18, 633 634 /** 635 * Indicates extension info with type of action 636 * 637 * @syscap SystemCapability.BundleManager.BundleFramework.Core 638 * @since 10 639 */ 640 ACTION = 19, 641 642 /** 643 * Indicates extension info with type of ads service 644 * 645 * @syscap SystemCapability.BundleManager.BundleFramework.Core 646 * @since 11 647 */ 648 ADS_SERVICE = 20, 649 650 /** 651 * Indicates extension info with type of embedded UI 652 * 653 * @syscap SystemCapability.BundleManager.BundleFramework.Core 654 * @since 12 655 */ 656 EMBEDDED_UI = 21, 657 658 /** 659 * Indicates extension info with type of insight intent UI 660 * 661 * @syscap SystemCapability.BundleManager.BundleFramework.Core 662 * @since 12 663 */ 664 INSIGHT_INTENT_UI = 22, 665 666 /** 667 * Indicates extension info with type of unspecified 668 * 669 * @syscap SystemCapability.BundleManager.BundleFramework.Core 670 * @since 9 671 */ 672 UNSPECIFIED = 255 673 } 674 675 /** 676 * PermissionGrantState 677 * 678 * @enum { number } 679 * @syscap SystemCapability.BundleManager.BundleFramework.Core 680 * @since 9 681 */ 682 /** 683 * PermissionGrantState 684 * 685 * @enum { number } 686 * @syscap SystemCapability.BundleManager.BundleFramework.Core 687 * @atomicservice 688 * @since 11 689 */ 690 export enum PermissionGrantState { 691 /** 692 * PERMISSION_DENIED 693 * 694 * @syscap SystemCapability.BundleManager.BundleFramework.Core 695 * @since 9 696 */ 697 /** 698 * PERMISSION_DENIED 699 * 700 * @syscap SystemCapability.BundleManager.BundleFramework.Core 701 * @atomicservice 702 * @since 11 703 */ 704 PERMISSION_DENIED = -1, 705 706 /** 707 * PERMISSION_GRANTED 708 * 709 * @syscap SystemCapability.BundleManager.BundleFramework.Core 710 * @since 9 711 */ 712 /** 713 * PERMISSION_GRANTED 714 * 715 * @syscap SystemCapability.BundleManager.BundleFramework.Core 716 * @atomicservice 717 * @since 11 718 */ 719 PERMISSION_GRANTED = 0 720 } 721 722 /** 723 * Support window mode 724 * 725 * @enum { number } 726 * @syscap SystemCapability.BundleManager.BundleFramework.Core 727 * @since 9 728 */ 729 /** 730 * Support window mode 731 * 732 * @enum { number } 733 * @syscap SystemCapability.BundleManager.BundleFramework.Core 734 * @atomicservice 735 * @since 11 736 */ 737 export enum SupportWindowMode { 738 /** 739 * Indicates supported window mode of full screen mode 740 * 741 * @syscap SystemCapability.BundleManager.BundleFramework.Core 742 * @since 9 743 */ 744 /** 745 * Indicates supported window mode of full screen mode 746 * 747 * @syscap SystemCapability.BundleManager.BundleFramework.Core 748 * @atomicservice 749 * @since 11 750 */ 751 FULL_SCREEN = 0, 752 /** 753 * Indicates supported window mode of split mode 754 * 755 * @syscap SystemCapability.BundleManager.BundleFramework.Core 756 * @since 9 757 */ 758 /** 759 * Indicates supported window mode of split mode 760 * 761 * @syscap SystemCapability.BundleManager.BundleFramework.Core 762 * @atomicservice 763 * @since 11 764 */ 765 SPLIT = 1, 766 /** 767 * Indicates supported window mode of floating mode 768 * 769 * @syscap SystemCapability.BundleManager.BundleFramework.Core 770 * @since 9 771 */ 772 /** 773 * Indicates supported window mode of floating mode 774 * 775 * @syscap SystemCapability.BundleManager.BundleFramework.Core 776 * @atomicservice 777 * @since 11 778 */ 779 FLOATING = 2 780 } 781 782 /** 783 * Launch type 784 * 785 * @enum { number } 786 * @syscap SystemCapability.BundleManager.BundleFramework.Core 787 * @since 9 788 */ 789 /** 790 * Launch type 791 * 792 * @enum { number } 793 * @syscap SystemCapability.BundleManager.BundleFramework.Core 794 * @crossplatform 795 * @since 10 796 */ 797 /** 798 * Launch type 799 * 800 * @enum { number } 801 * @syscap SystemCapability.BundleManager.BundleFramework.Core 802 * @crossplatform 803 * @atomicservice 804 * @since 11 805 */ 806 export enum LaunchType { 807 /** 808 * Indicates that the ability has only one instance 809 * 810 * @syscap SystemCapability.BundleManager.BundleFramework.Core 811 * @since 9 812 */ 813 /** 814 * Indicates that the ability has only one instance 815 * 816 * @syscap SystemCapability.BundleManager.BundleFramework.Core 817 * @crossplatform 818 * @since 10 819 */ 820 /** 821 * Indicates that the ability has only one instance 822 * 823 * @syscap SystemCapability.BundleManager.BundleFramework.Core 824 * @crossplatform 825 * @atomicservice 826 * @since 11 827 */ 828 SINGLETON = 0, 829 830 /** 831 * Indicates that the ability can have multiple instances 832 * 833 * @syscap SystemCapability.BundleManager.BundleFramework.Core 834 * @since 9 835 */ 836 /** 837 * Indicates that the ability can have multiple instances 838 * 839 * @syscap SystemCapability.BundleManager.BundleFramework.Core 840 * @crossplatform 841 * @since 10 842 */ 843 /** 844 * Indicates that the ability can have multiple instances 845 * 846 * @syscap SystemCapability.BundleManager.BundleFramework.Core 847 * @crossplatform 848 * @atomicservice 849 * @since 11 850 */ 851 MULTITON = 1, 852 853 /** 854 * Indicates that the ability can have specified instances 855 * 856 * @syscap SystemCapability.BundleManager.BundleFramework.Core 857 * @since 9 858 */ 859 /** 860 * Indicates that the ability can have specified instances 861 * 862 * @syscap SystemCapability.BundleManager.BundleFramework.Core 863 * @atomicservice 864 * @since 11 865 */ 866 SPECIFIED = 2 867 } 868 869 /** 870 * Indicates ability type 871 * 872 * @enum { number } 873 * @syscap SystemCapability.BundleManager.BundleFramework.Core 874 * @FAModelOnly 875 * @since 9 876 */ 877 export enum AbilityType { 878 /** 879 * Indicates that the ability has a UI 880 * 881 * @syscap SystemCapability.BundleManager.BundleFramework.Core 882 * @FAModelOnly 883 * @since 9 884 */ 885 PAGE = 1, 886 887 /** 888 * Indicates that the ability does not have a UI 889 * 890 * @syscap SystemCapability.BundleManager.BundleFramework.Core 891 * @FAModelOnly 892 * @since 9 893 */ 894 SERVICE = 2, 895 896 /** 897 * Indicates that the ability is used to provide data access services 898 * 899 * @syscap SystemCapability.BundleManager.BundleFramework.Core 900 * @FAModelOnly 901 * @since 9 902 */ 903 DATA = 3 904 } 905 906 /** 907 * Display orientation 908 * 909 * @enum { number } 910 * @syscap SystemCapability.BundleManager.BundleFramework.Core 911 * @since 9 912 */ 913 /** 914 * Display orientation 915 * 916 * @enum { number } 917 * @syscap SystemCapability.BundleManager.BundleFramework.Core 918 * @atomicservice 919 * @since 11 920 */ 921 export enum DisplayOrientation { 922 /** 923 * Indicates that the system automatically determines the display orientation 924 * 925 * @syscap SystemCapability.BundleManager.BundleFramework.Core 926 * @since 9 927 */ 928 /** 929 * Indicates that the system automatically determines the display orientation 930 * 931 * @syscap SystemCapability.BundleManager.BundleFramework.Core 932 * @atomicservice 933 * @since 11 934 */ 935 UNSPECIFIED, 936 937 /** 938 * Indicates the landscape orientation 939 * 940 * @syscap SystemCapability.BundleManager.BundleFramework.Core 941 * @since 9 942 */ 943 /** 944 * Indicates the landscape orientation 945 * 946 * @syscap SystemCapability.BundleManager.BundleFramework.Core 947 * @atomicservice 948 * @since 11 949 */ 950 LANDSCAPE, 951 952 /** 953 * Indicates the portrait orientation 954 * 955 * @syscap SystemCapability.BundleManager.BundleFramework.Core 956 * @since 9 957 */ 958 /** 959 * Indicates the portrait orientation 960 * 961 * @syscap SystemCapability.BundleManager.BundleFramework.Core 962 * @atomicservice 963 * @since 11 964 */ 965 PORTRAIT, 966 967 /** 968 * Indicates the page ability orientation is the same as that of the nearest ability in the stack 969 * 970 * @syscap SystemCapability.BundleManager.BundleFramework.Core 971 * @since 9 972 */ 973 /** 974 * Indicates the page ability orientation is the same as that of the nearest ability in the stack 975 * 976 * @syscap SystemCapability.BundleManager.BundleFramework.Core 977 * @atomicservice 978 * @since 11 979 */ 980 FOLLOW_RECENT, 981 982 /** 983 * Indicates the inverted landscape orientation 984 * 985 * @syscap SystemCapability.BundleManager.BundleFramework.Core 986 * @since 9 987 */ 988 /** 989 * Indicates the inverted landscape orientation 990 * 991 * @syscap SystemCapability.BundleManager.BundleFramework.Core 992 * @atomicservice 993 * @since 11 994 */ 995 LANDSCAPE_INVERTED, 996 997 /** 998 * Indicates the inverted portrait orientation 999 * 1000 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1001 * @since 9 1002 */ 1003 /** 1004 * Indicates the inverted portrait orientation 1005 * 1006 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1007 * @atomicservice 1008 * @since 11 1009 */ 1010 PORTRAIT_INVERTED, 1011 1012 /** 1013 * Indicates the orientation can be auto-rotated 1014 * 1015 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1016 * @since 9 1017 */ 1018 /** 1019 * Indicates the orientation can be auto-rotated 1020 * 1021 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1022 * @atomicservice 1023 * @since 11 1024 */ 1025 AUTO_ROTATION, 1026 1027 /** 1028 * Indicates the landscape orientation rotated with sensor 1029 * 1030 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1031 * @since 9 1032 */ 1033 /** 1034 * Indicates the landscape orientation rotated with sensor 1035 * 1036 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1037 * @atomicservice 1038 * @since 11 1039 */ 1040 AUTO_ROTATION_LANDSCAPE, 1041 1042 /** 1043 * Indicates the portrait orientation rotated with sensor 1044 * 1045 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1046 * @since 9 1047 */ 1048 /** 1049 * Indicates the portrait orientation rotated with sensor 1050 * 1051 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1052 * @atomicservice 1053 * @since 11 1054 */ 1055 AUTO_ROTATION_PORTRAIT, 1056 1057 /** 1058 * Indicates the sensor restricted mode 1059 * 1060 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1061 * @since 9 1062 */ 1063 /** 1064 * Indicates the sensor restricted mode 1065 * 1066 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1067 * @atomicservice 1068 * @since 11 1069 */ 1070 AUTO_ROTATION_RESTRICTED, 1071 1072 /** 1073 * Indicates the sensor landscape restricted mode 1074 * 1075 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1076 * @since 9 1077 */ 1078 /** 1079 * Indicates the sensor landscape restricted mode 1080 * 1081 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1082 * @atomicservice 1083 * @since 11 1084 */ 1085 AUTO_ROTATION_LANDSCAPE_RESTRICTED, 1086 1087 /** 1088 * Indicates the sensor portrait restricted mode 1089 * 1090 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1091 * @since 9 1092 */ 1093 /** 1094 * Indicates the sensor portrait restricted mode 1095 * 1096 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1097 * @atomicservice 1098 * @since 11 1099 */ 1100 AUTO_ROTATION_PORTRAIT_RESTRICTED, 1101 1102 /** 1103 * Indicates the locked orientation mode 1104 * 1105 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1106 * @since 9 1107 */ 1108 /** 1109 * Indicates the locked orientation mode 1110 * 1111 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1112 * @atomicservice 1113 * @since 11 1114 */ 1115 LOCKED, 1116 1117 /** 1118 * Indicates the system automatically determines the sensor restricted mode 1119 * 1120 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1121 * @atomicservice 1122 * @since 12 1123 */ 1124 AUTO_ROTATION_UNSPECIFIED, 1125 1126 /** 1127 * Indicates the orientation follow the desktop rotate mode 1128 * 1129 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1130 * @atomicservice 1131 * @since 12 1132 */ 1133 FOLLOW_DESKTOP 1134 } 1135 1136 /** 1137 * Indicates module type 1138 * 1139 * @enum { number } 1140 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1141 * @since 9 1142 */ 1143 /** 1144 * Indicates module type 1145 * 1146 * @enum { number } 1147 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1148 * @atomicservice 1149 * @since 11 1150 */ 1151 export enum ModuleType { 1152 /** 1153 * Indicates entry type 1154 * 1155 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1156 * @since 9 1157 */ 1158 /** 1159 * Indicates entry type 1160 * 1161 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1162 * @atomicservice 1163 * @since 11 1164 */ 1165 ENTRY = 1, 1166 /** 1167 * Indicates feature type 1168 * 1169 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1170 * @since 9 1171 */ 1172 /** 1173 * Indicates feature type 1174 * 1175 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1176 * @atomicservice 1177 * @since 11 1178 */ 1179 FEATURE = 2, 1180 /** 1181 * Indicates shared type 1182 * 1183 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1184 * @since 9 1185 */ 1186 /** 1187 * Indicates shared type 1188 * 1189 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1190 * @atomicservice 1191 * @since 11 1192 */ 1193 SHARED = 3 1194 } 1195 1196 /** 1197 * Indicates bundle type 1198 * 1199 * @enum { number } 1200 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1201 * @since 9 1202 */ 1203 /** 1204 * Indicates bundle type 1205 * 1206 * @enum { number } 1207 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1208 * @atomicservice 1209 * @since 11 1210 */ 1211 export enum BundleType { 1212 /** 1213 * Indicates app 1214 * 1215 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1216 * @since 9 1217 */ 1218 /** 1219 * Indicates app 1220 * 1221 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1222 * @atomicservice 1223 * @since 11 1224 */ 1225 APP = 0, 1226 /** 1227 * Indicates atomic service 1228 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1229 * @since 9 1230 */ 1231 /** 1232 * Indicates atomic service 1233 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1234 * @atomicservice 1235 * @since 11 1236 */ 1237 ATOMIC_SERVICE = 1 1238 } 1239 1240 /** 1241 * Shared bundle compatible policy 1242 * 1243 * @enum { number } 1244 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1245 * @since 10 1246 */ 1247 /** 1248 * Shared bundle compatible policy 1249 * 1250 * @enum { number } 1251 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1252 * @atomicservice 1253 * @since 11 1254 */ 1255 export enum CompatiblePolicy { 1256 /** 1257 * Indicates that the app is a shared bundle and the shared bundle type is backward compatibility 1258 * 1259 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1260 * @since 10 1261 */ 1262 /** 1263 * Indicates that the app is a shared bundle and the shared bundle type is backward compatibility 1264 * 1265 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1266 * @atomicservice 1267 * @since 11 1268 */ 1269 BACKWARD_COMPATIBILITY = 1 1270 } 1271 1272 /** 1273 * This enumeration value is used to identify various types of JSON profile. 1274 * 1275 * @enum { number } 1276 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1277 * @systemapi 1278 * @since 11 1279 */ 1280 export enum ProfileType { 1281 /** 1282 * Indicates JSON profile about intent framework. 1283 * 1284 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1285 * @systemapi 1286 * @since 11 1287 */ 1288 INTENT_PROFILE = 1 1289 } 1290 1291 /** 1292 * This enumeration value is used to identify the distribution type of application. 1293 * 1294 * @enum { number } 1295 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1296 * @systemapi 1297 * @since 12 1298 */ 1299 export enum AppDistributionType { 1300 /** 1301 * Indicates the application is distributed by the App Gallery. 1302 * 1303 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1304 * @systemapi 1305 * @since 12 1306 */ 1307 APP_GALLERY = 1, 1308 1309 /** 1310 * Indicates the enterprise application, which can be installed in personal devices. 1311 * 1312 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1313 * @systemapi 1314 * @since 12 1315 */ 1316 ENTERPRISE = 2, 1317 1318 /** 1319 * Indicates the normal enterprise application. 1320 * This kind of application can only be installed on enterprise devices through the enterprise MDM application and does not require device management privileges. 1321 * 1322 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1323 * @systemapi 1324 * @since 12 1325 */ 1326 ENTERPRISE_NORMAL = 3, 1327 1328 /** 1329 * Indicates the enterprise MDM application, which can only be installed on enterprise devices. 1330 * This kind of application requires device management privileges, such as remote locking, which can install normal enterprise applications, etc. 1331 * 1332 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1333 * @systemapi 1334 * @since 12 1335 */ 1336 ENTERPRISE_MDM = 4, 1337 1338 /** 1339 * Indicates the system preinstalled application. 1340 * 1341 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1342 * @systemapi 1343 * @since 12 1344 */ 1345 OS_INTEGRATION = 5, 1346 1347 /** 1348 * Indicates the crowdtesting application. 1349 * 1350 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1351 * @systemapi 1352 * @since 12 1353 */ 1354 CROWDTESTING = 6, 1355 1356 /** 1357 * Indicates other types of application. 1358 * 1359 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1360 * @systemapi 1361 * @since 12 1362 */ 1363 NONE = 7 1364 } 1365 1366 /** 1367 * This enumeration value is used to identify various types of extension ability 1368 * 1369 * @enum { number } 1370 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1371 * @since 12 1372 */ 1373 export enum MultiAppModeType { 1374 /** 1375 * Indicates multi app mode with type of unspecified 1376 * 1377 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1378 * @since 12 1379 */ 1380 UNSPECIFIED = 0, 1381 /** 1382 * Indicates multi app mode with type of multiInstance 1383 * 1384 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1385 * @since 12 1386 */ 1387 MULTI_INSTANCE = 1, 1388 /** 1389 * Indicates multi app mode with type of appClone 1390 * 1391 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1392 * @since 12 1393 */ 1394 APP_CLONE = 2, 1395 } 1396 1397 /** 1398 * This enumeration value is used to identify various flags of application 1399 * 1400 * @enum { number } 1401 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1402 * @systemapi 1403 * @since 12 1404 */ 1405 export enum ApplicationInfoFlag { 1406 /** 1407 * Indicates the application is currently installed for the calling user. 1408 * 1409 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1410 * @systemapi 1411 * @since 12 1412 */ 1413 FLAG_INSTALLED = 0x00000001, 1414 /** 1415 * Indicates the application is currently installed for the other user. 1416 * 1417 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1418 * @systemapi 1419 * @since 15 1420 */ 1421 FLAG_OTHER_INSTALLED = 0x00000010, 1422 /** 1423 * Indicates the application is a preinstall app. 1424 * 1425 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1426 * @systemapi 1427 * @since 15 1428 */ 1429 FLAG_PREINSTALLED_APP = 0x00000020, 1430 /** 1431 * Indicates the application is an updated preinstall app. 1432 * 1433 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1434 * @systemapi 1435 * @since 15 1436 */ 1437 FLAG_PREINSTALLED_APP_UPDATE = 0x00000040, 1438 } 1439 1440 /** 1441 * Obtains own bundleInfo. 1442 * 1443 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1444 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 1445 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1446 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1447 * @since 9 1448 */ 1449 /** 1450 * Obtains own bundleInfo. 1451 * 1452 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1453 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 1454 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1455 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1456 * @atomicservice 1457 * @since 11 1458 */ 1459 function getBundleInfoForSelf(bundleFlags: number): Promise<BundleInfo>; 1460 1461 /** 1462 * Obtains own bundleInfo. 1463 * 1464 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1465 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1466 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1467 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1468 * @since 9 1469 */ 1470 /** 1471 * Obtains own bundleInfo. 1472 * 1473 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1474 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1475 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1476 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1477 * @atomicservice 1478 * @since 11 1479 */ 1480 function getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 1481 1482 /** 1483 * Obtains own bundleInfo. 1484 * 1485 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1486 * @returns { BundleInfo } The result of getting the bundle info. 1487 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1488 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1489 * @since 10 1490 */ 1491 /** 1492 * Obtains own bundleInfo. 1493 * 1494 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1495 * @returns { BundleInfo } The result of getting the bundle info. 1496 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1497 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1498 * @atomicservice 1499 * @since 11 1500 */ 1501 function getBundleInfoForSelfSync(bundleFlags: number): BundleInfo; 1502 1503 /** 1504 * Obtains bundleInfo based on bundleName, bundleFlags. 1505 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 1506 * 1507 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1508 * @param { string } bundleName - Indicates the application bundle name to be queried. 1509 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1510 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1511 * @throws { BusinessError } 201 - Permission denied. 1512 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1513 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1514 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1515 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1516 * @since 14 1517 */ 1518 function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 1519 1520 /** 1521 * Obtains bundleInfo based on bundleName, bundleFlags and userId. 1522 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 1523 * 1524 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1525 * @param { string } bundleName - Indicates the application bundle name to be queried. 1526 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1527 * @param { number } userId - Indicates the user ID or do not pass user ID. 1528 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result. 1529 * @throws { BusinessError } 201 - Permission denied. 1530 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1531 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1532 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1533 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1534 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1535 * @since 14 1536 */ 1537 function getBundleInfo(bundleName: string, 1538 bundleFlags: number, userId: number, callback: AsyncCallback<BundleInfo>): void; 1539 1540 /** 1541 * Obtains bundleInfo based on bundleName, bundleFlags and userId. 1542 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 1543 * 1544 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1545 * @param { string } bundleName - Indicates the application bundle name to be queried. 1546 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 1547 * @param { number } userId - Indicates the user ID or do not pass user ID. 1548 * @returns { Promise<BundleInfo> } The result of getting the bundle info. 1549 * @throws { BusinessError } 201 - Permission denied. 1550 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1551 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1552 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1553 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1554 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1555 * @since 14 1556 */ 1557 function getBundleInfo(bundleName: string, bundleFlags: number, userId?: number): Promise<BundleInfo>; 1558 1559 /** 1560 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1561 * 1562 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1563 * @param { string } bundleName - Indicates the application bundle name to be queried. 1564 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1565 * @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result. 1566 * @throws { BusinessError } 201 - Permission denied. 1567 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1568 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1569 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1570 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1571 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1572 * @systemapi 1573 * @since 9 1574 */ 1575 function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback<ApplicationInfo>): void; 1576 1577 /** 1578 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1579 * 1580 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1581 * @param { string } bundleName - Indicates the application bundle name to be queried. 1582 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1583 * @param { number } userId - Indicates the user ID or do not pass user ID. 1584 * @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result. 1585 * @throws { BusinessError } 201 - Permission denied. 1586 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1587 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1588 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1589 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1590 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1591 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1592 * @systemapi 1593 * @since 9 1594 */ 1595 function getApplicationInfo(bundleName: string, 1596 appFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>): void; 1597 1598 /** 1599 * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1600 * 1601 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1602 * @param { string } bundleName - Indicates the application bundle name to be queried. 1603 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1604 * @param { number } userId - Indicates the user ID or do not pass user ID. 1605 * @returns { Promise<ApplicationInfo> } The result of getting the application info. 1606 * @throws { BusinessError } 201 - Permission denied. 1607 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1608 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1609 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1610 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1611 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1612 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1613 * @systemapi 1614 * @since 9 1615 */ 1616 function getApplicationInfo(bundleName: string, appFlags: number, userId?: number): Promise<ApplicationInfo>; 1617 1618 /** 1619 * Obtains BundleInfo of all bundles available in the system. 1620 * 1621 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1622 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 1623 * @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects. 1624 * @throws { BusinessError } 201 - Permission denied. 1625 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1626 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1627 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1628 * @systemapi 1629 * @since 9 1630 */ 1631 function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback<Array<BundleInfo>>): void; 1632 1633 /** 1634 * Obtains BundleInfo of all bundles available in the system. 1635 * 1636 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1637 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 1638 * @param { number } userId - Indicates the user id. 1639 * @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects. 1640 * @throws { BusinessError } 201 - Permission denied. 1641 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1642 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1643 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1644 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1645 * @systemapi 1646 * @since 9 1647 */ 1648 function getAllBundleInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array<BundleInfo>>): void; 1649 1650 /** 1651 * Obtains BundleInfo of all bundles available in the system. 1652 * 1653 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1654 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. 1655 * @param { number } userId - Indicates the user id. 1656 * @returns { Promise<Array<BundleInfo>> } Returns a list of BundleInfo objects. 1657 * @throws { BusinessError } 201 - Permission denied. 1658 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1659 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1660 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1661 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1662 * @systemapi 1663 * @since 9 1664 */ 1665 function getAllBundleInfo(bundleFlags: number, userId?: number): Promise<Array<BundleInfo>>; 1666 1667 /** 1668 * Obtains information about all installed applications of a specified user. 1669 * 1670 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1671 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1672 * @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects. 1673 * @throws { BusinessError } 201 - Permission denied. 1674 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1675 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1676 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1677 * @systemapi 1678 * @since 9 1679 */ 1680 function getAllApplicationInfo(appFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>): void; 1681 1682 /** 1683 * Obtains information about all installed applications of a specified user. 1684 * 1685 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1686 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1687 * @param { number } userId - Indicates the user ID or do not pass user ID. 1688 * @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects. 1689 * @throws { BusinessError } 201 - Permission denied. 1690 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1691 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1692 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1693 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1694 * @systemapi 1695 * @since 9 1696 */ 1697 function getAllApplicationInfo(appFlags: number, 1698 userId: number, callback: AsyncCallback<Array<ApplicationInfo>>): void; 1699 1700 /** 1701 * Obtains information about all installed applications of a specified user. 1702 * 1703 * @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST 1704 * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. 1705 * @param { number } userId - Indicates the user ID or do not pass user ID. 1706 * @returns { Promise<Array<ApplicationInfo>> } Returns a list of ApplicationInfo objects. 1707 * @throws { BusinessError } 201 - Permission denied. 1708 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1709 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1710 * @throws { BusinessError } 17700004 - The specified user ID is not found. 1711 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1712 * @systemapi 1713 * @since 9 1714 */ 1715 function getAllApplicationInfo(appFlags: number, userId?: number): Promise<Array<ApplicationInfo>>; 1716 1717 /** 1718 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1719 * 1720 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1721 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1722 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1723 * @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result. 1724 * @throws { BusinessError } 201 - Permission denied. 1725 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1726 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1727 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1728 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1729 * @throws { BusinessError } 17700003 - The specified ability is not found. 1730 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1731 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1732 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1733 * @systemapi 1734 * @since 9 1735 */ 1736 function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback<Array<AbilityInfo>>): void; 1737 1738 /** 1739 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1740 * 1741 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1742 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1743 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1744 * @param { number } userId - userId Indicates the user ID. 1745 * @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result. 1746 * @throws { BusinessError } 201 - Permission denied. 1747 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1748 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1749 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1750 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1751 * @throws { BusinessError } 17700003 - The specified ability is not found. 1752 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1753 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1754 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1755 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1756 * @systemapi 1757 * @since 9 1758 */ 1759 function queryAbilityInfo(want: Want, 1760 abilityFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void; 1761 1762 /** 1763 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1764 * 1765 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1766 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1767 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1768 * @param { number } userId - userId Indicates the user ID. 1769 * @returns { Promise<Array<AbilityInfo>> } Returns a list of AbilityInfo objects. 1770 * @throws { BusinessError } 201 - Permission denied. 1771 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1772 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1773 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1774 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1775 * @throws { BusinessError } 17700003 - The specified ability is not found. 1776 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1777 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1778 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1779 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1780 * @systemapi 1781 * @since 9 1782 */ 1783 function queryAbilityInfo(want: Want, abilityFlags: number, userId?: number): Promise<Array<AbilityInfo>>; 1784 1785 /** 1786 * Query the AbilityInfo by the given Want Array. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1787 * 1788 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1789 * @param { Array<Want> } wants - Indicates the Want Array containing the application bundle name to be queried. 1790 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1791 * @param { number } [userId] - userId Indicates the user ID. 1792 * @returns { Promise<Array<AbilityInfo>> } Returns a list of AbilityInfo objects. 1793 * @throws { BusinessError } 201 - Permission denied. 1794 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1795 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1796 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1797 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1798 * @throws { BusinessError } 17700003 - The specified ability is not found. 1799 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1800 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1801 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1802 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1803 * @systemapi 1804 * @since 12 1805 */ 1806 function queryAbilityInfo(wants: Array<Want>, abilityFlags: number, userId?: number): Promise<Array<AbilityInfo>>; 1807 1808 /** 1809 * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1810 * 1811 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1812 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1813 * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. 1814 * @param { number } userId - userId Indicates the user ID. 1815 * @returns { Array<AbilityInfo> } Returns a list of AbilityInfo objects. 1816 * @throws { BusinessError } 201 - Permission denied. 1817 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1818 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1819 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1820 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1821 * @throws { BusinessError } 17700003 - The specified ability is not found. 1822 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1823 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1824 * @throws { BusinessError } 17700029 - The specified ability is disabled. 1825 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1826 * @systemapi 1827 * @since 10 1828 */ 1829 function queryAbilityInfoSync(want: Want, abilityFlags: number, userId?: number): Array<AbilityInfo>; 1830 1831 /** 1832 * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1833 * 1834 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1835 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1836 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1837 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1838 * ExtensionAbilityInfo objects that will be returned. 1839 * @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result. 1840 * @throws { BusinessError } 201 - Permission denied. 1841 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1842 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1843 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1844 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1845 * @throws { BusinessError } 17700003 - The specified extensionAbility 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 queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1852 extensionAbilityFlags: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void; 1853 1854 /** 1855 * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1856 * 1857 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1858 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1859 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1860 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1861 * ExtensionAbilityInfo objects that will be returned. 1862 * @param { number } userId - Indicates the user ID. 1863 * @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result. 1864 * @throws { BusinessError } 201 - Permission denied. 1865 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1866 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1867 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1868 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1869 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1870 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1871 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1872 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1873 * @systemapi 1874 * @since 9 1875 */ 1876 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1877 extensionAbilityFlags: number, userId: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void; 1878 1879 /** 1880 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1881 * 1882 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1883 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1884 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1885 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1886 * ExtensionAbilityInfo objects that will be returned. 1887 * @param { number } userId - Indicates the user ID. 1888 * @returns { Promise<Array<ExtensionAbilityInfo>> } Returns a list of ExtensionAbilityInfo objects. 1889 * @throws { BusinessError } 201 - Permission denied. 1890 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1891 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1892 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1893 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1894 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1895 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1896 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1897 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1898 * @systemapi 1899 * @since 9 1900 */ 1901 function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, 1902 extensionAbilityFlags: number, userId?: number): Promise<Array<ExtensionAbilityInfo>>; 1903 1904 /** 1905 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1906 * 1907 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1908 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1909 * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. 1910 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1911 * ExtensionAbilityInfo objects that will be returned. 1912 * @param { number } userId - Indicates the user ID. 1913 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1914 * @throws { BusinessError } 201 - Permission denied. 1915 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1916 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1917 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1918 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1919 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1920 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1921 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1922 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1923 * @systemapi 1924 * @since 10 1925 */ 1926 function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: ExtensionAbilityType, 1927 extensionAbilityFlags: number, userId?: number): Array<ExtensionAbilityInfo>; 1928 1929 /** 1930 * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1931 * 1932 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1933 * @param { Want } want - Indicates the Want containing the application bundle name to be queried. 1934 * @param { string } extensionAbilityType - Indicates extensionAbilityType. 1935 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1936 * ExtensionAbilityInfo objects that will be returned. 1937 * @param { number } userId - Indicates the user ID. 1938 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1939 * @throws { BusinessError } 201 - Permission denied. 1940 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1941 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1942 * 2. Incorrect parameter types; 3. At least one parameter(action, entity, uri or type) is required for implicit query. 1943 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 1944 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1945 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1946 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 1947 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1948 * @systemapi 1949 * @since 11 1950 */ 1951 function queryExtensionAbilityInfoSync(want: Want, extensionAbilityType: string, 1952 extensionAbilityFlags: number, userId?: number): Array<ExtensionAbilityInfo>; 1953 1954 /** 1955 * Query the ExtensionAbilityInfo by extension ability type. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. 1956 * 1957 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1958 * @param { string } extensionAbilityType - Indicates ExtensionAbilityType. 1959 * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the 1960 * ExtensionAbilityInfo objects that will be returned. 1961 * @param { number } userId - Indicates the user ID. 1962 * @returns { Array<ExtensionAbilityInfo> } Returns a list of ExtensionAbilityInfo objects. 1963 * @throws { BusinessError } 201 - Permission denied. 1964 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 1965 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 1966 * 2. Incorrect parameter types; 3. Parameter extensionAbilityType is empty. 1967 * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. 1968 * @throws { BusinessError } 17700004 - The specified userId is invalid. 1969 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1970 * @systemapi 1971 * @since 11 1972 */ 1973 function queryExtensionAbilityInfoSync(extensionAbilityType: string, extensionAbilityFlags: number, 1974 userId?: number): Array<ExtensionAbilityInfo>; 1975 1976 /** 1977 * Obtains bundle name by the given uid. 1978 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 1979 * 1980 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1981 * @param { number } uid - Indicates the UID of an application. 1982 * @param { AsyncCallback<string> } callback - The callback of getting bundle name. 1983 * @throws { BusinessError } 201 - Permission denied. 1984 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 1985 * @throws { BusinessError } 17700021 - The uid is not found. 1986 * @syscap SystemCapability.BundleManager.BundleFramework.Core 1987 * @since 14 1988 */ 1989 function getBundleNameByUid(uid: number, callback: AsyncCallback<string>): void; 1990 1991 /** 1992 * Obtains bundle name by the given uid. 1993 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 1994 * 1995 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1996 * @param { number } uid - Indicates the UID of an application. 1997 * @returns { Promise<string> } Returns the bundle name. 1998 * @throws { BusinessError } 201 - Permission denied. 1999 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2000 * @throws { BusinessError } 17700021 - The uid is not found. 2001 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2002 * @since 14 2003 */ 2004 function getBundleNameByUid(uid: number): Promise<string>; 2005 2006 /** 2007 * Obtains bundle name by the given uid. 2008 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 2009 * 2010 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2011 * @param { number } uid - Indicates the UID of an application. 2012 * @returns { string } Returns the bundle name. 2013 * @throws { BusinessError } 201 - Permission denied. 2014 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2015 * @throws { BusinessError } 17700021 - The uid is not found. 2016 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2017 * @since 14 2018 */ 2019 function getBundleNameByUidSync(uid: number): string; 2020 2021 /** 2022 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 2023 * 2024 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2025 * @param { string } hapFilePath - Indicates the path storing the HAP. 2026 * The path should be the relative path to the data directory of the current application. 2027 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 2028 * @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle archive info result. 2029 * @throws { BusinessError } 201 - Permission denied. 2030 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2031 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2032 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 2033 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2034 * @systemapi 2035 * @since 9 2036 */ 2037 function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void; 2038 2039 /** 2040 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 2041 * 2042 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2043 * @param { string } hapFilePath - Indicates the path storing the HAP. 2044 * The path should be the relative path to the data directory of the current application. 2045 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 2046 * @returns { Promise<BundleInfo> } Returns the BundleInfo object. 2047 * @throws { BusinessError } 201 - Permission denied. 2048 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2049 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2050 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 2051 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2052 * @systemapi 2053 * @since 9 2054 */ 2055 function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>; 2056 2057 /** 2058 * Obtains information about an application bundle contained in an ohos Ability Package (HAP). 2059 * 2060 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2061 * @param { string } hapFilePath - Indicates the path storing the HAP. 2062 * The path should be the relative path to the data directory of the current application. 2063 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. 2064 * @returns { BundleInfo } Returns the BundleInfo object. 2065 * @throws { BusinessError } 201 - Permission denied. 2066 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2067 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2068 * @throws { BusinessError } 17700022 - The hapFilePath is invalid. 2069 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2070 * @systemapi 2071 * @since 10 2072 */ 2073 function getBundleArchiveInfoSync(hapFilePath: string, bundleFlags: number): BundleInfo; 2074 2075 /** 2076 * Clears cache data of a specified application. 2077 * 2078 * @permission ohos.permission.REMOVE_CACHE_FILES 2079 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 2080 * @param { AsyncCallback<void> } callback - The callback of cleaning bundle cache files result. 2081 * @throws { BusinessError } 201 - Permission denied. 2082 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2083 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2084 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2085 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 2086 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2087 * @systemapi 2088 * @since 9 2089 */ 2090 function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback<void>): void; 2091 2092 /** 2093 * Clears cache data of a specified application. 2094 * 2095 * @permission ohos.permission.REMOVE_CACHE_FILES 2096 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 2097 * @returns { Promise<void> } Clean bundle cache files result 2098 * @throws { BusinessError } 201 - Permission denied. 2099 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2100 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2101 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2102 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 2103 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2104 * @systemapi 2105 * @since 9 2106 */ 2107 function cleanBundleCacheFiles(bundleName: string): Promise<void>; 2108 2109 /** 2110 * Clears cache data of a specified application. 2111 * 2112 * @permission ohos.permission.REMOVE_CACHE_FILES 2113 * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. 2114 * @param { number } appIndex - Indicates the index of clone app. 2115 * @returns { Promise<void> } Clean bundle cache files result 2116 * @throws { BusinessError } 201 - Permission denied. 2117 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2118 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2119 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2120 * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. 2121 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 2122 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2123 * @systemapi 2124 * @since 15 2125 */ 2126 function cleanBundleCacheFiles(bundleName: string, appIndex: number): Promise<void>; 2127 2128 /** 2129 * Get the all bundle cache size of the current user. 2130 * 2131 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2132 * @returns { Promise<number> } Returns all bundle cache size. 2133 * @throws { BusinessError } 201 - Permission denied. 2134 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2135 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2136 * @systemapi 2137 * @since 15 2138 */ 2139 function getAllBundleCacheSize(): Promise<number>; 2140 2141 /** 2142 * Clean all bundle cache files of the current user, does not include the currently running program. 2143 * 2144 * @permission ohos.permission.REMOVE_CACHE_FILES 2145 * @returns { Promise<void> } Clear all bundle cache results. 2146 * @throws { BusinessError } 201 - Permission denied. 2147 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2148 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2149 * @systemapi 2150 * @since 15 2151 */ 2152 function cleanAllBundleCache(): Promise<void>; 2153 2154 /** 2155 * Sets whether to enable a specified application. 2156 * 2157 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2158 * @param { string } bundleName - Indicates the bundle name of the application. 2159 * @param { number } appIndex - Indicates the index of clone app. 2160 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2161 * @returns { Promise<void> } set app enabled result. 2162 * @throws { BusinessError } 201 - Permission denied. 2163 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2164 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2165 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2166 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 2167 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2168 * @systemapi 2169 * @since 12 2170 */ 2171 function setApplicationEnabled(bundleName: string, appIndex: number, isEnabled: boolean): Promise<void>; 2172 2173 /** 2174 * Sets whether to enable a specified application. 2175 * 2176 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2177 * @param { string } bundleName - Indicates the bundle name of the application. 2178 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2179 * @param { AsyncCallback<void> } callback - The callback of setting app enabled result. 2180 * @throws { BusinessError } 201 - Permission denied. 2181 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2182 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2183 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2184 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2185 * @systemapi 2186 * @since 9 2187 */ 2188 function setApplicationEnabled(bundleName: string, isEnabled: boolean, callback: AsyncCallback<void>): void; 2189 2190 /** 2191 * Sets whether to enable a specified application. 2192 * 2193 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2194 * @param { string } bundleName - Indicates the bundle name of the application. 2195 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2196 * @returns { Promise<void> } set app enabled result. 2197 * @throws { BusinessError } 201 - Permission denied. 2198 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2199 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2200 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2201 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2202 * @systemapi 2203 * @since 9 2204 */ 2205 function setApplicationEnabled(bundleName: string, isEnabled: boolean): Promise<void>; 2206 2207 /** 2208 * Sets whether to enable a specified application. 2209 * 2210 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2211 * @param { string } bundleName - Indicates the bundle name of the application. 2212 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2213 * @throws { BusinessError } 201 - Permission denied. 2214 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2215 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2216 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2217 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2218 * @systemapi 2219 * @since 10 2220 */ 2221 function setApplicationEnabledSync(bundleName: string, isEnabled: boolean): void; 2222 2223 /** 2224 * Sets whether to enable a specified ability. 2225 * 2226 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2227 * @param { AbilityInfo } info - Indicates information about the ability to set. 2228 * @param { number } appIndex - Indicates the index of clone app. 2229 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2230 * @returns { Promise<void> } set ability enabled result. 2231 * @throws { BusinessError } 201 - Permission denied. 2232 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2233 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2234 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2235 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 2236 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 2237 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2238 * @systemapi 2239 * @since 12 2240 */ 2241 function setAbilityEnabled(info: AbilityInfo, appIndex: number, isEnabled: boolean): Promise<void>; 2242 2243 /** 2244 * Sets whether to enable a specified ability. 2245 * 2246 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2247 * @param { AbilityInfo } info - Indicates information about the ability to set. 2248 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2249 * @param { AsyncCallback<void> } callback - The callback of setting ability enabled result. 2250 * @throws { BusinessError } 201 - Permission denied. 2251 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2252 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2253 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2254 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 2255 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2256 * @systemapi 2257 * @since 9 2258 */ 2259 function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean, callback: AsyncCallback<void>): void; 2260 2261 /** 2262 * Sets whether to enable a specified ability. 2263 * 2264 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2265 * @param { AbilityInfo } info - Indicates information about the ability to set. 2266 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2267 * @returns { Promise<void> } set ability enabled result. 2268 * @throws { BusinessError } 201 - Permission denied. 2269 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2270 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2271 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2272 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 2273 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2274 * @systemapi 2275 * @since 9 2276 */ 2277 function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean): Promise<void>; 2278 2279 /** 2280 * Sets whether to enable a specified ability. 2281 * 2282 * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE 2283 * @param { AbilityInfo } info - Indicates information about the ability to set. 2284 * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. 2285 * @throws { BusinessError } 201 - Permission denied. 2286 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2287 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2288 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2289 * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. 2290 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2291 * @systemapi 2292 * @since 10 2293 */ 2294 function setAbilityEnabledSync(info: AbilityInfo, isEnabled: boolean): void; 2295 2296 /** 2297 * Checks whether a specified application is enabled. 2298 * 2299 * @param { string } bundleName - Indicates the bundle name of the application. 2300 * @param { number } appIndex - Indicates the index of clone app. 2301 * @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise. 2302 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2303 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2304 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2305 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 2306 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2307 * @systemapi 2308 * @since 12 2309 */ 2310 function isApplicationEnabled(bundleName: string, appIndex: number): Promise<boolean>; 2311 2312 /** 2313 * Checks whether a specified application is enabled. 2314 * 2315 * @param { string } bundleName - Indicates the bundle name of the application. 2316 * @param { AsyncCallback<boolean> } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise. 2317 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2318 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2319 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2320 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2321 * @systemapi 2322 * @since 9 2323 */ 2324 function isApplicationEnabled(bundleName: string, callback: AsyncCallback<boolean>): void; 2325 2326 /** 2327 * Checks whether a specified application is enabled. 2328 * 2329 * @param { string } bundleName - Indicates the bundle name of the application. 2330 * @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise. 2331 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2332 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2333 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2334 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2335 * @systemapi 2336 * @since 9 2337 */ 2338 function isApplicationEnabled(bundleName: string): Promise<boolean>; 2339 2340 /** 2341 * Checks whether a specified application is enabled. 2342 * 2343 * @param { string } bundleName - Indicates the bundle name of the application. 2344 * @returns { boolean } Returns true if the application is enabled; returns false otherwise. 2345 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2346 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2347 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2348 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2349 * @systemapi 2350 * @since 10 2351 */ 2352 function isApplicationEnabledSync(bundleName: string): boolean; 2353 2354 /** 2355 * Checks whether a specified ability is enabled. 2356 * 2357 * @param { AbilityInfo } info - Indicates information about the ability to check. 2358 * @param { number } appIndex - Indicates the index of clone app. 2359 * @returns { Promise<boolean> } Returns true if the ability is enabled; returns false otherwise. 2360 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2361 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2362 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2363 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2364 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 2365 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2366 * @systemapi 2367 * @since 12 2368 */ 2369 function isAbilityEnabled(info: AbilityInfo, appIndex: number): Promise<boolean>; 2370 2371 /** 2372 * Checks whether a specified ability is enabled. 2373 * 2374 * @param { AbilityInfo } info - Indicates information about the ability to check. 2375 * @param { AsyncCallback<boolean> } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise. 2376 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2377 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2378 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2379 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2380 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2381 * @systemapi 2382 * @since 9 2383 */ 2384 function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback<boolean>): void; 2385 2386 /** 2387 * Checks whether a specified ability is enabled. 2388 * 2389 * @param { AbilityInfo } info - Indicates information about the ability to check. 2390 * @returns { Promise<boolean> } Returns true if the ability is enabled; returns false otherwise. 2391 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2392 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2393 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2394 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2395 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2396 * @systemapi 2397 * @since 9 2398 */ 2399 function isAbilityEnabled(info: AbilityInfo): Promise<boolean>; 2400 2401 /** 2402 * Checks whether a specified ability is enabled. 2403 * 2404 * @param { AbilityInfo } info - Indicates information about the ability to check. 2405 * @returns { boolean } Returns true if the ability is enabled; returns false otherwise. 2406 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2407 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2408 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2409 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2410 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2411 * @systemapi 2412 * @since 10 2413 */ 2414 function isAbilityEnabledSync(info: AbilityInfo): boolean; 2415 2416 /** 2417 * Obtains the Want for starting the main ability of an application based on the 2418 * given bundle name. The main ability of an application is the ability that has the 2419 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2420 * 2421 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2422 * @param { string } bundleName - Indicates the bundle name of the application. 2423 * @param { number } userId - Indicates the user ID or do not pass user ID. 2424 * @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability. 2425 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2426 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2427 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2428 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2429 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2430 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2431 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2432 * @systemapi 2433 * @since 9 2434 */ 2435 function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback<Want>): void; 2436 2437 /** 2438 * Obtains the Want for starting the main ability of an application based on the 2439 * given bundle name. The main ability of an application is the ability that has the 2440 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2441 * 2442 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2443 * @param { string } bundleName - Indicates the bundle name of the application. 2444 * @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability. 2445 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2446 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2447 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2448 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2449 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2450 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2451 * @systemapi 2452 * @since 9 2453 */ 2454 function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback<Want>): void; 2455 2456 /** 2457 * Obtains the Want for starting the main ability of an application based on the 2458 * given bundle name. The main ability of an application is the ability that has the 2459 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2460 * 2461 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2462 * @param { string } bundleName - Indicates the bundle name of the application. 2463 * @param { number } userId - Indicates the user ID or do not pass user ID. 2464 * @returns { Promise<Want> } the Want for starting the application's main ability. 2465 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2466 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2467 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2468 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2469 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2470 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2471 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2472 * @systemapi 2473 * @since 9 2474 */ 2475 function getLaunchWantForBundle(bundleName: string, userId?: number): Promise<Want>; 2476 2477 /** 2478 * Obtains the Want for starting the main ability of an application based on the 2479 * given bundle name. The main ability of an application is the ability that has the 2480 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2481 * 2482 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2483 * @param { string } bundleName - Indicates the bundle name of the application. 2484 * @param { number } userId - Indicates the user ID or do not pass user ID. 2485 * @returns { Want } the Want for starting the application's main ability. 2486 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. 2487 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2488 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2489 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2490 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2491 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2492 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2493 * @systemapi 2494 * @since 10 2495 */ 2496 function getLaunchWantForBundleSync(bundleName: string, userId?: number): Want; 2497 2498 /** 2499 * Obtains the Want for starting the main ability of own application. 2500 * The main ability of an application is the ability that has the 2501 * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file. 2502 * 2503 * @returns { Want } the Want for starting the application's main ability. 2504 * @throws { BusinessError } 17700072 - The launch want is not found. 2505 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2506 * @atomicservice 2507 * @since 13 2508 */ 2509 function getLaunchWant(): Want; 2510 2511 /** 2512 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2513 * 2514 * @param { string } moduleName - Indicates the moduleName of the application. 2515 * @param { string } abilityName - Indicates the abilityName of the application. 2516 * @param { string } metadataName - Indicates the name of metadata in ability. 2517 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2518 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2519 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2520 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2521 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2522 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2523 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2524 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2525 * @since 9 2526 */ 2527 /** 2528 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2529 * 2530 * @param { string } moduleName - Indicates the moduleName of the application. 2531 * @param { string } abilityName - Indicates the abilityName of the application. 2532 * @param { string } metadataName - Indicates the name of metadata in ability. 2533 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2534 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2535 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2536 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2537 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2538 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2539 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2540 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2541 * @atomicservice 2542 * @since 11 2543 */ 2544 function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback<Array<string>>): void; 2545 2546 /** 2547 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2548 * 2549 * @param { string } moduleName - Indicates the moduleName of the application. 2550 * @param { string } abilityName - Indicates the abilityName of the application. 2551 * @param { string } metadataName - Indicates the name of metadata in ability. 2552 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2553 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2554 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2555 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2556 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2557 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2558 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2559 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2560 * @since 9 2561 */ 2562 /** 2563 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2564 * 2565 * @param { string } moduleName - Indicates the moduleName of the application. 2566 * @param { string } abilityName - Indicates the abilityName of the application. 2567 * @param { string } metadataName - Indicates the name of metadata in ability. 2568 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2569 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2570 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2571 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2572 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2573 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2574 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2575 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2576 * @atomicservice 2577 * @since 11 2578 */ 2579 function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise<Array<string>>; 2580 2581 /** 2582 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2583 * 2584 * @param { string } moduleName - Indicates the moduleName of the application. 2585 * @param { string } abilityName - Indicates the abilityName of the application. 2586 * @param { string } metadataName - Indicates the name of metadata in ability. 2587 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2588 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2589 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2590 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2591 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2592 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2593 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2594 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2595 * @since 10 2596 */ 2597 /** 2598 * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. 2599 * 2600 * @param { string } moduleName - Indicates the moduleName of the application. 2601 * @param { string } abilityName - Indicates the abilityName of the application. 2602 * @param { string } metadataName - Indicates the name of metadata in ability. 2603 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2604 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2605 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2606 * @throws { BusinessError } 17700003 - The specified abilityName is not existed. 2607 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2608 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2609 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2610 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2611 * @atomicservice 2612 * @since 11 2613 */ 2614 function getProfileByAbilitySync(moduleName: string, abilityName: string, metadataName?: string): Array<string>; 2615 2616 /** 2617 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2618 * 2619 * @param { string } moduleName - Indicates the moduleName of the application. 2620 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2621 * @param { string } metadataName - Indicates the name of metadata in ability. 2622 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2623 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2624 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2625 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2626 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2627 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2628 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2629 * @since 9 2630 */ 2631 /** 2632 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2633 * 2634 * @param { string } moduleName - Indicates the moduleName of the application. 2635 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2636 * @param { string } metadataName - Indicates the name of metadata in ability. 2637 * @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file. 2638 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2639 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2640 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2641 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2642 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2643 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2644 * @atomicservice 2645 * @since 11 2646 */ 2647 function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback<Array<string>>): void; 2648 2649 /** 2650 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2651 * 2652 * @param { string } moduleName - Indicates the moduleName of the application. 2653 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2654 * @param { string } metadataName - Indicates the name of metadata in ability. 2655 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2656 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2657 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2658 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2659 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2660 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2661 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2662 * @since 9 2663 */ 2664 /** 2665 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2666 * 2667 * @param { string } moduleName - Indicates the moduleName of the application. 2668 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2669 * @param { string } metadataName - Indicates the name of metadata in ability. 2670 * @returns { Promise<Array<string>> } Returns string in json-format of the corresponding config file. 2671 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2672 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2673 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2674 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2675 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2676 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2677 * @atomicservice 2678 * @since 11 2679 */ 2680 function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise<Array<string>>; 2681 2682 /** 2683 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2684 * 2685 * @param { string } moduleName - Indicates the moduleName of the application. 2686 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2687 * @param { string } metadataName - Indicates the name of metadata in ability. 2688 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2689 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2690 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2691 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2692 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2693 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2694 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2695 * @since 10 2696 */ 2697 /** 2698 * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. 2699 * 2700 * @param { string } moduleName - Indicates the moduleName of the application. 2701 * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. 2702 * @param { string } metadataName - Indicates the name of metadata in ability. 2703 * @returns { Array<string> } Returns string in json-format of the corresponding config file. 2704 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2705 * @throws { BusinessError } 17700002 - The specified moduleName is not existed. 2706 * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. 2707 * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. 2708 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2709 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2710 * @atomicservice 2711 * @since 11 2712 */ 2713 function getProfileByExtensionAbilitySync(moduleName: string, extensionAbilityName: string, metadataName?: string): Array<string>; 2714 2715 /** 2716 * Get the permission details by permission name. 2717 * 2718 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2719 * @param { string } permissionName - Indicates permission name. 2720 * @param { AsyncCallback<PermissionDef> } callback - The callback of get permissionDef object result. 2721 * @throws { BusinessError } 201 - Permission denied. 2722 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2723 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2724 * @throws { BusinessError } 17700006 - The specified permission is not found. 2725 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2726 * @systemapi 2727 * @since 9 2728 */ 2729 function getPermissionDef(permissionName: string, callback: AsyncCallback<PermissionDef>): void; 2730 2731 /** 2732 * Get the permission details by permission name. 2733 * 2734 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2735 * @param { string } permissionName - Indicates permission name. 2736 * @returns { Promise<PermissionDef> } Returns permissionDef object. 2737 * @throws { BusinessError } 201 - Permission denied. 2738 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2739 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2740 * @throws { BusinessError } 17700006 - The specified permission is not found. 2741 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2742 * @systemapi 2743 * @since 9 2744 */ 2745 function getPermissionDef(permissionName: string): Promise<PermissionDef>; 2746 2747 /** 2748 * Get the permission details by permission name. 2749 * 2750 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2751 * @param { string } permissionName - Indicates permission name. 2752 * @returns { PermissionDef } Returns permissionDef object. 2753 * @throws { BusinessError } 201 - Permission denied. 2754 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2755 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2756 * @throws { BusinessError } 17700006 - The specified permission is not found. 2757 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2758 * @systemapi 2759 * @since 10 2760 */ 2761 function getPermissionDefSync(permissionName: string): PermissionDef; 2762 2763 /** 2764 * Obtains the label of a specified ability. 2765 * 2766 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2767 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2768 * @param { string } moduleName - Indicates the module name. 2769 * @param { string } abilityName - Indicates the ability name. 2770 * @param { AsyncCallback<string> } callback - The callback of getting ability label result. 2771 * @throws { BusinessError } 201 - Permission denied. 2772 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2773 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2774 * @throws { BusinessError } 801 - Capability not supported. 2775 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2776 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2777 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2778 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2779 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2780 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 2781 * @systemapi 2782 * @since 9 2783 */ 2784 function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback<string>): void; 2785 2786 /** 2787 * Obtains the label of a specified ability. 2788 * 2789 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2790 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2791 * @param { string } moduleName - Indicates the module name. 2792 * @param { string } abilityName - Indicates the ability name. 2793 * @returns { Promise<string> } Returns the label representing the label of the specified ability. 2794 * @throws { BusinessError } 201 - Permission denied. 2795 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2796 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2797 * @throws { BusinessError } 801 - Capability not supported. 2798 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2799 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2800 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2801 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2802 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2803 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 2804 * @systemapi 2805 * @since 9 2806 */ 2807 function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise<string>; 2808 2809 /** 2810 * Obtains the label of a specified ability. 2811 * 2812 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2813 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2814 * @param { string } moduleName - Indicates the module name. 2815 * @param { string } abilityName - Indicates the ability name. 2816 * @returns { string } Returns the label representing the label of the specified ability. 2817 * @throws { BusinessError } 201 - Permission denied. 2818 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2819 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2820 * @throws { BusinessError } 801 - Capability not supported. 2821 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2822 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2823 * @throws { BusinessError } 17700003 - The specified abilityName is not found. 2824 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2825 * @throws { BusinessError } 17700029 - The specified ability is disabled. 2826 * @syscap SystemCapability.BundleManager.BundleFramework.Resource 2827 * @systemapi 2828 * @since 10 2829 */ 2830 function getAbilityLabelSync(bundleName: string, moduleName: string, abilityName: string): string; 2831 2832 /** 2833 * Obtains applicationInfo based on a given bundleName and bundleFlags. 2834 * 2835 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2836 * @param { string } bundleName - Indicates the application bundle name to be queried. 2837 * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. 2838 * @param { number } userId - Indicates the user ID or do not pass user ID. 2839 * @returns { ApplicationInfo } - Returns the ApplicationInfo object. 2840 * @throws { BusinessError } 201 - Permission denied. 2841 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2842 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2843 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2844 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2845 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2846 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2847 * @systemapi 2848 * @since 9 2849 */ 2850 function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number): ApplicationInfo; 2851 2852 /** 2853 * Obtains applicationInfo based on a given bundleName and bundleFlags. 2854 * 2855 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2856 * @param { string } bundleName - Indicates the application bundle name to be queried. 2857 * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. 2858 * @returns { ApplicationInfo } - Returns the ApplicationInfo object. 2859 * @throws { BusinessError } 201 - Permission denied. 2860 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2861 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2862 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2863 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2864 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2865 * @systemapi 2866 * @since 9 2867 */ 2868 function getApplicationInfoSync(bundleName: string, applicationFlags: number): ApplicationInfo; 2869 2870 /** 2871 * Obtains bundleInfo based on bundleName, bundleFlags and userId. 2872 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 2873 * 2874 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2875 * @param { string } bundleName - Indicates the application bundle name to be queried. 2876 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. 2877 * @param { number } userId - Indicates the user ID or do not pass user ID. 2878 * @returns { BundleInfo } - Returns the BundleInfo object. 2879 * @throws { BusinessError } 201 - Permission denied. 2880 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2881 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2882 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2883 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2884 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2885 * @since 14 2886 */ 2887 function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo; 2888 2889 /** 2890 * Obtains bundleInfo based on bundleName, bundleFlags. 2891 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 2892 * 2893 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 2894 * @param { string } bundleName - Indicates the application bundle name to be queried. 2895 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. 2896 * @returns { BundleInfo } - Returns the BundleInfo object. 2897 * @throws { BusinessError } 201 - Permission denied. 2898 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2899 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2900 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 2901 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2902 * @since 14 2903 */ 2904 function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; 2905 2906 /** 2907 * Obtains SharedBundleInfo of all shared bundle available in the system. 2908 * 2909 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2910 * @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects. 2911 * @throws { BusinessError } 201 - Permission denied. 2912 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2913 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2914 * @systemapi 2915 * @since 10 2916 */ 2917 function getAllSharedBundleInfo(callback: AsyncCallback<Array<SharedBundleInfo>>): void; 2918 2919 /** 2920 * Obtains SharedBundleInfo of all shared bundle available in the system. 2921 * 2922 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2923 * @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects. 2924 * @throws { BusinessError } 201 - Permission denied. 2925 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2926 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2927 * @systemapi 2928 * @since 10 2929 */ 2930 function getAllSharedBundleInfo(): Promise<Array<SharedBundleInfo>>; 2931 2932 /** 2933 * Obtains SharedBundleInfo of shared bundle by bundle name and module name. 2934 * 2935 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2936 * @param { string } bundleName - Indicates the bundleName of the application. 2937 * @param { string } moduleName - Indicates the moduleName of the application. 2938 * @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects. 2939 * @throws { BusinessError } 201 - Permission denied. 2940 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2941 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2942 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2943 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2944 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2945 * @systemapi 2946 * @since 10 2947 */ 2948 function getSharedBundleInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<SharedBundleInfo>>): void; 2949 2950 /** 2951 * Obtains SharedBundleInfo of shared bundle by bundle name and module name. 2952 * 2953 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2954 * @param { string } bundleName - Indicates the bundleName of the application. 2955 * @param { string } moduleName - Indicates the moduleName of the application. 2956 * @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects. 2957 * @throws { BusinessError } 201 - Permission denied. 2958 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2959 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 2960 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2961 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 2962 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2963 * @systemapi 2964 * @since 10 2965 */ 2966 function getSharedBundleInfo(bundleName: string, moduleName: string): Promise<Array<SharedBundleInfo>>; 2967 2968 /** 2969 * Obtains the profile file information of a specified bundle. 2970 * 2971 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2972 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2973 * @param { AsyncCallback<AppProvisionInfo> } callback - Indicates the callback of getting AppProvisionInfo result. 2974 * @throws { BusinessError } 201 - Permission denied. 2975 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2976 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2977 * 2. Incorrect parameter types; 3. Parameter bundleName is empty. 2978 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2979 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2980 * @systemapi 2981 * @since 10 2982 */ 2983 function getAppProvisionInfo(bundleName: string, callback: AsyncCallback<AppProvisionInfo>): void; 2984 2985 /** 2986 * Obtains the profile file information of a specified bundle. 2987 * 2988 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 2989 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 2990 * @param { number } userId - Indicates the user ID or do not pass user ID. 2991 * @param { AsyncCallback<AppProvisionInfo> } callback - Indicates the callback of getting AppProvisionInfo result. 2992 * @throws { BusinessError } 201 - Permission denied. 2993 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 2994 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2995 * 2. Incorrect parameter types; 3. Parameter bundleName is empty. 2996 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 2997 * @throws { BusinessError } 17700004 - The specified user ID is not found. 2998 * @syscap SystemCapability.BundleManager.BundleFramework.Core 2999 * @systemapi 3000 * @since 10 3001 */ 3002 function getAppProvisionInfo(bundleName: string, userId: number, callback: AsyncCallback<AppProvisionInfo>): void; 3003 3004 /** 3005 * Obtains the profile file information of a specified bundle. 3006 * 3007 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3008 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 3009 * @param { number } userId - Indicates the user ID or do not pass user ID. 3010 * @returns { Promise<AppProvisionInfo> } Returns the AppProvisionInfo object. 3011 * @throws { BusinessError } 201 - Permission denied. 3012 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3013 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3014 * 2. Incorrect parameter types; 3. Parameter bundleName is empty. 3015 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3016 * @throws { BusinessError } 17700004 - The specified user ID is not found. 3017 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3018 * @systemapi 3019 * @since 10 3020 */ 3021 function getAppProvisionInfo(bundleName: string, userId?: number): Promise<AppProvisionInfo>; 3022 3023 /** 3024 * Obtains the profile file information of a specified bundle. 3025 * 3026 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3027 * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. 3028 * @param { number } userId - Indicates the user ID or do not pass user ID. 3029 * @returns { AppProvisionInfo } Returns the AppProvisionInfo object. 3030 * @throws { BusinessError } 201 - Permission denied. 3031 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3032 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3033 * 2. Incorrect parameter types; 3. Parameter bundleName is empty. 3034 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3035 * @throws { BusinessError } 17700004 - The specified user ID is not found. 3036 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3037 * @systemapi 3038 * @since 10 3039 */ 3040 function getAppProvisionInfoSync(bundleName: string, userId?: number): AppProvisionInfo; 3041 3042 /** 3043 * Obtains the distribution type specified during bundle installation. 3044 * 3045 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3046 * @param { string } bundleName - Indicates the application bundle name to be queried. 3047 * @returns { string } The specified distribution type. 3048 * @throws { BusinessError } 201 - Permission denied. 3049 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3050 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3051 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3052 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3053 * @systemapi 3054 * @since 10 3055 */ 3056 function getSpecifiedDistributionType(bundleName: string): string; 3057 3058 /** 3059 * Obtains the additional information during bundle installation. 3060 * 3061 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3062 * @param { string } bundleName - Indicates the application bundle name to be queried. 3063 * @returns { string } The additional information. 3064 * @throws { BusinessError } 201 - Permission denied. 3065 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3066 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3067 * 2. Incorrect parameter types; 3. Parameter bundleName is empty. 3068 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3069 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3070 * @systemapi 3071 * @since 10 3072 */ 3073 function getAdditionalInfo(bundleName: string): string; 3074 3075 /** 3076 * Obtains the JSON profile designated by profileType, bundleName and moduleName. 3077 * 3078 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 3079 * @param { ProfileType } profileType - Indicates the type of profile to be obtained. 3080 * @param { string } bundleName - Indicates the name of the bundle to which the profile belongs. 3081 * @param { string } moduleName - Indicates the name of the module to which the profile belongs. 3082 * @returns { string } Returns string in json-format of the designated profile. 3083 * @throws { BusinessError } 201 - Permission denied. 3084 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3085 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3086 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3087 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 3088 * @throws { BusinessError } 17700024 - Failed to get the profile because the specified profile is not found in the HAP. 3089 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 3090 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3091 * @systemapi 3092 * @since 11 3093 */ 3094 /** 3095 * Obtains the JSON profile designated by profileType, bundleName, moduleName and userId. 3096 * 3097 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 3098 * @param { ProfileType } profileType - Indicates the type of profile to be obtained. 3099 * @param { string } bundleName - Indicates the name of the bundle to which the profile belongs. 3100 * @param { string } moduleName - Indicates the name of the module to which the profile belongs. 3101 * @param { number } userId - Indicates the user ID or do not pass user ID. 3102 * @returns { string } Returns string in json-format of the designated profile. 3103 * @throws { BusinessError } 201 - Permission denied. 3104 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3105 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3106 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3107 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 3108 * @throws { BusinessError } 17700004 - The specified user ID is not found. 3109 * @throws { BusinessError } 17700024 - Failed to get the profile because the specified profile is not found in the HAP. 3110 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 3111 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3112 * @systemapi 3113 * @since 12 3114 */ 3115 function getJsonProfile(profileType: ProfileType, bundleName: string, moduleName?: string, userId?: number): string; 3116 3117 /** 3118 * Get extend resources. 3119 * 3120 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 3121 * @param { string } bundleName - Indicates the bundleName. 3122 * @returns { Promise<Array<string>> } Returns getExtResource result. 3123 * @throws { BusinessError } 201 - Permission denied. 3124 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3125 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3126 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3127 * @throws { BusinessError } 17700303 - Failed to obtain extended resources. 3128 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3129 * @systemapi 3130 * @since 12 3131 */ 3132 function getExtResource(bundleName: string): Promise<Array<string>>; 3133 3134 /** 3135 * Enable dynamic icon. 3136 * 3137 * @permission ohos.permission.ACCESS_DYNAMIC_ICON 3138 * @param { string } bundleName - Indicates the bundleName. 3139 * @param { string } moduleName - Indicates the moduleName for extend resource. 3140 * @returns { Promise<void> } Returns enableDynamicIcon result. 3141 * @throws { BusinessError } 201 - Permission denied. 3142 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3143 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3144 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3145 * @throws { BusinessError } 17700002 - The specified moduleName is not found. 3146 * @throws { BusinessError } 17700304 - Failed to enable the dynamic icon. 3147 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3148 * @systemapi 3149 * @since 12 3150 */ 3151 function enableDynamicIcon(bundleName: string, moduleName: string): Promise<void>; 3152 3153 /** 3154 * Disable dynamic icon. 3155 * 3156 * @permission ohos.permission.ACCESS_DYNAMIC_ICON 3157 * @param { string } bundleName - Indicates the bundleName. 3158 * @returns { Promise<void> } Returns disableDynamicIcon result. 3159 * @throws { BusinessError } 201 - Permission denied. 3160 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3161 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3162 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3163 * @throws { BusinessError } 17700305 - Failed to disable the dynamic icon. 3164 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3165 * @systemapi 3166 * @since 12 3167 */ 3168 function disableDynamicIcon(bundleName: string): Promise<void>; 3169 3170 /** 3171 * Get dynamic icon. 3172 * 3173 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 3174 * @param { string } bundleName - Indicates the bundleName. 3175 * @returns { Promise<string> } Returns dynamic icon key. 3176 * @throws { BusinessError } 201 - Permission denied. 3177 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3178 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3179 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3180 * @throws { BusinessError } 17700306 - Failed to obtain the dynamic icon. 3181 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3182 * @systemapi 3183 * @since 12 3184 */ 3185 function getDynamicIcon(bundleName: string): Promise<string>; 3186 3187 /** 3188 * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. 3189 * 3190 * @permission ohos.permission.RUN_DYN_CODE 3191 * @param { Array<string> } abcPaths - The abc path. 3192 * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. 3193 * @param { AsyncCallback<void> } callback - Indicates the callback of verifyAbc result. 3194 * @throws { BusinessError } 201 - Permission denied. 3195 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3196 * @throws { BusinessError } 17700201 - Failed to verify the abc file. 3197 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3198 * @since 11 3199 */ 3200 /** 3201 * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. 3202 * 3203 * @permission ohos.permission.RUN_DYN_CODE 3204 * @param { Array<string> } abcPaths - The abc path. 3205 * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. 3206 * @param { AsyncCallback<void> } callback - Indicates the callback of verifyAbc result. 3207 * @throws { BusinessError } 201 - Permission denied. 3208 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3209 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3210 * @throws { BusinessError } 17700201 - Failed to verify the abc file. 3211 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3212 * @systemapi 3213 * @since 12 3214 */ 3215 function verifyAbc(abcPaths: Array<string>, deleteOriginalFiles: boolean, callback: AsyncCallback<void>): void; 3216 3217 /** 3218 * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. 3219 * 3220 * @permission ohos.permission.RUN_DYN_CODE 3221 * @param { Array<string> } abcPaths - The abc path. 3222 * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. 3223 * @returns { Promise<void> } Returns verifyAbc result. 3224 * @throws { BusinessError } 201 - Permission denied. 3225 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3226 * @throws { BusinessError } 17700201 - Failed to verify the abc file. 3227 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3228 * @since 11 3229 */ 3230 /** 3231 * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. 3232 * 3233 * @permission ohos.permission.RUN_DYN_CODE 3234 * @param { Array<string> } abcPaths - The abc path. 3235 * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. 3236 * @returns { Promise<void> } Returns verifyAbc result. 3237 * @throws { BusinessError } 201 - Permission denied. 3238 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3239 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3240 * @throws { BusinessError } 17700201 - Failed to verify the abc file. 3241 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3242 * @systemapi 3243 * @since 12 3244 */ 3245 function verifyAbc(abcPaths: Array<string>, deleteOriginalFiles: boolean): Promise<void>; 3246 3247 /** 3248 * Obtains recoverable preinstalled applications. 3249 * 3250 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3251 * @param { AsyncCallback<Array<RecoverableApplicationInfo>> } callback - The callback of getting a list of RecoverableApplicationInfo objects. 3252 * @throws { BusinessError } 201 - Permission denied. 3253 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3254 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3255 * @systemapi 3256 * @since 11 3257 */ 3258 function getRecoverableApplicationInfo(callback: AsyncCallback<Array<RecoverableApplicationInfo>>): void; 3259 3260 /** 3261 * Obtains recoverable preinstalled applications. 3262 * 3263 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3264 * @returns { Promise<Array<RecoverableApplicationInfo>> } Returns a list of RecoverableApplicationInfo objects. 3265 * @throws { BusinessError } 201 - Permission denied. 3266 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3267 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3268 * @systemapi 3269 * @since 11 3270 */ 3271 function getRecoverableApplicationInfo(): Promise<Array<RecoverableApplicationInfo>>; 3272 3273 /** 3274 * Set additional information to the specified application. 3275 * 3276 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3277 * @param { string } bundleName - Indicates the bundle name of the application. 3278 * @param { string } additionalInfo - The additional information. 3279 * @throws { BusinessError } 201 - Permission denied. 3280 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3281 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3282 * 2. Incorrect parameter types; 3. Parameter bundleName is empty. 3283 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3284 * @throws { BusinessError } 17700053 - The caller is not AppGallery. 3285 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3286 * @systemapi 3287 * @since 11 3288 */ 3289 function setAdditionalInfo(bundleName: string, additionalInfo: string): void; 3290 3291 /** 3292 * Delete the verified .abc file. 3293 * 3294 * @permission ohos.permission.RUN_DYN_CODE 3295 * @param { string } abcPath - The abc path. 3296 * @returns { Promise<void> } Returns deleteAbc result. 3297 * @throws { BusinessError } 201 - Permission denied. 3298 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3299 * @throws { BusinessError } 17700202 - Failed to delete the abc file. 3300 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3301 * @since 11 3302 */ 3303 /** 3304 * Delete the verified .abc file. 3305 * 3306 * @permission ohos.permission.RUN_DYN_CODE 3307 * @param { string } abcPath - The abc path. 3308 * @returns { Promise<void> } Returns deleteAbc result. 3309 * @throws { BusinessError } 201 - Permission denied. 3310 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3311 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3312 * @throws { BusinessError } 17700202 - Failed to delete the abc file. 3313 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3314 * @systemapi 3315 * @since 12 3316 */ 3317 function deleteAbc(abcPath: string): Promise<void>; 3318 3319 /** 3320 * Check whether the link can be opened. 3321 * 3322 * @param { string } link - Indicates the link to be opened. 3323 * @returns { boolean } Returns true if the link can be opened; returns false otherwise. 3324 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3325 * @throws { BusinessError } 17700055 - The specified link is invalid. 3326 * @throws { BusinessError } 17700056 - The scheme of the specified link is not in the querySchemes. 3327 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3328 * @atomicservice 3329 * @since 12 3330 */ 3331 function canOpenLink(link: string): boolean; 3332 3333 /** 3334 * Obtains PreinstalledApplicationInfo of all applications preinstalled in the system. 3335 * 3336 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3337 * @returns { Promise<Array<PreinstalledApplicationInfo>> } Returns a list of PreinstalledApplicationInfo objects. 3338 * @throws { BusinessError } 201 - Permission denied. 3339 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3340 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3341 * @systemapi 3342 * @since 12 3343 */ 3344 function getAllPreinstalledApplicationInfo(): Promise<Array<PreinstalledApplicationInfo>>; 3345 3346 /** 3347 * Get a list of BundleInfo objects by developerId. 3348 * 3349 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3350 * @param { string } developerId - Indicates the developerId of the application. 3351 * @returns { Array<BundleInfo> } Returns a list of BundleInfo objects. 3352 * @throws { BusinessError } 201 - Permission denied. 3353 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3354 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3355 * 2. Incorrect parameter types; 3. Parameter developerId is empty. 3356 * @throws { BusinessError } 17700059 - The specified developerId is invalid. 3357 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3358 * @systemapi 3359 * @since 12 3360 */ 3361 function getAllBundleInfoByDeveloperId(developerId: string): Array<BundleInfo>; 3362 3363 /** 3364 * Get a list of developedId by distribution type. 3365 * 3366 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3367 * @param { number } appDistributionType - Indicates the distribution type of the application, and if not passed in, it gets all the developerId. 3368 * @returns { Array<String> } Returns a list of developerId. 3369 * @throws { BusinessError } 201 - Permission denied. 3370 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3371 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3372 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3373 * @systemapi 3374 * @since 12 3375 */ 3376 function getDeveloperIds(appDistributionType?: number): Array<String>; 3377 3378 /** 3379 * Switch uninstall state of a specified application. 3380 * 3381 * @permission ohos.permission.CHANGE_BUNDLE_UNINSTALL_STATE 3382 * @param { string } bundleName - Indicates the bundle name of the application. 3383 * @param { boolean } state - Indicates whether the specified application can be uninstalled. 3384 * @throws { BusinessError } 201 - Permission denied. 3385 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3386 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3387 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3388 * @throws { BusinessError } 17700060 - The specified application cannot be uninstalled. 3389 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3390 * @systemapi 3391 * @since 12 3392 */ 3393 function switchUninstallState(bundleName: string, state: boolean): void; 3394 3395 /** 3396 * Get the BundleInfo of the specified MultiIsolation App. 3397 * 3398 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3399 * @param { string } bundleName - Indicates the application bundle name to be queried. 3400 * @param { number } appIndex - Indicates the index of clone app. 3401 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 3402 * @param { number } [userId] - Indicates the user ID, If the user id is not specified, the current user id is used by default. 3403 * @returns { Promise<BundleInfo> } Returns A BundleInfo Of MultiApp Mode. 3404 * @throws { BusinessError } 201 - Permission denied. 3405 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3406 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3407 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3408 * @throws { BusinessError } 17700004 - The specified user ID is not found. 3409 * @throws { BusinessError } 17700026 - The specified bundle is disabled. 3410 * @throws { BusinessError } 17700061 - AppIndex not in valid range. 3411 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3412 * @systemapi 3413 * @since 12 3414 */ 3415 function getAppCloneBundleInfo(bundleName: string, appIndex: number, bundleFlags: number, userId?: number): Promise<BundleInfo>; 3416 3417 /** 3418 * Get all BundleInfo of clone app. 3419 * 3420 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 3421 * @param { string } bundleName - Indicates the application bundle name to be queried. 3422 * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. 3423 * @param { number } [userId] - Indicates the user ID, If the user id is not specified, the current user id is used by default. 3424 * @returns { Promise<Array<BundleInfo>> } Returns BundleInfo Arrays Of MultiApp Mode. 3425 * @throws { BusinessError } 201 - Permission denied. 3426 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 3427 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3428 * @throws { BusinessError } 17700001 - The specified bundleName is not found. 3429 * @throws { BusinessError } 17700004 - The specified user ID is not found. 3430 * @throws { BusinessError } 17700026 - The specified bundle and clone apps are all disabled. 3431 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3432 * @systemapi 3433 * @since 12 3434 */ 3435 function getAllAppCloneBundleInfo(bundleName: string, bundleFlags: number, userId?: number): Promise<Array<BundleInfo>>; 3436 3437 /** 3438 * Obtains AppCloneIdentity contains bundleName and appIndex by the given uid. 3439 * The application requires to be a system application when requesting the permission of ohos.permission.GET_BUNDLE_INFO. 3440 * 3441 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 3442 * @param { number } uid - Indicates the UID of an application. 3443 * @returns { Promise<AppCloneIdentity> } Returns the clone Identity contains bundleName and appIndex. 3444 * @throws { BusinessError } 201 - Permission denied. 3445 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 3446 * @throws { BusinessError } 17700021 - The uid is not found. 3447 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3448 * @since 14 3449 */ 3450 function getAppCloneIdentity(uid: number): Promise<AppCloneIdentity>; 3451 3452 /** 3453 * Obtains configuration information about an application. 3454 * 3455 * @typedef { _ApplicationInfo } 3456 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3457 * @since 9 3458 */ 3459 /** 3460 * Obtains configuration information about an application. 3461 * 3462 * @typedef { _ApplicationInfo } 3463 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3464 * @atomicservice 3465 * @since 11 3466 */ 3467 export type ApplicationInfo = _ApplicationInfo; 3468 3469 /** 3470 * Indicates the metadata information about a module. 3471 * 3472 * @typedef { _ModuleMetadata } 3473 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3474 * @since 10 3475 */ 3476 /** 3477 * Indicates the metadata information about a module. 3478 * 3479 * @typedef { _ModuleMetadata } 3480 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3481 * @atomicservice 3482 * @since 11 3483 */ 3484 export type ModuleMetadata = _ModuleMetadata; 3485 3486 /** 3487 * Indicates the Metadata. 3488 * 3489 * @typedef { _Metadata } 3490 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3491 * @since 9 3492 */ 3493 /** 3494 * Indicates the Metadata. 3495 * 3496 * @typedef { _Metadata } 3497 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3498 * @atomicservice 3499 * @since 11 3500 */ 3501 export type Metadata = _Metadata; 3502 3503 /** 3504 * Obtains configuration information about a bundle. 3505 * 3506 * @typedef { _BundleInfo.BundleInfo } 3507 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3508 * @since 9 3509 */ 3510 /** 3511 * Obtains configuration information about a bundle. 3512 * 3513 * @typedef { _BundleInfo.BundleInfo } 3514 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3515 * @atomicservice 3516 * @since 11 3517 */ 3518 export type BundleInfo = _BundleInfo.BundleInfo; 3519 3520 /** 3521 * The scene which is used. 3522 * 3523 * @typedef { _BundleInfo.UsedScene } 3524 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3525 * @since 9 3526 */ 3527 /** 3528 * The scene which is used. 3529 * 3530 * @typedef { _BundleInfo.UsedScene } 3531 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3532 * @atomicservice 3533 * @since 11 3534 */ 3535 export type UsedScene = _BundleInfo.UsedScene; 3536 3537 /** 3538 * Indicates the required permissions details defined in file config.json. 3539 * 3540 * @typedef { _BundleInfo.ReqPermissionDetail } 3541 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3542 * @since 9 3543 */ 3544 /** 3545 * Indicates the required permissions details defined in file config.json. 3546 * 3547 * @typedef { _BundleInfo.ReqPermissionDetail } 3548 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3549 * @atomicservice 3550 * @since 11 3551 */ 3552 export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; 3553 3554 /** 3555 * Indicates the SignatureInfo. 3556 * 3557 * @typedef { _BundleInfo.SignatureInfo } 3558 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3559 * @since 9 3560 */ 3561 /** 3562 * Indicates the SignatureInfo. 3563 * 3564 * @typedef { _BundleInfo.SignatureInfo } 3565 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3566 * @atomicservice 3567 * @since 11 3568 */ 3569 export type SignatureInfo = _BundleInfo.SignatureInfo; 3570 3571 /** 3572 * AppCloneIdentity Contain BundleName and appIndex. 3573 * 3574 * @typedef { _BundleInfo.AppCloneIdentity } 3575 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3576 * @since 15 3577 */ 3578 export type AppCloneIdentity = _BundleInfo.AppCloneIdentity; 3579 3580 /** 3581 * Obtains configuration information about a module. 3582 * 3583 * @typedef { _HapModuleInfo.HapModuleInfo } 3584 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3585 * @since 9 3586 */ 3587 /** 3588 * Obtains configuration information about a module. 3589 * 3590 * @typedef { _HapModuleInfo.HapModuleInfo } 3591 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3592 * @atomicservice 3593 * @since 11 3594 */ 3595 export type HapModuleInfo = _HapModuleInfo.HapModuleInfo; 3596 3597 /** 3598 * Obtains preload information about a module. 3599 * 3600 * @typedef { _HapModuleInfo.PreloadItem } 3601 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3602 * @since 9 3603 */ 3604 /** 3605 * Obtains preload information about a module. 3606 * 3607 * @typedef { _HapModuleInfo.PreloadItem } 3608 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3609 * @atomicservice 3610 * @since 11 3611 */ 3612 export type PreloadItem = _HapModuleInfo.PreloadItem; 3613 3614 /** 3615 * Obtains dependency information about a module. 3616 * 3617 * @typedef { _HapModuleInfo.Dependency } 3618 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3619 * @since 9 3620 */ 3621 /** 3622 * Obtains dependency information about a module. 3623 * 3624 * @typedef { _HapModuleInfo.Dependency } 3625 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3626 * @atomicservice 3627 * @since 11 3628 */ 3629 export type Dependency = _HapModuleInfo.Dependency; 3630 3631 /** 3632 * Obtains the router item about a module. 3633 * 3634 * @typedef { _HapModuleInfo.RouterItem} 3635 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3636 * @atomicservice 3637 * @since 12 3638 */ 3639 export type RouterItem = _HapModuleInfo.RouterItem; 3640 3641 /** 3642 * Obtains the data item within router item. 3643 * 3644 * @typedef { _HapModuleInfo.DataItem } 3645 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3646 * @atomicservice 3647 * @since 12 3648 */ 3649 export type DataItem = _HapModuleInfo.DataItem; 3650 3651 /** 3652 * Obtains configuration information about an ability. 3653 * 3654 * @typedef { _AbilityInfo.AbilityInfo } 3655 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3656 * @since 9 3657 */ 3658 /** 3659 * Obtains configuration information about an ability. 3660 * 3661 * @typedef { _AbilityInfo.AbilityInfo } 3662 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3663 * @atomicservice 3664 * @since 11 3665 */ 3666 export type AbilityInfo = _AbilityInfo.AbilityInfo; 3667 3668 /** 3669 * Contains basic Ability information. Indicates the window size.. 3670 * 3671 * @typedef { _AbilityInfo.WindowSize } 3672 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3673 * @since 9 3674 */ 3675 /** 3676 * Contains basic Ability information. Indicates the window size.. 3677 * 3678 * @typedef { _AbilityInfo.WindowSize } 3679 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3680 * @atomicservice 3681 * @since 11 3682 */ 3683 export type WindowSize = _AbilityInfo.WindowSize; 3684 3685 /** 3686 * Obtains extension information about a bundle. 3687 * 3688 * @typedef { _ExtensionAbilityInfo.ExtensionAbilityInfo } 3689 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3690 * @since 9 3691 */ 3692 /** 3693 * Obtains extension information about a bundle. 3694 * 3695 * @typedef { _ExtensionAbilityInfo.ExtensionAbilityInfo } 3696 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3697 * @atomicservice 3698 * @since 11 3699 */ 3700 export type ExtensionAbilityInfo = _ExtensionAbilityInfo.ExtensionAbilityInfo; 3701 3702 /** 3703 * Indicates the defined permission details in file config.json. 3704 * 3705 * @typedef { _PermissionDef } 3706 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3707 * @systemapi 3708 * @since 9 3709 */ 3710 export type PermissionDef = _PermissionDef; 3711 3712 /** 3713 * Contains basic Ability information, which uniquely identifies an ability. 3714 * 3715 * @typedef { _ElementName } 3716 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3717 * @since 9 3718 */ 3719 /** 3720 * Contains basic Ability information, which uniquely identifies an ability. 3721 * 3722 * @typedef { _ElementName } 3723 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3724 * @atomicservice 3725 * @since 11 3726 */ 3727 export type ElementName = _ElementName; 3728 3729 /** 3730 * Contains shared bundle info. 3731 * 3732 * @typedef { _SharedBundleInfo } 3733 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3734 * @systemapi 3735 * @since 10 3736 */ 3737 export type SharedBundleInfo = _SharedBundleInfo; 3738 3739 /** 3740 * Obtains profile file information about a bundle. 3741 * 3742 * @typedef { _AppProvisionInfo.AppProvisionInfo } 3743 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3744 * @systemapi 3745 * @since 10 3746 */ 3747 export type AppProvisionInfo = _AppProvisionInfo.AppProvisionInfo; 3748 3749 /** 3750 * Obtains profile file validity about a bundle. 3751 * 3752 * @typedef { _AppProvisionInfo.Validity } 3753 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3754 * @systemapi 3755 * @since 10 3756 */ 3757 export type Validity = _AppProvisionInfo.Validity; 3758 3759 /** 3760 * Obtains information about a recoverable preinstalled application. 3761 * 3762 * @typedef { _RecoverableApplicationInfo } 3763 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3764 * @systemapi 3765 * @since 11 3766 */ 3767 export type RecoverableApplicationInfo = _RecoverableApplicationInfo; 3768 3769 /** 3770 * Obtains configuration information about an skill 3771 * 3772 * @typedef { _Skill.Skill } 3773 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3774 * @atomicservice 3775 * @since 12 3776 */ 3777 export type Skill = _Skill.Skill; 3778 3779 /** 3780 * Obtains configuration information about an skillUri 3781 * 3782 * @typedef { _Skill.SkillUri } 3783 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3784 * @atomicservice 3785 * @since 12 3786 */ 3787 export type SkillUrl = _Skill.SkillUri; 3788 3789 /** 3790 * Indicates the information of preinstalled application. 3791 * 3792 * @typedef { _PreinstalledApplicationInfo } 3793 * @syscap SystemCapability.BundleManager.BundleFramework.Core 3794 * @systemapi 3795 * @since 12 3796 */ 3797 export type PreinstalledApplicationInfo = _PreinstalledApplicationInfo; 3798} 3799 3800export default bundleManager; 3801