• 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_BUNDLE_INNER_INTERFACE_H
17 #define OHOS_BUNDLE_INNER_INTERFACE_H
18 
19 #include "ability_info.h"
20 #include "bundle_info.h"
21 #include "iproxy_server.h"
22 #include "want.h"
23 
24 #ifdef __cplusplus
25 #if __cplusplus
26 extern "C" {
27 #endif
28 #endif /* __cplusplus */
29 
30 const char BMS_SERVICE[] = "bundlems";
31 const char BMS_FEATURE[] = "BmsFeature";
32 const char BMS_INNER_FEATURE[] = "BmsInnerFeature";
33 
34 enum BmsCmd {
35     QUERY_ABILITY_INFO = 0,
36     GET_BUNDLE_INFO,
37     CHANGE_CALLBACK_SERVICE_IDENTITY,
38     GET_BUNDLENAME_FOR_UID,
39     GET_BUNDLE_INFOS,
40     QUERY_KEEPALIVE_BUNDLE_INFOS,
41     GET_BUNDLE_INFOS_BY_METADATA,
42     CHECK_SYS_CAP,
43     GET_BUNDLE_SIZE,
44     GET_SYS_CAP,
45     BMS_INNER_BEGIN,
46     INSTALL = BMS_INNER_BEGIN, // bms install application
47     UNINSTALL,
48 #ifdef OHOS_DEBUG
49     SET_EXTERNAL_INSTALL_MODE,
50     SET_SIGN_DEBUG_MODE,
51     SET_SIGN_MODE,
52 #endif
53     BMS_CMD_END
54 };
55 
56 struct BmsServerProxy {
57     INHERIT_SERVER_IPROXY;
58     uint8_t (*QueryAbilityInfo)(const Want *want, AbilityInfo *abilityInfo);
59     uint8_t (*GetBundleInfo)(const char *bundleName, int32_t flags, BundleInfo *bundleInfo);
60     uint8_t (*GetBundleInfos)(int flags, BundleInfo **bundleInfos, int32_t *len);
61     uint8_t (*QueryKeepAliveBundleInfos)(BundleInfo **bundleInfos, int32_t *len);
62     uint8_t (*GetBundleNameForUid)(int32_t uid,  char **bundleName);
63     uint32_t (*GetBundleSize)(const char *bundleName);
64 };
65 
66 struct BmsInnerServerProxy {
67     INHERIT_SERVER_IPROXY;
68 };
69 
70 #ifdef __cplusplus
71 #if __cplusplus
72 }
73 #endif
74 #endif /* __cplusplus */
75 #endif /* OHOS_BUNDLE_INNER_INTERFACE_H */