1 /*
2 * Copyright (c) 2021 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 #include "bundle_manager.h"
16 #include "bundlems_slite_client.h"
17 #include "want.h"
18
19 extern "C" {
Install(const char * hapPath,const InstallParam * installParam,InstallerCallback installerCallback)20 bool Install(const char *hapPath, const InstallParam *installParam, InstallerCallback installerCallback)
21 {
22 return OHOS::BundleMsClient::GetInstance().Install(hapPath, installParam, installerCallback);
23 }
24
Uninstall(const char * bundleName,const InstallParam * installParam,InstallerCallback installerCallback)25 bool Uninstall(const char *bundleName, const InstallParam *installParam, InstallerCallback installerCallback)
26 {
27 return OHOS::BundleMsClient::GetInstance().Uninstall(bundleName, installParam, installerCallback);
28 }
29
QueryAbilityInfo(const Want * want,AbilityInfo * abilityInfo)30 uint8_t QueryAbilityInfo(const Want *want, AbilityInfo *abilityInfo)
31 {
32 return OHOS::BundleMsClient::GetInstance().QueryAbilityInfo(want, abilityInfo);
33 }
34
GetBundleInfo(const char * bundleName,int32_t flags,BundleInfo * bundleInfo)35 uint8_t GetBundleInfo(const char *bundleName, int32_t flags, BundleInfo *bundleInfo)
36 {
37 return OHOS::BundleMsClient::GetInstance().GetBundleInfo(bundleName, flags, bundleInfo);
38 }
39
GetBundleInfos(const int flags,BundleInfo ** bundleInfos,int32_t * len)40 uint8_t GetBundleInfos(const int flags, BundleInfo **bundleInfos, int32_t *len)
41 {
42 return OHOS::BundleMsClient::GetInstance().GetBundleInfos(flags, bundleInfos, len);
43 }
44 }
45