1 /* 2 * Copyright (C) 2024 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 IPC_RUST_CXX_SKELETON_H 17 #define IPC_RUST_CXX_SKELETON_H 18 19 #include "cxx.h" 20 #include "ipc_skeleton.h" 21 #include "remote_object_wrapper.h" 22 23 namespace OHOS { 24 namespace IpcRust { 25 bool SetMaxWorkThreadNum(int maxThreadNum); 26 27 void JoinWorkThread(); 28 29 void StopWorkThread(); 30 31 uint64_t GetCallingPid(); 32 33 uint64_t GetCallingRealPid(); 34 35 uint64_t GetCallingUid(); 36 37 uint32_t GetCallingTokenID(); 38 39 uint64_t GetCallingFullTokenID(); 40 41 uint32_t GetFirstTokenID(); 42 43 uint64_t GetFirstFullTokenID(); 44 45 uint64_t GetSelfTokenID(); 46 47 rust::string GetLocalDeviceID(); 48 49 rust::string GetCallingDeviceID(); 50 51 bool IsLocalCalling(); 52 53 std::unique_ptr<IRemoteObjectWrapper> GetContextObject(); 54 55 int FlushCommands(IRemoteObjectWrapper &object); 56 57 rust::string ResetCallingIdentity(); 58 59 bool SetCallingIdentity(rust::str identity); 60 61 bool IsHandlingTransaction(); 62 63 } // namespace IpcRust 64 } // namespace OHOS 65 66 #endif