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_DMSLITE_INNER_COMMON_H
17 #define OHOS_DMSLITE_INNER_COMMON_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 #if __cplusplus
23 extern "C" {
24 #endif
25 #endif
26 
27 enum DmsAllowedUids {
28     FOUNDATION_UID = 7,
29 #ifdef __LINUX__
30     SHELL_UID = 0,
31 #else
32     SHELL_UID = 2,
33 #endif
34 };
35 
36 /**
37 * @brief Callback for parsing dmslite tlv message
38 * @param errCode indicates the result of parsing tlv message
39 * @param dmsMsg parsed request message from remote if success, otherwise is NULL
40 */
41 typedef void (*TlvParseCallback) (int8_t errCode, const void *dmsMsg);
42 
43 /**
44 * @brief Callback for starting ability
45 * @param errCode indicates the result of starting ability
46 */
47 typedef void (*StartAbilityCallback) (int8_t errCode);
48 
49 typedef struct {
50     TlvParseCallback onTlvParseDone;
51     StartAbilityCallback onStartAbilityDone;
52 } IDmsFeatureCallback;
53 
54 typedef struct {
55     const char* calleeBundleName;
56     const char* calleeAbilityName;
57     const char* callerSignature;
58 } PermissionCheckInfo;
59 
60 enum IntNumBytes {
61     INT_8 = 1,
62     INT_16 = 2,
63     INT_32 = 4,
64     INT_64 = 8,
65 };
66 
67 #ifdef __cplusplus
68 #if __cplusplus
69 }
70 #endif
71 #endif
72 
73 #endif  // OHOS_DMSLITE_INNER_COMMON_H
74