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_DISTRIBUTEDSCHEDULE_PERMISSION_H 17 #define OHOS_DISTRIBUTEDSCHEDULE_PERMISSION_H 18 19 #include <stdbool.h> 20 #include <stdint.h> 21 22 #include "bundle_info.h" 23 #include "dmsfwk_interface.h" 24 #include "dmslite_parser.h" 25 #include "dmslite_inner_common.h" 26 27 #ifdef __cplusplus 28 #if __cplusplus 29 extern "C" { 30 #endif 31 #endif 32 33 /** 34 * @brief Checks whether the remote has the permission of interaction with local FAs 35 * @param permissionCheckInfo parsed info required for checking remote permission 36 * @return DmsLiteCommonErrorCode 37 */ 38 int32_t CheckRemotePermission(const PermissionCheckInfo *permissionCheckInfo); 39 char* GetCallerSignature(const char *remoteName, BundleInfo *bundleInfo); 40 char* GetRemoteSignature(const char *remoteName, BundleInfo *bundleInfo); 41 42 /** 43 * @brief Get caller bundle info from bms or file 44 * @param callerInfo caller information, which includes uid and bundleName 45 * @param bundleInfo bundle information of caller 46 * @return DmsLiteCommonErrorCode 47 */ 48 int32_t GetCallerBundleInfo(const CallerInfo *callerInfo, BundleInfo *bundleInfo); 49 50 #ifdef __cplusplus 51 #if __cplusplus 52 } 53 #endif 54 #endif 55 56 #endif // OHOS_DISTRIBUTEDSCHEDULE_PERMISSION_H 57