• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 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 #ifndef OHOS_BMS_INTERFACE_H
17 #define OHOS_BMS_INTERFACE_H
18 
19 #include "feature.h"
20 #include "iproxy_server.h"
21 #include "want.h"
22 #include "install_param.h"
23 #include "bundle_manager.h"
24 #include "bundle_info.h"
25 #include "bundle_install_msg.h"
26 
27 #ifdef __cplusplus
28 #if __cplusplus
29 extern "C" {
30 #endif
31 #endif /* __cplusplus */
32 
33 const char BMS_SERVICE[] = "bundlems";
34 const char BMS_FEATURE[] = "BmsFeature";
35 const char BMS_SLITE_FEATURE[] = "BmsSliteFeature";
36 const char BMS_INNER_FEATURE[] = "BmsInnerFeature";
37 const unsigned int MAX_PATH_LEN = 256;
38 
39 typedef struct {
40     char bundleParameter[MAX_PATH_LEN];
41     InstallParam *bundleInstallParam;
42     InstallerCallback bundleInstallerCallback;
43 } Bmsbuff;
44 
45 struct BmsSliteInterface {
46     INHERIT_IUNKNOWN;
47     bool (*Install)(const char *hapPath, const InstallParam *installParam, InstallerCallback installerCallback);
48     bool (*Uninstall)(const char *bundleName, const InstallParam *installParam, InstallerCallback installerCallback);
49     uint8_t (*QueryAbilityInfo)(const Want *want, AbilityInfo *abilityInfo);
50     uint8_t (*GetBundleInfo)(const char *bundleName, int32_t flags, BundleInfo *bundleInfo);
51     uint8_t (*GetBundleInfos)(int32_t flags, BundleInfo **bundleInfos, int32_t *len);
52     bool (*GetInstallState)(const char *bundleName, InstallState *installState, uint8_t *installProcess);
53     uint32_t (*GetBundleSize)(const char *bundleName);
54     bool (*RegisterInstallerCallback)(InstallerCallback installerCallback);
55 };
56 #ifdef __cplusplus
57 #if __cplusplus
58 }
59 #endif
60 #endif /* __cplusplus */
61 #endif // OHOS_BMS_INTERFACE_H
62