161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit AbilityKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport type { BundleStatusCallback as _BundleStatusCallback } from './bundle/bundleStatusCallback'; 2361847f8eSopenharmony_ciimport { LauncherAbilityInfo } from './bundle/launcherAbilityInfo'; 2461847f8eSopenharmony_ciimport { ShortcutInfo } from './bundle/shortcutInfo'; 2561847f8eSopenharmony_ci 2661847f8eSopenharmony_ci/** 2761847f8eSopenharmony_ci * inner bundle manager. 2861847f8eSopenharmony_ci * 2961847f8eSopenharmony_ci * @namespace innerBundleManager 3061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 3161847f8eSopenharmony_ci * @systemapi Hide this for inner system use 3261847f8eSopenharmony_ci * @since 8 3361847f8eSopenharmony_ci * @deprecated since 9 3461847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager 3561847f8eSopenharmony_ci */ 3661847f8eSopenharmony_cideclare namespace innerBundleManager { 3761847f8eSopenharmony_ci /** 3861847f8eSopenharmony_ci * Obtains based on a given bundleName and userId. 3961847f8eSopenharmony_ci * 4061847f8eSopenharmony_ci * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 4161847f8eSopenharmony_ci * @param { string } bundleName - Indicates the application bundle name to be queried. 4261847f8eSopenharmony_ci * @param { number } userId - Indicates the id for the user. 4361847f8eSopenharmony_ci * @param { AsyncCallback<Array<LauncherAbilityInfo>> } callback 4461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 4561847f8eSopenharmony_ci * @systemapi Hide this for inner system use 4661847f8eSopenharmony_ci * @since 8 4761847f8eSopenharmony_ci * @deprecated since 9 4861847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci function getLauncherAbilityInfos(bundleName: string, 5161847f8eSopenharmony_ci userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>): void; 5261847f8eSopenharmony_ci 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * Obtains based on a given bundleName and userId. 5561847f8eSopenharmony_ci * 5661847f8eSopenharmony_ci * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 5761847f8eSopenharmony_ci * @param { string } bundleName - Indicates the application bundle name to be queried. 5861847f8eSopenharmony_ci * @param { number } userId - Indicates the id for the user. 5961847f8eSopenharmony_ci * @returns { Promise<Array<LauncherAbilityInfo>> } Returns the LauncherAbilityInfo array. 6061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 6161847f8eSopenharmony_ci * @systemapi Hide this for inner system use 6261847f8eSopenharmony_ci * @since 8 6361847f8eSopenharmony_ci * @deprecated since 9 6461847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo 6561847f8eSopenharmony_ci */ 6661847f8eSopenharmony_ci function getLauncherAbilityInfos(bundleName: string, userId: number): Promise<Array<LauncherAbilityInfo>>; 6761847f8eSopenharmony_ci 6861847f8eSopenharmony_ci /** 6961847f8eSopenharmony_ci * Register Callback. 7061847f8eSopenharmony_ci * 7161847f8eSopenharmony_ci * @permission ohos.permission.LISTEN_BUNDLE_CHANGE 7261847f8eSopenharmony_ci * @param { 'BundleStatusChange' } type - Indicates the command should be implement. 7361847f8eSopenharmony_ci * @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register. 7461847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback 7561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 7661847f8eSopenharmony_ci * @systemapi Hide this for inner system use 7761847f8eSopenharmony_ci * @since 8 7861847f8eSopenharmony_ci * @deprecated since 9 7961847f8eSopenharmony_ci * @useinstead ohos.bundle.bundleMonitor#on 8061847f8eSopenharmony_ci */ 8161847f8eSopenharmony_ci function on(type: 'BundleStatusChange', 8261847f8eSopenharmony_ci bundleStatusCallback: BundleStatusCallback, callback: AsyncCallback<string>): void; 8361847f8eSopenharmony_ci 8461847f8eSopenharmony_ci /** 8561847f8eSopenharmony_ci * Register Callback. 8661847f8eSopenharmony_ci * 8761847f8eSopenharmony_ci * @permission ohos.permission.LISTEN_BUNDLE_CHANGE 8861847f8eSopenharmony_ci * @param { 'BundleStatusChange' } type - Indicates the command should be implement. 8961847f8eSopenharmony_ci * @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register. 9061847f8eSopenharmony_ci * @returns { Promise<string> } - Returns the result of register. 9161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 9261847f8eSopenharmony_ci * @systemapi Hide this for inner system use 9361847f8eSopenharmony_ci * @since 8 9461847f8eSopenharmony_ci * @deprecated since 9 9561847f8eSopenharmony_ci * @useinstead ohos.bundle.bundleMonitor#on 9661847f8eSopenharmony_ci */ 9761847f8eSopenharmony_ci function on(type: 'BundleStatusChange', bundleStatusCallback: BundleStatusCallback): Promise<string>; 9861847f8eSopenharmony_ci 9961847f8eSopenharmony_ci /** 10061847f8eSopenharmony_ci * UnRegister Callback. 10161847f8eSopenharmony_ci * 10261847f8eSopenharmony_ci * @permission ohos.permission.LISTEN_BUNDLE_CHANGE 10361847f8eSopenharmony_ci * @param { 'BundleStatusChange' } type - Indicates the command should be implement. 10461847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback 10561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 10661847f8eSopenharmony_ci * @systemapi Hide this for inner system use 10761847f8eSopenharmony_ci * @since 8 10861847f8eSopenharmony_ci * @deprecated since 9 10961847f8eSopenharmony_ci * @useinstead ohos.bundle.bundleMonitor#off 11061847f8eSopenharmony_ci */ 11161847f8eSopenharmony_ci function off(type: 'BundleStatusChange', callback: AsyncCallback<string>): void; 11261847f8eSopenharmony_ci 11361847f8eSopenharmony_ci /** 11461847f8eSopenharmony_ci * UnRegister Callback. 11561847f8eSopenharmony_ci * 11661847f8eSopenharmony_ci * @permission ohos.permission.LISTEN_BUNDLE_CHANGE 11761847f8eSopenharmony_ci * @param { 'BundleStatusChange' } type - Indicates the command should be implement. 11861847f8eSopenharmony_ci * @returns { Promise<string> } Returns the result of unregister. 11961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 12061847f8eSopenharmony_ci * @systemapi Hide this for inner system use 12161847f8eSopenharmony_ci * @since 8 12261847f8eSopenharmony_ci * @deprecated since 9 12361847f8eSopenharmony_ci * @useinstead ohos.bundle.bundleMonitor#off 12461847f8eSopenharmony_ci */ 12561847f8eSopenharmony_ci function off(type: 'BundleStatusChange'): Promise<string>; 12661847f8eSopenharmony_ci 12761847f8eSopenharmony_ci /** 12861847f8eSopenharmony_ci * Obtains based on a given userId. 12961847f8eSopenharmony_ci * 13061847f8eSopenharmony_ci * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 13161847f8eSopenharmony_ci * @param { number } userId - Indicates the id for the user. 13261847f8eSopenharmony_ci * @param { AsyncCallback<Array<LauncherAbilityInfo>> } callback 13361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 13461847f8eSopenharmony_ci * @systemapi Hide this for inner system use 13561847f8eSopenharmony_ci * @since 8 13661847f8eSopenharmony_ci * @deprecated since 9 13761847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos 13861847f8eSopenharmony_ci */ 13961847f8eSopenharmony_ci function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>): void; 14061847f8eSopenharmony_ci 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * Obtains based on a given userId. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 14561847f8eSopenharmony_ci * @param { number } userId - Indicates the id for the user. 14661847f8eSopenharmony_ci * @returns { Promise<Array<LauncherAbilityInfo>> } Returns the LauncherAbilityInfo array. 14761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 14861847f8eSopenharmony_ci * @systemapi Hide this for inner system use 14961847f8eSopenharmony_ci * @since 8 15061847f8eSopenharmony_ci * @deprecated since 9 15161847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos 15261847f8eSopenharmony_ci */ 15361847f8eSopenharmony_ci function getAllLauncherAbilityInfos(userId: number): Promise<Array<LauncherAbilityInfo>>; 15461847f8eSopenharmony_ci 15561847f8eSopenharmony_ci /** 15661847f8eSopenharmony_ci * Obtains based on a given bundleName. 15761847f8eSopenharmony_ci * 15861847f8eSopenharmony_ci * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 15961847f8eSopenharmony_ci * @param { string } bundleName - Indicates the application bundle name to be queried. 16061847f8eSopenharmony_ci * @param { AsyncCallback<Array<ShortcutInfo>> } callback 16161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 16261847f8eSopenharmony_ci * @systemapi Hide this for inner system use 16361847f8eSopenharmony_ci * @since 8 16461847f8eSopenharmony_ci * @deprecated since 9 16561847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo 16661847f8eSopenharmony_ci */ 16761847f8eSopenharmony_ci function getShortcutInfos(bundleName: string, callback: AsyncCallback<Array<ShortcutInfo>>): void; 16861847f8eSopenharmony_ci 16961847f8eSopenharmony_ci /** 17061847f8eSopenharmony_ci * Obtains based on a given bundleName. 17161847f8eSopenharmony_ci * 17261847f8eSopenharmony_ci * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 17361847f8eSopenharmony_ci * @param { string } bundleName - Indicates the application bundle name to be queried. 17461847f8eSopenharmony_ci * @returns { Promise<Array<ShortcutInfo>> } Returns the LauncherShortcutInfo array. 17561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 17661847f8eSopenharmony_ci * @systemapi Hide this for inner system use 17761847f8eSopenharmony_ci * @since 8 17861847f8eSopenharmony_ci * @deprecated since 9 17961847f8eSopenharmony_ci * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo 18061847f8eSopenharmony_ci */ 18161847f8eSopenharmony_ci function getShortcutInfos(bundleName: string): Promise<Array<ShortcutInfo>>; 18261847f8eSopenharmony_ci} 18361847f8eSopenharmony_ci 18461847f8eSopenharmony_ci/** 18561847f8eSopenharmony_ci * Contains basic Ability information, which uniquely identifies a launcher StatusCallback. 18661847f8eSopenharmony_ci * 18761847f8eSopenharmony_ci * @typedef { _BundleStatusCallback } 18861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.BundleFramework 18961847f8eSopenharmony_ci * @systemapi Hide this for inner system use 19061847f8eSopenharmony_ci * @since 8 19161847f8eSopenharmony_ci * @deprecated since 9 19261847f8eSopenharmony_ci */ 19361847f8eSopenharmony_ciexport type BundleStatusCallback = _BundleStatusCallback; 19461847f8eSopenharmony_ci 19561847f8eSopenharmony_ciexport default innerBundleManager; 196