1 /*
2  * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "bundle_manager_inner.h"
17 
18 #include "bundle_install_msg.h"
19 #include "bundlems_slite_client.h"
20 
21 extern "C" {
GetInstallState(const char * bundleName,InstallState * installState,uint8_t * installProcess)22 bool GetInstallState(const char *bundleName, InstallState *installState, uint8_t *installProcess)
23 {
24     return OHOS::BundleMsClient::GetInstance().GetInstallState(bundleName, installState, installProcess);
25 }
26 
GetBundleSize(const char * bundleName)27 uint32_t GetBundleSize(const char *bundleName)
28 {
29     return OHOS::BundleMsClient::GetInstance().GetBundleSize(bundleName);
30 }
31 
RegisterInstallerCallback(InstallerCallback installerCallback)32 bool RegisterInstallerCallback(InstallerCallback installerCallback)
33 {
34     return OHOS::BundleMsClient::GetInstance().RegisterInstallerCallback(installerCallback);
35 }
36 
UpdateBundleInfoList(void)37 void UpdateBundleInfoList(void)
38 {
39     OHOS::BundleMsClient::GetInstance().UpdateBundleInfoList();
40 }
41 
GetBundleInfosNoReplication(const int flags,BundleInfo ** bundleInfos,int32_t * len)42 uint8_t GetBundleInfosNoReplication(const int flags, BundleInfo **bundleInfos, int32_t *len)
43 {
44     return OHOS::BundleMsClient::GetInstance().GetBundleInfosNoReplication(flags, bundleInfos, len);
45 }
46 
QueryAbilityInfos(const Want * want,AbilityInfo ** abilityInfo,int32_t * len)47 uint8_t QueryAbilityInfos(const Want *want, AbilityInfo **abilityInfo, int32_t *len)
48 {
49     return OHOS::BundleMsClient::GetInstance().QueryAbilityInfos(want, abilityInfo, len);
50 }
51 
RegisterEvent(InstallerCallback installerCallback)52 bool RegisterEvent(InstallerCallback installerCallback)
53 {
54     return OHOS::BundleMsClient::GetInstance().RegisterEvent(installerCallback);
55 }
56 
UnregisterEvent(InstallerCallback installerCallback)57 bool UnregisterEvent(InstallerCallback installerCallback)
58 {
59     return OHOS::BundleMsClient::GetInstance().UnregisterEvent(installerCallback);
60 }
61 
InitPreAppInfo(void)62 PreAppList *InitPreAppInfo(void)
63 {
64     return OHOS::BundleMsClient::GetInstance().InitPreAppInfo();
65 }
66 
InsertPreAppInfo(const char * filePath,PreAppList * list)67 void InsertPreAppInfo(const char *filePath, PreAppList *list)
68 {
69     OHOS::BundleMsClient::GetInstance().InsertPreAppInfo(filePath, list);
70 }
71 
SetPreAppInfo(PreAppList * list)72 void SetPreAppInfo(PreAppList *list)
73 {
74     OHOS::BundleMsClient::GetInstance().SetPreAppInfo(list);
75 }
76 }
77