1 /* 2 * Copyright (c) 2021 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_DISTRIBUTED_CALLER_INFO_H 17 #define OHOS_DISTRIBUTED_CALLER_INFO_H 18 19 #include "nlohmann/json.hpp" 20 21 namespace OHOS { 22 namespace DistributedSchedule { 23 enum { 24 CALLER_TYPE_NONE = 0, 25 CALLER_TYPE_HARMONY = 1, 26 }; 27 28 enum { 29 VERSION_BASE = 200, // begin for 200 and step for 200 30 VERSION = VERSION_BASE, 31 }; 32 struct CallerInfo { 33 int32_t uid = -1; 34 int32_t pid = -1; 35 int32_t callerType = CALLER_TYPE_NONE; 36 std::string sourceDeviceId; 37 int32_t duid = -1; 38 std::string callerAppId; 39 std::vector<std::string> bundleNames; 40 int32_t dmsVersion = -1; 41 uint32_t accessToken = 0; 42 nlohmann::json extraInfoJson; 43 }; 44 } // namespace DistributedSchedule 45 } // namespace OHOS 46 #endif // OHOS_DISTRIBUTED_CALLER_INFO_H