harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

  • 2022-10-28
  • 浏览 (890)

@ohos.bundle.innerBundleManager (innerBundleManager)

The innerBundleManager module provides APIs for the Home Screen application.

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.

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 the launcher ability information based on a given bundle name. This API uses an asynchronous callback to return the result. > 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

Name Type Mandatory Description
bundleName string Yes Bundle name.
userId number Yes User ID. The value must be greater than or equal to 0.
callback AsyncCallback<Array<LauncherAbilityInfo>> Yes Callback used to return an array of the launcher ability information.

innerBundleManager.getLauncherAbilityInfos(deprecated)

getLauncherAbilityInfos(bundleName: string, userId: number) : Promise&lt;Array&lt;LauncherAbilityInfo&gt;&gt;

Obtains the launcher ability information based on a given bundle name. This API uses a promise to return the result. > 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

Name Type Mandatory Description
bundleName string Yes Bundle name.
userId number Yes User ID. The value must be greater than or equal to 0.

Return value

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

innerBundleManager.on(deprecated)

on(type:“BundleStatusChange”, bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback&lt;string&gt;) : void;

Registers a callback to receive bundle status changes. This API uses an asynchronous callback to return the result. > 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

Name Type Mandatory Description
type string Yes Event type. Only BundleStatusChange is supported.
bundleStatusCallback BundleStatusCallback Yes Callback to register.
callback AsyncCallback<string> Yes Callback used to return a successful result or error information.

innerBundleManager.on(deprecated)

on(type:“BundleStatusChange”, bundleStatusCallback : BundleStatusCallback) : Promise&lt;string&gt;

Registers a callback to receive bundle status changes. This API uses a promise to return the result. > 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

Name Type Mandatory Description
type string Yes Event type. Only BundleStatusChange is supported.
bundleStatusCallback BundleStatusCallback Yes Callback to register.

Return value

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

innerBundleManager.off(deprecated)

off(type:“BundleStatusChange”, callback: AsyncCallback&lt;string&gt;) : void;

Deregisters the callback that receives bundle status changes. This API uses an asynchronous callback to return the result. > 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

Name Type Mandatory Description
type string Yes Event type. Only BundleStatusChange is supported.
callback AsyncCallback<string> Yes Callback used to return a successful result or error information.

innerBundleManager.off(deprecated)

off(type:“BundleStatusChange”) : Promise&lt;string&gt;

Deregisters the callback that receives bundle status changes. This API uses a promise to return the result. > 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

Name Type Mandatory Description
type string Yes Event type. Only BundleStatusChange is supported.

Return value

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

innerBundleManager.getAllLauncherAbilityInfos(deprecated)

getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback&lt;Array&lt;LauncherAbilityInfo&gt;&gt;) : void;

Obtains the information about all launcher abilities. This API uses an asynchronous callback to return the result. > 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

Name Type Mandatory Description
userId number Yes User ID. The value must be greater than or equal to 0.
callback AsyncCallback<Array<LauncherAbilityInfo>> Yes Callback used to return an array of the launcher ability information.

innerBundleManager.getAllLauncherAbilityInfos(deprecated)

getAllLauncherAbilityInfos(userId: number) : Promise&lt;Array&lt;LauncherAbilityInfo&gt;&gt;

Obtains the information about all launcher abilities. This API uses a promise to return the result. > 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

Name Type Mandatory Description
userId number Yes User ID. The value must be greater than or equal to 0.

Return value

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

innerBundleManager.getShortcutInfos(deprecated)

getShortcutInfos(bundleName :string, callback: AsyncCallback&lt;Array&lt;ShortcutInfo&gt;&gt;) : void;

Obtains the shortcut information based on a given bundle name. This API uses an asynchronous callback to return the result. > 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

Name Type Mandatory Description
bundleName string Yes Bundle name.
callback AsyncCallback<Array<ShortcutInfo>> Yes Callback used to return an array of the shortcut information.

innerBundleManager.getShortcutInfos(deprecated)

getShortcutInfos(bundleName : string) : Promise&lt;Array&lt;ShortcutInfo&gt;&gt;

Obtains the shortcut information based on a given bundle name. This API uses a promise to return the result. > 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

Name Type Mandatory Description
bundleName string Yes Bundle name.

Return value

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

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

harmony 鸿蒙@ohos.WallpaperExtensionAbility (WallpaperExtensionAbility)

0  赞