193360723Sopenharmony_ci/*
293360723Sopenharmony_ci * Copyright (c) 2020 Huawei Device Co., Ltd.
393360723Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
493360723Sopenharmony_ci * you may not use this file except in compliance with the License.
593360723Sopenharmony_ci * You may obtain a copy of the License at
693360723Sopenharmony_ci *
793360723Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
893360723Sopenharmony_ci *
993360723Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1093360723Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1193360723Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1293360723Sopenharmony_ci * See the License for the specific language governing permissions and
1393360723Sopenharmony_ci * limitations under the License.
1493360723Sopenharmony_ci */
1593360723Sopenharmony_ci
1693360723Sopenharmony_ci#ifndef OHOS_DMSLITE_INNER_COMMON_H
1793360723Sopenharmony_ci#define OHOS_DMSLITE_INNER_COMMON_H
1893360723Sopenharmony_ci
1993360723Sopenharmony_ci#include <stdint.h>
2093360723Sopenharmony_ci
2193360723Sopenharmony_ci#ifdef __cplusplus
2293360723Sopenharmony_ci#if __cplusplus
2393360723Sopenharmony_ciextern "C" {
2493360723Sopenharmony_ci#endif
2593360723Sopenharmony_ci#endif
2693360723Sopenharmony_ci
2793360723Sopenharmony_cienum DmsAllowedUids {
2893360723Sopenharmony_ci    FOUNDATION_UID = 7,
2993360723Sopenharmony_ci#ifdef __LINUX__
3093360723Sopenharmony_ci    SHELL_UID = 0,
3193360723Sopenharmony_ci#else
3293360723Sopenharmony_ci    SHELL_UID = 2,
3393360723Sopenharmony_ci#endif
3493360723Sopenharmony_ci};
3593360723Sopenharmony_ci
3693360723Sopenharmony_ci/**
3793360723Sopenharmony_ci* @brief Callback for parsing dmslite tlv message
3893360723Sopenharmony_ci* @param errCode indicates the result of parsing tlv message
3993360723Sopenharmony_ci* @param dmsMsg parsed request message from remote if success, otherwise is NULL
4093360723Sopenharmony_ci*/
4193360723Sopenharmony_citypedef void (*TlvParseCallback) (int8_t errCode, const void *dmsMsg);
4293360723Sopenharmony_ci
4393360723Sopenharmony_ci/**
4493360723Sopenharmony_ci* @brief Callback for starting ability
4593360723Sopenharmony_ci* @param errCode indicates the result of starting ability
4693360723Sopenharmony_ci*/
4793360723Sopenharmony_citypedef void (*StartAbilityCallback) (int8_t errCode);
4893360723Sopenharmony_ci
4993360723Sopenharmony_citypedef struct {
5093360723Sopenharmony_ci    TlvParseCallback onTlvParseDone;
5193360723Sopenharmony_ci    StartAbilityCallback onStartAbilityDone;
5293360723Sopenharmony_ci} IDmsFeatureCallback;
5393360723Sopenharmony_ci
5493360723Sopenharmony_citypedef struct {
5593360723Sopenharmony_ci    const char* calleeBundleName;
5693360723Sopenharmony_ci    const char* calleeAbilityName;
5793360723Sopenharmony_ci    const char* callerSignature;
5893360723Sopenharmony_ci} PermissionCheckInfo;
5993360723Sopenharmony_ci
6093360723Sopenharmony_cienum IntNumBytes {
6193360723Sopenharmony_ci    INT_8 = 1,
6293360723Sopenharmony_ci    INT_16 = 2,
6393360723Sopenharmony_ci    INT_32 = 4,
6493360723Sopenharmony_ci    INT_64 = 8,
6593360723Sopenharmony_ci};
6693360723Sopenharmony_ci
6793360723Sopenharmony_ci#ifdef __cplusplus
6893360723Sopenharmony_ci#if __cplusplus
6993360723Sopenharmony_ci}
7093360723Sopenharmony_ci#endif
7193360723Sopenharmony_ci#endif
7293360723Sopenharmony_ci
7393360723Sopenharmony_ci#endif  // OHOS_DMSLITE_INNER_COMMON_H
74