• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 #include "mock_ipc_skeleton.h"
17 #include "mock_my_status.h"
18 
19 namespace OHOS {
20 #ifdef CONFIG_IPC_SINGLE
21 using namespace IPC_SINGLE;
22 #endif
23 
GetCallingUid()24 pid_t IPCSkeleton::GetCallingUid()
25 {
26     return static_cast<pid_t>(AAFwk::MyStatus::GetInstance().ipcGetCallingUid_);
27 }
28 
GetCallingPid()29 pid_t IPCSkeleton::GetCallingPid()
30 {
31     return static_cast<pid_t>(AAFwk::MyStatus::GetInstance().ipcGetCallingUid_);
32 }
33 
GetCallingTokenID()34 uint32_t IPCSkeleton::GetCallingTokenID()
35 {
36     return AAFwk::MyStatus::GetInstance().ipcGetCallingTokenID_;
37 }
38 
GetSelfTokenID()39 uint32_t IPCSkeleton::GetSelfTokenID()
40 {
41     return AAFwk::MyStatus::GetInstance().ipcGetSelfTokenID_;
42 }
43 
SetCallingIdentity(std::string & identity,bool status)44 bool IPCSkeleton::SetCallingIdentity(std::string &identity, bool status)
45 {
46     return true;
47 }
48 
GetCallingFullTokenID()49 uint64_t IPCSkeleton::GetCallingFullTokenID()
50 {
51     return 1;
52 }
53 
54 }  // namespace OHOS
55