openharmony 鸿蒙 js-apis-Bundle-InnerBundleManager-sys

2025-06-12 浏览 (1)

@ohos.bundle.innerBundleManager (innerBundleManager) (System API)

The innerBundleManager module provides APIs for the Home Screen application.

NOTE

The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.

This module is deprecated since API version 9. You are advised to use launcherBundleManager and bundleMonitor instead.

The APIs provided by this module are system APIs.

Modules to Import

import innerBundleManager from '@ohos.bundle.innerBundleManager';

System Capability

SystemCapability.BundleManager.BundleFramework

innerBundleManager.getLauncherAbilityInfos(deprecated)

getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void

Obtains an array of the launcher ability information based on a given bundle name. This API uses an asynchronous callback to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use launcherBundleManager.getLauncherAbilityInfo instead.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
bundleNamestringYesBundle name.
userIdnumberYesUser ID. The value must be greater than or equal to 0.
callbackAsyncCallback<Array<LauncherAbilityInfo>>YesCallback used to return an array of the launcher ability information.

innerBundleManager.getLauncherAbilityInfos(deprecated)

getLauncherAbilityInfos(bundleName: string, userId: number) : Promise<Array<LauncherAbilityInfo>>

Obtains an array of the launcher ability information based on a given bundle name. This API uses a promise to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use launcherBundleManager.getLauncherAbilityInfo instead.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
bundleNamestringYesBundle name.
userIdnumberYesUser ID. The value must be greater than or equal to 0.

Return value

TypeDescription
Promise<Array<LauncherAbilityInfo>>Promise used to return an array of the launcher ability information.

innerBundleManager.on(deprecated)

on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback<string>) : void

Registers a callback to receive bundle status changes. This API uses an asynchronous callback to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use bundleMonitor.on instead.

Required permissions

ohos.permission.LISTEN_BUNDLE_CHANGE

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
typestringYesEvent type. Only BundleStatusChange is supported.
bundleStatusCallbackBundleStatusCallbackYesCallback to register.
callbackAsyncCallback<string>YesCallback used to return a successful result or error information.

innerBundleManager.on(deprecated)

on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback) : Promise<string>

Registers a callback to receive bundle status changes. This API uses a promise to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use bundleMonitor.on instead.

Required permissions

ohos.permission.LISTEN_BUNDLE_CHANGE

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
typestringYesEvent type. Only BundleStatusChange is supported.
bundleStatusCallbackBundleStatusCallbackYesCallback to register.

Return value

TypeDescription
Promise<string>Promise used to return a successful result or error information.

innerBundleManager.off(deprecated)

off(type:"BundleStatusChange", callback: AsyncCallback<string>) : void

Deregisters the callback that receives bundle status changes. This API uses an asynchronous callback to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use bundleMonitor.off instead.

Required permissions

ohos.permission.LISTEN_BUNDLE_CHANGE

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
typestringYesEvent type. Only BundleStatusChange is supported.
callbackAsyncCallback<string>YesCallback used to return a successful result or error information.

innerBundleManager.off(deprecated)

off(type:"BundleStatusChange") : Promise<string>

Deregisters the callback that receives bundle status changes. This API uses a promise to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use bundleMonitor.off instead.

Required permissions

ohos.permission.LISTEN_BUNDLE_CHANGE

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
typestringYesEvent type. Only BundleStatusChange is supported.

Return value

TypeDescription
Promise<string>Promise used to return a successful result or error information.

innerBundleManager.getAllLauncherAbilityInfos(deprecated)

getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void

Obtains the information about all launcher abilities. This API uses an asynchronous callback to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use launcherBundleManager.getAllLauncherAbilityInfo instead.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
userIdnumberYesUser ID. The value must be greater than or equal to 0.
callbackAsyncCallback<Array<LauncherAbilityInfo>>YesCallback used to return an array of the launcher ability information.

innerBundleManager.getAllLauncherAbilityInfos(deprecated)

getAllLauncherAbilityInfos(userId: number) : Promise<Array<LauncherAbilityInfo>>

Obtains the information about all launcher abilities. This API uses a promise to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use launcherBundleManager.getAllLauncherAbilityInfo instead.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
userIdnumberYesUser ID. The value must be greater than or equal to 0.

Return value

TypeDescription
Promise<Array<LauncherAbilityInfo>>Promise used to return an array of the launcher ability information.

innerBundleManager.getShortcutInfos(deprecated)

getShortcutInfos(bundleName :string, callback: AsyncCallback<Array<ShortcutInfo>>) : void

Obtains an array of the shortcut information based on a given bundle name. This API uses an asynchronous callback to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use launcherBundleManager.getShortcutInfo instead.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
bundleNamestringYesBundle name.
callbackAsyncCallback<Array<ShortcutInfo>>YesCallback used to return an array of the shortcut information.

innerBundleManager.getShortcutInfos(deprecated)

getShortcutInfos(bundleName : string) : Promise<Array<ShortcutInfo>>

Obtains an array of the shortcut information based on a given bundle name. This API uses a promise to return the result.

NOTE

This API is deprecated since API version 9. You are advised to use launcherBundleManager.getShortcutInfo instead.

Required permissions

ohos.permission.GET_BUNDLE_INFO_PRIVILEGED

System capability

SystemCapability.BundleManager.BundleFramework

System API

This is a system API.

Parameters

NameTypeMandatoryDescription
bundleNamestringYesBundle name.

Return value

TypeDescription
Promise<Array<ShortcutInfo>>Promise used to return an array of the shortcut information.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙AbilityAccessControl

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_access_control.h

harmony 鸿蒙ability_base_common.h

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/HYfu9p