1# @ohos.bundle (Bundle) 2 3The **bundle** module provides APIs for obtaining information about an application, including [bundle information](js-apis-bundle-BundleInfo.md), [application information](js-apis-bundle-ApplicationInfo.md), and [ability information](js-apis-bundle-AbilityInfo.md). It also provides APIs to obtain and set the application disabling state. 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8> This module is deprecated since API version 9. 9## Modules to Import 10 11```ts 12import bundle from '@ohos.bundle'; 13``` 14 15## Required Permissions 16 17| Permission | APL | Description | 18|--------------------------------------------|--------------|---------------| 19| ohos.permission.CHANGE_ABILITY_ENABLED_STATE | system_basic | Permission to enable or disable an application or ability.| 20| ohos.permission.GET_BUNDLE_INFO | normal | Permission to query information about a specified bundle.| 21| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED| system_basic | Permission to query information about all bundles. | 22| ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall bundles. | 23| ohos.permission.REMOVE_CACHE_FILES | system_basic | Permission to clear cache files of a bundle.| 24 25For details, see [Permission APL](../../security/AccessToken/app-permission-mgmt-overview.md#permission-apl). 26 27## bundle.getApplicationInfo<sup>deprecated<sup> 28 29> This API is deprecated since API version 9. 30 31getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number): Promise\<ApplicationInfo> 32 33Obtains the application information based on a given bundle name. This API uses a promise to return the result. 34 35No permission is required for obtaining the caller's own information. 36 37**Required permissions** 38 39ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 40 41**System capability** 42 43SystemCapability.BundleManager.BundleFramework 44 45**Parameters** 46 47| Name | Type | Mandatory| Description | 48| ----------- | ------ | ---- | ------------------------------------------------------------ | 49| bundleName | string | Yes | Bundle name. | 50| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| 51| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 52 53**Return value** 54 55| Type | Description | 56| ------------------------- | ------------------ | 57| Promise\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Promise used to return the application information.| 58 59**Example** 60 61```ts 62import bundle from '@ohos.bundle'; 63import { BusinessError } from '@ohos.base'; 64 65let bundleName: string = "com.example.myapplication"; 66let bundleFlags: number = 0; 67let userId: number = 100; 68bundle.getApplicationInfo(bundleName, bundleFlags, userId) 69.then((data) => { 70 console.info('Operation successful. Data: ' + JSON.stringify(data)); 71}).catch((error: BusinessError) => { 72 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 73}) 74``` 75 76## bundle.getApplicationInfo<sup>deprecated<sup> 77 78> This API is deprecated since API version 9. 79 80getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback\<ApplicationInfo>): void 81 82Obtains the application information of the specified user based on a given bundle name. This API uses an asynchronous callback to return the result. 83 84No permission is required for obtaining the caller's own information. 85 86**Required permissions** 87 88ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 89 90**System capability** 91 92SystemCapability.BundleManager.BundleFramework 93 94**Parameters** 95 96| Name | Type | Mandatory| Description | 97| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 98| bundleName | string | Yes | Bundle name. | 99| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| 100| userId | number | Yes | User ID. The value must be greater than or equal to 0. | 101| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | 102 103**Example** 104 105```ts 106import bundle from '@ohos.bundle'; 107 108let bundleName: string = "com.example.myapplication"; 109let bundleFlags: number = 0; 110let userId: number = 100; 111bundle.getApplicationInfo(bundleName, bundleFlags, userId, (err, data) => { 112 if (err) { 113 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 114 return; 115 } 116 console.info('Operation successful. Data:' + JSON.stringify(data)); 117 }) 118``` 119 120## bundle.getApplicationInfo<sup>deprecated<sup> 121 122> This API is deprecated since API version 9. 123 124 125getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<ApplicationInfo>): void 126 127Obtains the application information based on a given bundle name. This API uses an asynchronous callback to return the result. 128 129No permission is required for obtaining the caller's own information. 130 131**Required permissions** 132 133ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 134 135**System capability** 136 137SystemCapability.BundleManager.BundleFramework 138 139**Parameters** 140 141| Name | Type | Mandatory| Description | 142| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 143| bundleName | string | Yes | Bundle name. | 144| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| 145| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | 146 147**Example** 148 149```ts 150import bundle from '@ohos.bundle'; 151 152let bundleName: string = "com.example.myapplication"; 153let bundleFlags: number = 0; 154bundle.getApplicationInfo(bundleName, bundleFlags, (err, data) => { 155 if (err) { 156 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 157 return; 158 } 159 console.info('Operation successful. Data:' + JSON.stringify(data)); 160 }) 161``` 162 163 164## bundle.getAllBundleInfo<sup>deprecated<sup> 165 166> This API is deprecated since API version 9. 167 168getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise\<Array\<BundleInfo\>\> 169 170Obtains the information of all bundles of the specified user. This API uses a promise to return the result. 171 172**Required permissions** 173 174ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 175 176**System capability** 177 178SystemCapability.BundleManager.BundleFramework 179 180**Parameters** 181 182| Name | Type | Mandatory| Description | 183| ---------- | ---------- | ---- | ------------------------------------------------------------ | 184| bundleFlag | BundleFlag | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 185| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 186 187**Return value** 188 189| Type | Description | 190| --------------------------- | -------------------------- | 191| Promise<Array\<[BundleInfo](js-apis-bundle-BundleInfo.md)>> | Promise used to return the information of all bundles.| 192 193**Example** 194 195```ts 196import bundle from '@ohos.bundle'; 197import { BusinessError } from '@ohos.base'; 198 199let bundleFlag: number = 0; 200let userId: number = 100; 201 202bundle.getAllBundleInfo(bundleFlag, userId) 203.then((data) => { 204 console.info('Operation successful. Data: ' + JSON.stringify(data)); 205}).catch((error: BusinessError) => { 206 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 207}) 208``` 209 210## bundle.getAllBundleInfo<sup>deprecated<sup> 211 212> This API is deprecated since API version 9. 213 214 215getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback\<Array\<BundleInfo\>\>): void 216 217Obtains the information of all bundles of the current user. This API uses an asynchronous callback to return the result. 218 219**Required permissions** 220 221ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 222 223**System capability** 224 225SystemCapability.BundleManager.BundleFramework 226 227**Parameters** 228 229| Name | Type | Mandatory| Description | 230| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 231| bundleFlag | BundleFlag | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 232| callback | AsyncCallback<Array\<[BundleInfo](js-apis-bundle-BundleInfo.md)>> | Yes | Callback used to return the information of all bundles. | 233 234**Example** 235 236```ts 237import bundle from '@ohos.bundle'; 238 239let bundleFlag: number = 0; 240bundle.getAllBundleInfo(bundleFlag, (err, data) => { 241 if (err) { 242 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 243 return; 244 } 245 console.info('Operation successful. Data:' + JSON.stringify(data)); 246 }) 247``` 248 249## bundle.getAllBundleInfo<sup>deprecated<sup> 250 251> This API is deprecated since API version 9. 252 253 254getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback\<Array\<BundleInfo\>\>): void 255 256Obtains the information of all bundles of the specified user. This API uses an asynchronous callback to return the result. 257 258**Required permissions** 259 260ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 261 262**System capability** 263 264SystemCapability.BundleManager.BundleFramework 265 266**Parameters** 267 268| Name | Type | Mandatory | Description | 269|------------|-------------------------------------------------------------------|-----|---------------------------------------------------------------------| 270| bundleFlag | BundleFlag | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 271| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 272| callback | AsyncCallback<Array\<[BundleInfo](js-apis-bundle-BundleInfo.md)>> | Yes | Callback used to return the information of all bundles. | 273| 274 275**Example** 276 277```ts 278import bundle from '@ohos.bundle'; 279 280let bundleFlag: number = 0; 281let userId: number = 100; 282bundle.getAllBundleInfo(bundleFlag, userId, (err, data) => { 283 if (err) { 284 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 285 return; 286 } 287 console.info('Operation successful. Data:' + JSON.stringify(data)); 288 }) 289``` 290 291## bundle.getBundleInfo<sup>deprecated<sup> 292 293> This API is deprecated since API version 9. 294 295 296getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise\<BundleInfo> 297 298Obtains the bundle information based on a given bundle name. This API uses a promise to return the result. 299 300No permission is required for obtaining the caller's own information. 301 302**Required permissions** 303 304ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 305 306**System capability** 307 308SystemCapability.BundleManager.BundleFramework 309 310**Parameters** 311 312| Name | Type | Mandatory | Description | 313| ----------- | ------------- | ---- |---------------------------------------------------------------------| 314| bundleName | string | Yes | Bundle name. | 315| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 316| options | [BundleOptions](#bundleoptionsdeprecated) | No | Options that contain the user ID. | 317 318**Return value** 319 320| Type | Description | 321| -------------------- | ---------------------------- | 322| Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the bundle information.| 323 324**Example** 325 326```ts 327import bundle from '@ohos.bundle'; 328import { BusinessError } from '@ohos.base'; 329 330let bundleName: string = "com.example.myapplication"; 331let bundleFlags: number = 1; 332let options: bundle.BundleOptions = { 333 "userId": 100 334}; 335bundle.getBundleInfo(bundleName, bundleFlags, options) 336.then((data) => { 337 console.info('Operation successful. Data: ' + JSON.stringify(data)); 338}).catch((error: BusinessError) => { 339 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 340}) 341``` 342 343## bundle.getBundleInfo<sup>deprecated<sup> 344 345> This API is deprecated since API version 9. 346 347getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\<BundleInfo>): void 348 349Obtains the bundle information based on a given bundle name. This API uses an asynchronous callback to return the result. 350 351No permission is required for obtaining the caller's own information. 352 353**Required permissions** 354 355ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 356 357**System capability** 358 359SystemCapability.BundleManager.BundleFramework 360 361**Parameters** 362 363| Name | Type | Mandatory| Description | 364| ----------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ | 365| bundleName | string | Yes | Bundle name. | 366| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 367| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | 368 369**Example** 370 371```ts 372import bundle from '@ohos.bundle'; 373 374let bundleName: string = "com.example.myapplication"; 375let bundleFlags: number = 1; 376bundle.getBundleInfo(bundleName, bundleFlags, (err, data) => { 377 if (err) { 378 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 379 return; 380 } 381 console.info('Operation successful. Data:' + JSON.stringify(data)); 382}) 383``` 384 385## bundle.getBundleInfo<sup>deprecated<sup> 386 387> This API is deprecated since API version 9. 388 389getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback\<BundleInfo>): void 390 391Obtains the bundle information based on a given bundle name and bundle options. This API uses an asynchronous callback to return the result. 392 393No permission is required for obtaining the caller's own information. 394 395**Required permissions** 396 397ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 398 399**System capability** 400 401SystemCapability.BundleManager.BundleFramework 402 403**Parameters** 404 405| Name | Type | Mandatory| Description | 406| ----------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ | 407| bundleName | string | Yes | Bundle name. | 408| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 409| options | [BundleOptions](#bundleoptionsdeprecated) | Yes | Includes **userId**. | 410| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | 411 412**Example** 413 414```ts 415import bundle from '@ohos.bundle'; 416 417let bundleName: string = "com.example.myapplication"; 418let bundleFlags: number = 1; 419let options: bundle.BundleOptions = { 420 "userId": 100 421}; 422bundle.getBundleInfo(bundleName, bundleFlags, options, (err, data) => { 423 if (err) { 424 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 425 return; 426 } 427 console.info('Operation successful. Data:' + JSON.stringify(data)); 428}) 429``` 430 431 432 433## bundle.getBundleInstaller<sup>deprecated<sup> 434 435> This API is deprecated since API version 9. You are advised to use [installer.getBundleInstaller](js-apis-installer.md#bundleinstallergetbundleinstaller) instead. 436 437getBundleInstaller(): Promise<BundleInstaller> 438 439Obtains the installation package. This API uses a promise to return the result. 440 441**Required permissions** 442 443ohos.permission.INSTALL_BUNDLE 444 445**System capability** 446 447SystemCapability.BundleManager.BundleFramework 448 449**System API** 450 451This is a system API. 452 453**Return value** 454 455| Type | Description | 456| ------------------------------------------------------------ | -------------------------------------------- | 457| Promise<[BundleInstaller](js-apis-bundle-BundleInstaller.md)> | Promise used to return the installation package.| 458 459**Example** 460 461```ts 462import bundle from '@ohos.bundle'; 463import { BusinessError } from '@ohos.base'; 464 465bundle.getBundleInstaller().then((data) => { 466 console.info('getBundleInstaller successfully.'); 467}).catch((error: BusinessError) => { 468 console.error('getBundleInstaller failed.'); 469}); 470``` 471 472## bundle.getBundleInstaller<sup>deprecated<sup> 473 474> This API is deprecated since API version 9. You are advised to use [installer.getBundleInstaller](js-apis-installer.md#bundleinstallergetbundleinstaller) instead. 475 476getBundleInstaller(callback: AsyncCallback<BundleInstaller>): void 477 478Obtains the installation package. This API uses an asynchronous callback to return the result. 479 480**Required permissions** 481 482ohos.permission.INSTALL_BUNDLE 483 484**System capability** 485 486SystemCapability.BundleManager.BundleFramework 487 488**System API** 489 490This is a system API. 491 492**Parameters** 493 494| Name | Type | Mandatory| Description | 495| -------- | ------------------------------------------------------------ | ---- | ---------------- | 496| callback | AsyncCallback<[BundleInstaller](js-apis-bundle-BundleInstaller.md)> | Yes | Callback used to return the installation package.| 497 498**Example** 499 500```ts 501import bundle from '@ohos.bundle'; 502 503bundle.getBundleInstaller((err, data) => { 504 if (err.code == 0) { 505 console.error('getBundleInstaller failed.'); 506 } else { 507 console.info('getBundleInstaller successfully'); 508 } 509}); 510``` 511## bundle.cleanBundleCacheFiles<sup>8+</sup> <sup>deprecated<sup> 512 513> This API is deprecated since API version 9. You are advised to use [bundleManager.cleanBundleCacheFiles](js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles) instead. 514 515cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback<void>): void 516 517Clears the cache data of an application. This API uses an asynchronous callback to return the result. 518 519**Required permissions** 520 521ohos.permission.REMOVE_CACHE_FILES 522 523**System capability** 524 525SystemCapability.BundleManager.BundleFramework 526 527**System API** 528 529This is a system API. 530 531**Parameters** 532 533| Name | Type | Mandatory| Description | 534| ---------- | ------------------- | ---- | ------------------------------------- | 535| bundleName | string | Yes | Bundle name.| 536| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | 537 538**Example** 539 540```ts 541import bundle from '@ohos.bundle'; 542 543let bundleName: string = "com.example.myapplication"; 544 545bundle.cleanBundleCacheFiles(bundleName, err => { 546 if (err) { 547 console.error('cleanBundleCacheFiles failed.'); 548 } else { 549 console.info('cleanBundleCacheFiles successfully.'); 550 } 551}); 552``` 553 554## bundle.cleanBundleCacheFiles<sup>8+</sup> <sup>deprecated<sup> 555 556> This API is deprecated since API version 9. You are advised to use [bundleManager.cleanBundleCacheFiles](js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles) instead. 557 558cleanBundleCacheFiles(bundleName: string): Promise<void> 559 560Clears the cache data of an application. This API uses a promise to return the result. 561 562**Required permissions** 563 564ohos.permission.REMOVE_CACHE_FILES 565 566**System capability** 567 568SystemCapability.BundleManager.BundleFramework 569 570**System API** 571 572This is a system API. 573 574**Parameters** 575 576| Name | Type | Mandatory| Description | 577| ---------- | ------ | ---- | ------------------------------------- | 578| bundleName | string | Yes | Bundle name.| 579 580**Return value** 581 582| Type | Description | 583| ------------- | ------------------------------------ | 584| Promise\<void> | Promise that returns no value.| 585 586**Example** 587 588```ts 589import bundle from '@ohos.bundle'; 590import { BusinessError } from '@ohos.base'; 591 592let bundleName: string = "com.example.myapplication"; 593 594bundle.cleanBundleCacheFiles(bundleName).then(()=> { 595 console.info('cleanBundleCacheFiles successfully.'); 596}).catch((error: BusinessError) => { 597 console.error('cleanBundleCacheFiles failed.'); 598}); 599``` 600 601## bundle.setApplicationEnabled<sup>8+</sup> <sup>deprecated<sup> 602 603> This API is deprecated since API version 9. You are advised to use [bundleManager.setApplicationEnabled](js-apis-bundleManager.md#bundlemanagersetapplicationenabled) instead. 604 605setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback<void>): void 606 607Sets whether to enable an application. This API uses an asynchronous callback to return the result. 608 609**Required permissions** 610 611ohos.permission.CHANGE_ABILITY_ENABLED_STATE 612 613**System capability** 614 615SystemCapability.BundleManager.BundleFramework 616 617**System API** 618 619This is a system API. 620 621**Parameters** 622 623| Name | Type | Mandatory| Description | 624| ---------- | ------------------- | ---- |--------------------------------| 625| bundleName | string | Yes | Bundle name. | 626| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.| 627| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | 628 629**Example** 630 631```ts 632import bundle from '@ohos.bundle'; 633 634let bundleName: string = "com.example.myapplication"; 635 636bundle.setApplicationEnabled(bundleName, false, err => { 637 if (err) { 638 console.error('setApplicationEnabled failed.'); 639 } else { 640 console.info('setApplicationEnabled successfully.'); 641 } 642}); 643``` 644 645## bundle.setApplicationEnabled<sup>8+</sup> <sup>deprecated<sup> 646 647> This API is deprecated since API version 9. You are advised to use [bundleManager.setApplicationEnabled](js-apis-bundleManager.md#bundlemanagersetapplicationenabled) instead. 648 649setApplicationEnabled(bundleName: string, isEnable: boolean): Promise<void> 650 651Sets whether to enable an application. This API uses a promise to return the result. 652 653**Required permissions** 654 655ohos.permission.CHANGE_ABILITY_ENABLED_STATE 656 657**System capability** 658 659SystemCapability.BundleManager.BundleFramework 660 661**System API** 662 663This is a system API. 664 665**Parameters** 666 667| Name | Type | Mandatory| Description | 668| ---------- | ------- | ---- | ----------------------------------------------- | 669| bundleName | string | Yes | Bundle name. | 670| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.| 671 672**Return value** 673 674| Type | Description | 675| ------------- | ------------------------------------ | 676| Promise\<void> | Promise that returns no value.| 677 678**Example** 679 680```ts 681import bundle from '@ohos.bundle'; 682import { BusinessError } from '@ohos.base'; 683 684let bundleName: string = "com.example.myapplication"; 685 686bundle.setApplicationEnabled(bundleName, false).then(()=> { 687 console.info('setApplicationEnabled successfully.'); 688}).catch((error: BusinessError) => { 689 console.error('setApplicationEnabled failed.'); 690}); 691``` 692 693## bundle.setAbilityEnabled<sup>8+</sup> <sup>deprecated<sup> 694 695> This API is deprecated since API version 9. You are advised to use [bundleManager.setAbilityEnabled](js-apis-bundleManager.md#bundlemanagersetabilityenabled) instead. 696 697setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback<void>): void 698 699Sets whether to enable an ability. This API uses an asynchronous callback to return the result. 700 701**Required permissions** 702 703ohos.permission.CHANGE_ABILITY_ENABLED_STATE 704 705**System capability** 706 707SystemCapability.BundleManager.BundleFramework 708 709**System API** 710 711This is a system API. 712 713**Parameters** 714 715| Name | Type | Mandatory| Description | 716| -------- | -------------------------------------------- | ---- | ----------------------------------------------- | 717| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. | 718| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.| 719| callback | AsyncCallback\<void> | Yes | Callback used to return the result. | 720 721## bundle.setAbilityEnabled<sup>8+</sup> <sup>deprecated<sup> 722 723> This API is deprecated since API version 9. You are advised to use [bundleManager.setAbilityEnabled](js-apis-bundleManager.md#bundlemanagersetabilityenabled) instead. 724 725setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise<void> 726 727Sets whether to enable an ability. This API uses a promise to return the result. 728 729**Required permissions** 730 731ohos.permission.CHANGE_ABILITY_ENABLED_STATE 732 733**System capability** 734 735SystemCapability.BundleManager.BundleFramework 736 737**System API** 738 739This is a system API. 740 741**Parameters** 742 743| Name | Type | Mandatory| Description | 744| -------- | -------------------------------------------- | ---- | ----------------------------------------------- | 745| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. | 746| isEnable | boolean | Yes | Whether to enable the application. The value **true** means to enable the application, and **false** means the opposite.| 747 748**Return value** 749 750| Type | Description | 751| ------------- | ------------------------------------ | 752| Promise\<void> | Promise that returns no value.| 753 754**Example** 755 756```ts 757import bundle from '@ohos.bundle'; 758import { BusinessError } from '@ohos.base'; 759 760let bundleName: string = "com.example.myapplication"; 761let abilityName: string = "EntryAbility"; 762 763bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo) => { 764 console.info('getAbilityInfo successfully. Data: ' + JSON.stringify(abilityInfo)); 765 766 bundle.setAbilityEnabled(abilityInfo, false).then(data => { 767 console.info('setAbilityEnabled successfully.'); 768 }).catch((error: BusinessError) => { 769 console.error('setAbilityEnabled failed:' + JSON.stringify(error)); 770 }) 771}).catch((error: BusinessError) => { 772 console.error('getAbilityInfo failed. Cause: ' + JSON.stringify(error)); 773}); 774``` 775## bundle.getPermissionDef<sup>8+</sup> <sup>deprecated<sup> 776 777> This API is deprecated since API version 9. You are advised to use [bundleManager.getPermissionDef](js-apis-bundleManager.md#bundlemanagergetpermissiondef) instead. 778 779getPermissionDef(permissionName: string, callback: AsyncCallback<PermissionDef>): void 780 781Obtains the permission details by permission name. This API uses an asynchronous callback to return the result. 782 783**Required permissions** 784 785ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 786 787**System capability** 788 789SystemCapability.BundleManager.BundleFramework 790 791**System API** 792 793This is a system API. 794 795**Parameters** 796 797| Name | Type | Mandatory| Description | 798| -------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------ | 799| permissionName | string | Yes | Name of the permission. | 800| callback | AsyncCallback<[PermissionDef](js-apis-bundle-PermissionDef.md)> | Yes | Callback used to return the permission details.| 801 802**Example** 803 804```ts 805import bundle from '@ohos.bundle'; 806 807let permission: string = "ohos.permission.GET_BUNDLE_INFO"; 808bundle.getPermissionDef(permission, (err, data) => { 809 if (err) { 810 console.error('getPermissionDef failed:' + err.message); 811 } else { 812 console.info('getPermissionDef successfully:' + JSON.stringify(data)); 813 } 814}); 815``` 816 817## bundle.getPermissionDef<sup>8+</sup> <sup>deprecated<sup> 818 819> This API is deprecated since API version 9. You are advised to use [bundleManager.getPermissionDef](js-apis-bundleManager.md#bundlemanagergetpermissiondef) instead. 820 821getPermissionDef(permissionName: string): Promise<PermissionDef> 822 823Obtains the permission details by permission name. This API uses a promise to return the result. 824 825**Required permissions** 826 827ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 828 829**System capability** 830 831SystemCapability.BundleManager.BundleFramework 832 833**System API** 834 835This is a system API. 836 837**Parameters** 838 839| Name | Type | Mandatory| Description | 840| -------------- | ------ | ---- | ---------------- | 841| permissionName | string | Yes | Name of the permission.| 842 843**Return value** 844 845| Type | Description | 846| ------------------------------------------------------ | ------------------------------------------------------ | 847| Promise<[PermissionDef](js-apis-bundle-PermissionDef.md)> | Promise used to return the permission details.| 848 849**Example** 850 851```ts 852import bundle from '@ohos.bundle'; 853import { BusinessError } from '@ohos.base'; 854 855let permissionName: string = "ohos.permission.GET_BUNDLE_INFO"; 856bundle.getPermissionDef(permissionName).then((data) => { 857 console.info('getPermissionDef successfully. Data: ' + JSON.stringify(data)); 858}).catch((error: BusinessError) => { 859 console.error('getPermissionDef failed. Cause: ' + error.message); 860}); 861``` 862 863## bundle.getAllApplicationInfo<sup>deprecated<sup> 864 865> This API is deprecated since API version 9. 866 867getAllApplicationInfo(bundleFlags: number, userId?: number): Promise\<Array\<ApplicationInfo\>\> 868 869Obtains the information about all applications of the specified user. This API uses a promise to return the result. 870 871**Required permissions** 872 873ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 874 875**System capability** 876 877SystemCapability.BundleManager.BundleFramework 878 879**Parameters** 880 881| Name | Type | Mandatory| Description | 882| ----------- | ------ | ---- | ------------------------------------------------------------ | 883| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| 884| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 885 886**Return value** 887 888| Type | Description | 889| -------------------------------- | ------------------------------- | 890| Promise<Array\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)>> | Promise used to return the application information.| 891 892**Example** 893 894```ts 895import bundle from '@ohos.bundle'; 896import { BusinessError } from '@ohos.base'; 897 898let bundleFlags: number = 8; 899let userId: number = 100; 900bundle.getAllApplicationInfo(bundleFlags, userId) 901.then((data) => { 902 console.info('Operation successful. Data: ' + JSON.stringify(data)); 903}).catch((error: BusinessError) => { 904 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 905}) 906``` 907 908## bundle.getAllApplicationInfo<sup>deprecated<sup> 909 910> This API is deprecated since API version 9. 911 912getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback\<Array\<ApplicationInfo\>\>): void 913 914Obtains the information about all applications. This API uses an asynchronous callback to return the result. 915 916**Required permissions** 917 918ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 919 920**System capability** 921 922SystemCapability.BundleManager.BundleFramework 923 924**Parameters** 925 926| Name | Type | Mandatory| Description | 927| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 928| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| 929| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 930| callback | AsyncCallback<Array\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)>> | Yes | Callback used to return the application information. | 931 932**Example** 933 934```ts 935import bundle from '@ohos.bundle'; 936 937let bundleFlags: number = bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION; 938let userId: number = 100; 939bundle.getAllApplicationInfo(bundleFlags, userId, (err, data) => { 940 if (err) { 941 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 942 return; 943 } 944 console.info('Operation successful. Data:' + JSON.stringify(data)); 945}) 946``` 947 948 949## bundle.getAllApplicationInfo<sup>deprecated<sup> 950 951> This API is deprecated since API version 9. 952 953getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback\<Array\<ApplicationInfo\>\>): void 954 955Obtains the information about all applications of the current user. This API uses an asynchronous callback to return the result. 956 957**Required permissions** 958 959ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 960 961**System capability** 962 963SystemCapability.BundleManager.BundleFramework 964 965**Parameters** 966 967| Name | Type | Mandatory| Description | 968| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 969| bundleFlags | number | Yes | Type of information that will be returned. For details about the available enumerated values, see the application information flags in [BundleFlag](#bundleflagdeprecated).| 970| callback | AsyncCallback<Array\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)>> | Yes | Callback used to return the application information. | 971 972**Example** 973 974```ts 975import bundle from '@ohos.bundle'; 976 977let bundleFlags: number = bundle.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION; 978bundle.getAllApplicationInfo(bundleFlags, (err, data) => { 979 if (err) { 980 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 981 return; 982 } 983 console.info('Operation successful. Data:' + JSON.stringify(data)); 984}) 985``` 986 987## bundle.getBundleArchiveInfo<sup>deprecated<sup> 988 989> This API is deprecated since API version 9. 990 991getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise\<BundleInfo> 992 993Obtains information about the bundles contained in a HAP file. This API uses a promise to return the result. 994 995**System capability** 996 997SystemCapability.BundleManager.BundleFramework 998 999**Parameters** 1000 1001| Name | Type | Mandatory | Description | 1002| ---------- | ------ | ---- | ------------ | 1003| hapFilePath | string | Yes | Path where the HAP file is stored. The absolute path of the application and the data directory sandbox path are supported.| 1004| bundleFlags | number | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 1005 1006**Return value** 1007| Type | Description | 1008| ---------------------------------------------------- | ------------------------------------------------------------ | 1009| Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the information about the bundles.| 1010 1011**Example** 1012 1013```ts 1014import bundle from '@ohos.bundle'; 1015import { BusinessError } from '@ohos.base'; 1016 1017let hapFilePath: string = "/data/storage/el2/base/test.hap"; 1018let bundleFlags: number = 0; 1019bundle.getBundleArchiveInfo(hapFilePath, bundleFlags) 1020.then((data) => { 1021 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1022}).catch((error: BusinessError) => { 1023 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1024}) 1025``` 1026 1027## bundle.getBundleArchiveInfo<sup>deprecated<sup> 1028 1029> This API is deprecated since API version 9. 1030 1031getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback\<BundleInfo>) : void 1032 1033Obtains information about the bundles contained in a HAP file. This API uses an asynchronous callback to return the result. 1034 1035**System capability** 1036 1037SystemCapability.BundleManager.BundleFramework 1038 1039**Parameters** 1040 1041| Name | Type | Mandatory | Description | 1042| ---------- | ------ | ---- | ------------ | 1043| hapFilePath | string | Yes | Path where the HAP file is stored. The absolute path of the application and the data directory sandbox path are supported.| 1044| bundleFlags | number | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. For details about the available enumerated values, see the bundle information flags in [BundleFlag](#bundleflagdeprecated).| 1045| callback| AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the information about the bundles.| 1046 1047**Example** 1048 1049```ts 1050import bundle from '@ohos.bundle'; 1051 1052let hapFilePath: string = "/data/storage/el2/base/test.hap"; 1053let bundleFlags: number = 0; 1054bundle.getBundleArchiveInfo(hapFilePath, bundleFlags, (err, data) => { 1055 if (err) { 1056 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1057 return; 1058 } 1059 console.info('Operation successful. Data:' + JSON.stringify(data)); 1060}) 1061``` 1062 1063## bundle.getAbilityInfo<sup>deprecated<sup> 1064 1065> This API is deprecated since API version 9. 1066 1067getAbilityInfo(bundleName: string, abilityName: string): Promise\<AbilityInfo> 1068 1069Obtains the ability information based on a given bundle name and ability name. This API uses a promise to return the result. 1070 1071No permission is required for obtaining the caller's own information. 1072 1073**Required permissions** 1074 1075ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1076 1077**System capability** 1078 1079SystemCapability.BundleManager.BundleFramework 1080 1081**Parameters** 1082 1083| Name | Type | Mandatory | Description | 1084| ----------- | ------ | ---- |------------| 1085| bundleName | string | Yes | Bundle name.| 1086| abilityName | string | Yes | Ability name.| 1087 1088**Return value** 1089 1090| Type | Description | 1091| --------------------- | --------------------- | 1092| Promise\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Promise used to return the ability information.| 1093 1094**Example** 1095 1096```ts 1097import bundle from '@ohos.bundle'; 1098import { BusinessError } from '@ohos.base'; 1099 1100let bundleName: string = "com.example.myapplication"; 1101let abilityName: string = "EntryAbility"; 1102bundle.getAbilityInfo(bundleName, abilityName) 1103.then((data) => { 1104 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1105}).catch((error: BusinessError) => { 1106 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1107}) 1108``` 1109 1110## bundle.getAbilityInfo<sup>deprecated<sup> 1111 1112> This API is deprecated since API version 9. 1113 1114getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback\<AbilityInfo>): void 1115 1116Obtains the ability information based on a given bundle name and ability name. This API uses an asynchronous callback to return the result. 1117 1118No permission is required for obtaining the caller's own information. 1119 1120**Required permissions** 1121 1122ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1123 1124**System capability** 1125 1126SystemCapability.BundleManager.BundleFramework 1127 1128**Parameters** 1129 1130| Name | Type | Mandatory | Description | 1131| ----------- | ------------ | ---- |----------------------------| 1132| bundleName | string | Yes | Bundle name. | 1133| abilityName | string | Yes | Ability name. | 1134| callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.| 1135 1136**Example** 1137 1138```ts 1139import bundle from '@ohos.bundle'; 1140 1141let bundleName: string = "com.example.myapplication"; 1142let abilityName: string = "EntryAbility"; 1143bundle.getAbilityInfo(bundleName, abilityName, (err, data) => { 1144 if (err) { 1145 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1146 return; 1147 } 1148 console.info('Operation successful. Data:' + JSON.stringify(data)); 1149}) 1150``` 1151 1152## bundle.getAbilityLabel<sup>8+</sup> <sup>deprecated<sup> 1153 1154> This API is deprecated since API version 9. 1155 1156getAbilityLabel(bundleName: string, abilityName: string): Promise\<string> 1157 1158Obtains the application name based on a given bundle name and ability name. This API uses a promise to return the result. 1159 1160No permission is required for obtaining the caller's own information. 1161 1162**Required permissions** 1163 1164ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1165 1166**System capability** 1167 1168SystemCapability.BundleManager.BundleFramework 1169 1170**Parameters** 1171 1172| Name | Type | Mandatory| Description | 1173| ----------- | ------ | ---- | ---------------- | 1174| bundleName | string | Yes | Bundle name.| 1175| abilityName | string | Yes | Ability name. | 1176 1177**Return value** 1178 1179| Type | Description | 1180| ---------------- | ------------------ | 1181| Promise\<string> | Promise used to return the application name.| 1182 1183**Example** 1184 1185```ts 1186import bundle from '@ohos.bundle'; 1187import { BusinessError } from '@ohos.base'; 1188 1189let bundleName: string = "com.example.myapplication"; 1190let abilityName: string = "EntryAbility"; 1191bundle.getAbilityLabel(bundleName, abilityName) 1192.then((data) => { 1193 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1194}).catch((error: BusinessError) => { 1195 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1196}) 1197``` 1198 1199## bundle.getAbilityLabel<sup>8+</sup> <sup>deprecated<sup> 1200 1201> This API is deprecated since API version 9. 1202 1203getAbilityLabel(bundleName: string, abilityName: string, callback : AsyncCallback\<string>): void 1204 1205Obtains the application name based on a given bundle name and ability name. This API uses an asynchronous callback to return the result. 1206 1207No permission is required for obtaining the caller's own information. 1208 1209**Required permissions** 1210 1211ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1212 1213**System capability** 1214 1215SystemCapability.BundleManager.BundleFramework 1216 1217**Parameters** 1218 1219| Name | Type | Mandatory| Description | 1220| ----------- | ---------------------- | ---- | ---------------------------------------------- | 1221| bundleName | string | Yes | Bundle name. | 1222| abilityName | string | Yes | Ability name. | 1223| callback | AsyncCallback\<string> | Yes | Callback used to return the application name.| 1224 1225**Example** 1226 1227```ts 1228import bundle from '@ohos.bundle'; 1229 1230let bundleName: string = "com.example.myapplication"; 1231let abilityName: string = "EntryAbility"; 1232bundle.getAbilityLabel(bundleName, abilityName, (err, data) => { 1233 if (err) { 1234 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1235 return; 1236 } 1237 console.info('Operation successful. Data:' + JSON.stringify(data)); 1238}) 1239``` 1240 1241## bundle.isAbilityEnabled<sup>8+</sup> <sup>deprecated<sup> 1242 1243> This API is deprecated since API version 9. 1244 1245isAbilityEnabled(info: AbilityInfo): Promise\<boolean> 1246 1247Checks whether the ability that matches a given **AbilityInfo** object is enabled. This API uses a promise to return the result. 1248 1249**System capability** 1250 1251SystemCapability.BundleManager.BundleFramework 1252 1253**Parameters** 1254 1255| Name| Type | Mandatory| Description | 1256| ------ | -------------------------------------------- | ---- | ----------------- | 1257| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information.| 1258 1259**Return value** 1260 1261| Type | Description | 1262| ----------------- | ------------------------- | 1263| Promise\<boolean> | Promise used to return the result. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.| 1264 1265**Example** 1266 1267```ts 1268import bundle from '@ohos.bundle'; 1269import { BusinessError } from '@ohos.base'; 1270 1271let bundleName: string = "com.example.myapplication"; 1272let abilityName: string = "EntryAbility"; 1273bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ 1274 bundle.isAbilityEnabled(abilityInfo).then((data) => { 1275 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1276 }).catch((error: BusinessError) => { 1277 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1278 }) 1279}) 1280``` 1281 1282## bundle.isAbilityEnabled<sup>8+</sup> <sup>deprecated<sup> 1283 1284> This API is deprecated since API version 9. 1285 1286isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\<boolean>): void 1287 1288Checks whether the ability that matches a given **AbilityInfo** object is enabled. This API uses an asynchronous callback to return the result. 1289 1290**System capability** 1291 1292SystemCapability.BundleManager.BundleFramework 1293 1294**Parameters** 1295 1296| Name | Type | Mandatory| Description | 1297| -------- | -------------------------------------------- | ---- | ----------------------- | 1298| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. | 1299| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.| 1300 1301**Example** 1302 1303```ts 1304import bundle from '@ohos.bundle'; 1305 1306let bundleName: string = "com.example.myapplication"; 1307let abilityName: string = "EntryAbility"; 1308bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ 1309 bundle.isAbilityEnabled(abilityInfo, (err, data) => { 1310 if (err) { 1311 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1312 return; 1313 } 1314 console.info('Operation successful. Data:' + JSON.stringify(data)); 1315 }) 1316}) 1317``` 1318 1319## bundle.isApplicationEnabled<sup>8+</sup> <sup>deprecated<sup> 1320 1321> This API is deprecated since API version 9. 1322 1323isApplicationEnabled(bundleName: string): Promise\<boolean> 1324 1325Checks whether an application is enabled based on a given bundle name. This API uses a promise to return the result. 1326 1327**System capability** 1328 1329SystemCapability.BundleManager.BundleFramework 1330 1331**Parameters** 1332 1333| Name | Type | Mandatory| Description | 1334| ---------- | ------ | ---- | ------------------------ | 1335| bundleName | string | Yes | Bundle name.| 1336 1337**Return value** 1338 1339| Type | Description | 1340| ----------------- | ------------------------- | 1341| Promise\<boolean> | Promise used to return the result. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.| 1342 1343**Example** 1344 1345```ts 1346import bundle from '@ohos.bundle'; 1347import { BusinessError } from '@ohos.base'; 1348 1349let bundleName: string = "com.example.myapplication"; 1350bundle.isApplicationEnabled(bundleName) 1351.then((data) => { 1352 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1353}).catch((error: BusinessError) => { 1354 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1355}) 1356``` 1357 1358## bundle.isApplicationEnabled<sup>8+</sup> <sup>deprecated<sup> 1359 1360> This API is deprecated since API version 9. 1361 1362isApplicationEnabled(bundleName: string, callback : AsyncCallback\<boolean>): void 1363 1364Checks whether an application is enabled based on a given bundle name. This API uses an asynchronous callback to return the result. 1365 1366**System capability** 1367 1368SystemCapability.BundleManager.BundleFramework 1369 1370**Parameters** 1371 1372| Name | Type | Mandatory| Description | 1373| ---------- | ----------------------- | ---- | ------------------------ | 1374| bundleName | string | Yes | Bundle name.| 1375| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the application is enabled, **true** will be returned; otherwise, **false** will be returned.| 1376 1377**Example** 1378 1379```ts 1380import bundle from '@ohos.bundle'; 1381 1382let bundleName: string = "com.example.myapplication"; 1383bundle.isApplicationEnabled(bundleName, (err, data) => { 1384 if (err) { 1385 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1386 return; 1387 } 1388 console.info('Operation successful. Data:' + JSON.stringify(data)); 1389}) 1390``` 1391 1392## bundle.queryAbilityByWant<sup>deprecated<sup> 1393 1394> This API is deprecated since API version 9. 1395 1396queryAbilityByWant(want: Want, bundleFlags: number, userId?: number): Promise\<Array\<AbilityInfo\>\> 1397 1398Obtains the ability information based on given Want. This API uses a promise to return the result. 1399 1400No permission is required for obtaining the caller's own information. 1401 1402**Required permissions** 1403 1404ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1405 1406**System capability** 1407 1408SystemCapability.BundleManager.BundleFramework 1409 1410**Parameters** 1411 1412| Name | Type | Mandatory | Description | 1413| ----------- | ------ | ---- | ------------------------------------- | 1414| want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. | 1415| bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).| 1416| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | 1417 1418**Return value** 1419 1420| Type | Description | 1421| ---------------------------- | --------------------- | 1422| Promise<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Promise used to return the ability information.| 1423 1424**Example** 1425 1426```ts 1427import bundle from '@ohos.bundle'; 1428import { BusinessError } from '@ohos.base'; 1429import Want from '@ohos.app.ability.Want'; 1430 1431let bundleFlags: number = 0; 1432let userId: number = 100; 1433let want: Want = { 1434 bundleName : "com.example.myapplication", 1435 abilityName : "EntryAbility" 1436}; 1437bundle.queryAbilityByWant(want, bundleFlags, userId) 1438.then((data) => { 1439 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1440}).catch((error: BusinessError) => { 1441 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1442}) 1443``` 1444 1445 1446 1447## bundle.queryAbilityByWant<sup>deprecated<sup> 1448 1449> This API is deprecated since API version 9. 1450 1451queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback\<Array\<AbilityInfo\>\>): void 1452 1453Obtains the ability information of the specified user based on given Want. This API uses an asynchronous callback to return the result. 1454 1455No permission is required for obtaining the caller's own information. 1456 1457**Required permissions** 1458 1459ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1460 1461**System capability** 1462 1463SystemCapability.BundleManager.BundleFramework 1464 1465**Parameters** 1466 1467| Name | Type | Mandatory| Description | 1468| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 1469| want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. | 1470| bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).| 1471| userId | number | Yes | User ID. The value must be greater than or equal to 0. | 1472| callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. | 1473 1474**Example** 1475 1476```ts 1477import bundle from '@ohos.bundle'; 1478import Want from '@ohos.app.ability.Want'; 1479 1480let bundleFlags: number = 0; 1481let userId: number = 100; 1482let want: Want = { 1483 bundleName : "com.example.myapplication", 1484 abilityName : "EntryAbility" 1485}; 1486bundle.queryAbilityByWant(want, bundleFlags, userId, (err, data) => { 1487 if (err) { 1488 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1489 return; 1490 } 1491 console.info('Operation successful. Data:' + JSON.stringify(data)); 1492}) 1493``` 1494 1495## bundle.queryAbilityByWant<sup>deprecated<sup> 1496 1497> This API is deprecated since API version 9. 1498 1499queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback\<Array\<AbilityInfo\>\>): void 1500 1501Obtains the ability information based on given Want. This API uses an asynchronous callback to return the result. 1502 1503No permission is required for obtaining the caller's own information. 1504 1505**Required permissions** 1506 1507ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1508 1509**System capability** 1510 1511SystemCapability.BundleManager.BundleFramework 1512 1513**Parameters** 1514 1515| Name | Type | Mandatory| Description | 1516| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 1517| want | [Want](js-apis-application-want.md) | Yes | Want containing the bundle name. | 1518| bundleFlags | number | Yes | Ability information to be returned. For details about the available enumerated values, see the ability information flags in [BundleFlag](#bundleflagdeprecated).| 1519| callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. | 1520 1521**Example** 1522 1523```ts 1524import bundle from '@ohos.bundle'; 1525import Want from '@ohos.app.ability.Want'; 1526 1527let bundleFlags: number = 0; 1528let want: Want = { 1529 bundleName : "com.example.myapplication", 1530 abilityName : "EntryAbility" 1531}; 1532bundle.queryAbilityByWant(want, bundleFlags, (err, data) => { 1533 if (err) { 1534 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1535 return; 1536 } 1537 console.info('Operation successful. Data:' + JSON.stringify(data)); 1538}) 1539``` 1540 1541 1542 1543## bundle.getLaunchWantForBundle<sup>deprecated<sup> 1544 1545> This API is deprecated since API version 9. 1546 1547getLaunchWantForBundle(bundleName: string): Promise\<Want> 1548 1549Obtains the **Want** object that launches the specified application. This API uses a promise to return the result. 1550 1551**Required permissions** 1552 1553ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1554 1555**System capability** 1556 1557SystemCapability.BundleManager.BundleFramework 1558 1559**Parameters** 1560 1561| Name | Type | Mandatory| Description | 1562| ---------- | ------ | ---- | ------------------------ | 1563| bundleName | string | Yes | Bundle name.| 1564 1565**Return value** 1566| Type | Description | 1567| -------------- | -------------------------------------- | 1568| Promise\<[Want](js-apis-application-want.md)> | Promise used to return the **Want** object.| 1569 1570**Example** 1571 1572```ts 1573import bundle from '@ohos.bundle'; 1574import { BusinessError } from '@ohos.base'; 1575 1576let bundleName: string = "com.example.myapplication"; 1577bundle.getLaunchWantForBundle(bundleName) 1578.then((data) => { 1579 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1580}).catch((error: BusinessError) => { 1581 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1582}) 1583``` 1584 1585## bundle.getLaunchWantForBundle<sup>deprecated<sup> 1586 1587> This API is deprecated since API version 9. 1588 1589getLaunchWantForBundle(bundleName: string, callback: AsyncCallback\<Want>): void 1590 1591Obtains the **Want** object that launches the specified application. This API uses an asynchronous callback to return the result. 1592 1593**Required permissions** 1594 1595ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 1596 1597**System capability** 1598 1599SystemCapability.BundleManager.BundleFramework 1600 1601**Parameters** 1602 1603| Name | Type | Mandatory| Description | 1604| ---------- | --------------------------------------------------- | ---- | -------------------------------------------------------- | 1605| bundleName | string | Yes | Bundle name. | 1606| callback | AsyncCallback\<[Want](js-apis-application-want.md)> | Yes | Callback used to return the **Want** object.| 1607 1608**Example** 1609 1610```ts 1611import bundle from '@ohos.bundle'; 1612 1613let bundleName: string = "com.example.myapplication"; 1614bundle.getLaunchWantForBundle(bundleName, (err, data) => { 1615 if (err) { 1616 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1617 return; 1618 } 1619 console.info('Operation successful. Data:' + JSON.stringify(data)); 1620}) 1621``` 1622 1623 1624## bundle.getNameForUid<sup>8+</sup> <sup>deprecated<sup> 1625 1626> This API is deprecated since API version 9. 1627 1628getNameForUid(uid: number): Promise\<string> 1629 1630Obtains the bundle name based on a UID. This API uses a promise to return the result. 1631 1632**System capability** 1633 1634SystemCapability.BundleManager.BundleFramework 1635 1636**Parameters** 1637 1638| Name| Type | Mandatory| Description | 1639| ------ | ------ | ---- | ------------- | 1640| uid | number | Yes | UID based on which the bundle name is to obtain.| 1641 1642**Return value** 1643| Type | Description | 1644| ---------------- | --------------------------------- | 1645| Promise\<string> | Promise used to return the bundle name.| 1646 1647**Example** 1648 1649```ts 1650import bundle from '@ohos.bundle'; 1651import { BusinessError } from '@ohos.base'; 1652 1653let uid: number = 20010005; 1654bundle.getNameForUid(uid) 1655.then((data) => { 1656 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1657}).catch((error: BusinessError) => { 1658 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1659}) 1660``` 1661 1662## bundle.getNameForUid<sup>8+</sup> <sup>deprecated<sup> 1663 1664> This API is deprecated since API version 9. 1665 1666getNameForUid(uid: number, callback: AsyncCallback\<string>) : void 1667 1668Obtains the bundle name based on a UID. This API uses an asynchronous callback to return the result. 1669 1670**System capability** 1671 1672SystemCapability.BundleManager.BundleFramework 1673 1674**Parameters** 1675 1676| Name | Type | Mandatory| Description | 1677| -------- | ---------------------- | ---- | ----------------------------------------------------- | 1678| uid | number | Yes | UID based on which the bundle name is to obtain. | 1679| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.| 1680 1681**Example** 1682 1683```ts 1684import bundle from '@ohos.bundle'; 1685 1686let uid: number = 20010005; 1687bundle.getNameForUid(uid, (err, data) => { 1688 if (err) { 1689 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1690 return; 1691 } 1692 console.info('Operation successful. Data:' + JSON.stringify(data)); 1693}) 1694``` 1695 1696 1697## bundle.getAbilityIcon<sup>8+</sup> <sup>deprecated<sup> 1698 1699> This API is deprecated since API version 9. You are advised to use [resourceManager.getMediaContent](js-apis-resource-manager.md#getmediacontent9) instead. 1700 1701getAbilityIcon(bundleName: string, abilityName: string): Promise\<image.PixelMap> 1702 1703Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result. 1704 1705No permission is required for obtaining the caller's own information. 1706 1707**Required permissions** 1708 1709ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1710 1711**System capability** 1712 1713SystemCapability.BundleManager.BundleFramework 1714 1715**Parameters** 1716 1717| Name | Type | Mandatory| Description | 1718| ----------- | ------ | ---- | ------------------------ | 1719| bundleName | string | Yes | Bundle name.| 1720| abilityName | string | Yes | Ability name. | 1721 1722**Return value** 1723| Type | Description | 1724| --------------------- | ------------------------------------------------------------ | 1725| Promise\<image.PixelMap> | Promise used to return the [pixel map](js-apis-image.md).| 1726 1727**Example** 1728 1729```ts 1730import bundle from '@ohos.bundle'; 1731import { BusinessError } from '@ohos.base'; 1732 1733let bundleName: string = "com.example.myapplication"; 1734let abilityName: string = "EntryAbility"; 1735bundle.getAbilityIcon(bundleName, abilityName) 1736.then((data) => { 1737 console.info('Operation successful. Data: ' + JSON.stringify(data)); 1738}).catch((error: BusinessError) => { 1739 console.error('Operation failed. Cause: ' + JSON.stringify(error)); 1740}) 1741``` 1742 1743## bundle.getAbilityIcon<sup>8+</sup> <sup>deprecated<sup> 1744 1745> This API is deprecated since API version 9. You are advised to use [resourceManager.getMediaContent](js-apis-resource-manager.md#getmediacontent9) instead. 1746 1747getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<image.PixelMap>): void 1748 1749Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result. 1750 1751No permission is required for obtaining the caller's own information. 1752 1753**Required permissions** 1754 1755ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO 1756 1757 1758**System capability** 1759 1760SystemCapability.BundleManager.BundleFramework 1761 1762**Parameters** 1763 1764| Name | Type | Mandatory | Description | 1765| ----------- | ---------------------------------------- | ---- |-------------------------------------------------| 1766| bundleName | string | Yes | Bundle name. | 1767| abilityName | string | Yes | Ability name. | 1768| callback | AsyncCallback\<image.PixelMap> | Yes | Callback used to return the [pixel map](js-apis-image.md).| 1769 1770**Example** 1771 1772```ts 1773import bundle from '@ohos.bundle'; 1774 1775let bundleName: string = "com.example.myapplication"; 1776let abilityName: string = "EntryAbility"; 1777bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { 1778 if (err) { 1779 console.error('Operation failed. Cause: ' + JSON.stringify(err)); 1780 return; 1781 } 1782 console.info('Operation successful. Data:' + JSON.stringify(data)); 1783}) 1784``` 1785 1786## InstallErrorCode<sup>deprecated<sup> 1787> This API is deprecated since API version 9. You are not advised using it anymore. 1788 1789 **System capability**: SystemCapability.BundleManager.BundleFramework 1790 1791| Name | Value | Description | 1792| ---------------------------------------------------- | ---- | ------------------------------------------------ | 1793| SUCCESS | 0 | Installation succeeded. | 1794| STATUS_INSTALL_FAILURE | 1 | Installation failed. (The application to be installed is not found.) | 1795| STATUS_INSTALL_FAILURE_ABORTED | 2 | Installation aborted. | 1796| STATUS_INSTALL_FAILURE_INVALID | 3 | Invalid installation parameter. | 1797| STATUS_INSTALL_FAILURE_CONFLICT | 4 | Installation conflict. (The basic information of the application to update is inconsistent with that of the existing application.) | 1798| STATUS_INSTALL_FAILURE_STORAGE | 5 | Failed to store the bundle information. | 1799| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | Installation incompatibility. (A downgrade occurs or the signature information is incorrect.)| 1800| STATUS_UNINSTALL_FAILURE | 7 | Uninstallation failed. (The application to be uninstalled is not found.) | 1801| STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | Uninstallation aborted. (This error code is not in use.) | 1802| STATUS_UNINSTALL_FAILURE_ABORTED | 9 | Uninstallation aborted. (Invalid parameters.) | 1803| STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | Uninstallation conflict. (Failed to uninstall a system application or end the application process.)| 1804| STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT | 0x0B | Installation failed. (Download timed out.) | 1805| STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED | 0x0C | Installation failed. (Download failed.) | 1806| STATUS_RECOVER_FAILURE_INVALID<sup>8+</sup> | 0x0D | Failed to restore the pre-installed application. | 1807| STATUS_ABILITY_NOT_FOUND | 0x40 | Ability not found. | 1808| STATUS_BMS_SERVICE_ERROR | 0x41 | BMS service error. | 1809| STATUS_FAILED_NO_SPACE_LEFT<sup>8+</sup> | 0x42 | Insufficient device space. | 1810| STATUS_GRANT_REQUEST_PERMISSIONS_FAILED<sup>8+</sup> | 0x43 | Application authorization failed. | 1811| STATUS_INSTALL_PERMISSION_DENIED<sup>8+</sup> | 0x44 | No installation permission. | 1812| STATUS_UNINSTALL_PERMISSION_DENIED<sup>8+</sup> | 0x45 | No uninstallation permission. | 1813 1814## BundleFlag<sup>deprecated<sup> 1815 1816> This API is deprecated since API version 9. You are advised to use [bundleManager.BundleFlag](js-apis-bundleManager.md#bundleflag) instead. 1817 1818Enumerates the bundle flags, which indicate the type of bundle information to obtain. 1819 1820If an API does not match the flag, the flag is ignored. For example, using **GET_ABILITY_INFO_WITH_PERMISSION** to obtain the application information does not affect the result. 1821 1822Flags can be used together. For example, you can use the combination of **GET_APPLICATION_INFO_WITH_PERMISSION** and **GET_APPLICATION_INFO_WITH_DISABLE** to obtain the result that contains both application permission information and disabled application information. 1823 1824 **System capability**: SystemCapability.BundleManager.BundleFramework 1825 1826| Name | Value | Description | 1827| ----------------------------------------------- | ---------- | ------------------------------- | 1828| GET_BUNDLE_DEFAULT | 0x00000000 | Obtains the default application information. | 1829| GET_BUNDLE_WITH_ABILITIES | 0x00000001 | Obtains the bundle information with the ability information. | 1830| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000002 | Obtains the ability information with the permission information. | 1831| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000004 | Obtains the ability information with the application information. | 1832| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | Obtains the application information with the permission information. | 1833| GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains the bundle information with the information about the required permissions. | 1834| GET_ABILITY_INFO_WITH_METADATA<sup>8+</sup> | 0x00000020 | Obtains the ability metadata information. | 1835| GET_APPLICATION_INFO_WITH_METADATA<sup>8+</sup> | 0x00000040 | Obtains the application metadata information. | 1836| GET_ABILITY_INFO_SYSTEMAPP_ONLY<sup>8+</sup> | 0x00000080 | Obtains the ability information of system applications.| 1837| GET_ABILITY_INFO_WITH_DISABLE<sup>8+</sup> | 0x00000100 | Obtains information about disabled abilities. | 1838| GET_APPLICATION_INFO_WITH_DISABLE<sup>8+</sup> | 0x00000200 | Obtains information about disabled applications. | 1839| GET_ALL_APPLICATION_INFO | 0xFFFF0000 | Obtains all application information. | 1840 1841## BundleOptions<sup>deprecated<sup> 1842> This API is deprecated since API version 9. You are not advised using it anymore. 1843 1844Options that contain the user ID. 1845 1846 **System capability**: SystemCapability.BundleManager.BundleFramework 1847 1848| Name | Type | Readable| Writable| Description | 1849| ------ | ------ | ---- | ---- | ----------------------------------------------------- | 1850| userId | number | Yes | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.| 1851 1852## AbilityType<sup>deprecated<sup> 1853 1854> This API is deprecated since API version 9. You are advised to use [bundleManager.AbilityType](js-apis-bundleManager.md#abilitytype) instead. 1855 1856Enumerates the ability types. 1857 1858 **System capability**: SystemCapability.BundleManager.BundleFramework 1859 1860| Name| Value| Description | 1861| ------- | ---- | --------------------------- | 1862| UNKNOWN | None | Unknown ability type. | 1863| PAGE | None | FA developed using the Page template to provide the capability of interacting with users. | 1864| SERVICE | None | PA developed using the Service template to provide the capability of running tasks in the background. | 1865| DATA | None | PA developed using the Data template to provide unified data access for external systems.| 1866 1867## DisplayOrientation<sup>deprecated<sup> 1868 1869> This API is deprecated since API version 9. You are advised to use [bundleManager.DisplayOrientation](js-apis-bundleManager.md#displayorientation) instead. 1870 1871Enumerates display orientations. 1872 1873 **System capability**: SystemCapability.BundleManager.BundleFramework 1874 1875| Name | Value | Description | 1876| ------------- | ---- | ------------------------ | 1877| UNSPECIFIED | None | Unspecified display orientation. | 1878| LANDSCAPE | None | Landscape orientation. | 1879| PORTRAIT | None | Portrait orientation. | 1880| FOLLOW_RECENT | None | Orientation same as that of the nearest ability in the stack.| 1881## LaunchMode<sup>deprecated<sup> 1882 1883> This API is deprecated since API version 9. You are advised to use [bundleManager.LaunchType](js-apis-bundleManager.md#launchtype) instead. 1884 1885Enumerates the ability launch modes. 1886 1887 **System capability**: SystemCapability.BundleManager.BundleFramework 1888 1889| Name | Value | Description | 1890| --------- | ---- | ------------------- | 1891| SINGLETON | 0 | The ability has only one instance.| 1892| STANDARD | 1 | The ability can have multiple instances. | 1893 1894## AbilitySubType<sup>deprecated<sup> 1895> This API is deprecated since API version 9. You are not advised using it anymore. 1896 1897Enumerates the ability subtypes. 1898 1899 **System capability**: SystemCapability.BundleManager.BundleFramework 1900 1901| Name | Value | Description | 1902| ----------- | ---- | ----------------------------- | 1903| UNSPECIFIED | 0 | Undefined ability subtype. | 1904| CA | 1 | Ability that has a UI.| 1905 1906## ColorMode<sup>deprecated<sup> 1907> This API is deprecated since API version 9. You are not advised using it anymore. 1908 1909Enumerates the color modes of applications and widgets. 1910 1911 **System capability**: SystemCapability.BundleManager.BundleFramework 1912 1913| Name | Value | Description | 1914| ---------- | ---- | -------- | 1915| AUTO_MODE | -1 | Automatic mode.| 1916| DARK_MODE | 0 | Dark mode.| 1917| LIGHT_MODE | 1 | Light mode.| 1918 1919 1920## GrantStatus<sup>deprecated<sup> 1921 1922> This API is deprecated since API version 9. You are advised to use [bundleManager.PermissionGrantState](js-apis-bundleManager.md#permissiongrantstate) instead. 1923 1924Enumerates the permission grant states. 1925 1926 **System capability**: SystemCapability.BundleManager.BundleFramework 1927 1928| Name | Value | Description | 1929| ------------------ | ---- | ------------ | 1930| PERMISSION_DENIED | -1 | Permission denied.| 1931| PERMISSION_GRANTED | 0 | Permission granted. | 1932 1933