• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "comm_auth_info.h"
17 
18 namespace OHOS {
CommAuthInfo(IRemoteObject * stub,int pid,int uid,uint32_t tokenId,const std::string & deviceId)19 CommAuthInfo::CommAuthInfo(IRemoteObject *stub, int pid, int uid, uint32_t tokenId, const std::string &deviceId)
20     : stub_(stub), remotePid_(pid), remoteUid_(uid), tokenId_(tokenId), deviceId_(deviceId)
21 {}
22 
~CommAuthInfo()23 CommAuthInfo::~CommAuthInfo()
24 {
25     stub_ = nullptr;
26 }
27 
GetStubObject() const28 IRemoteObject *CommAuthInfo::GetStubObject() const
29 {
30     return stub_;
31 }
32 
GetRemotePid() const33 int CommAuthInfo::GetRemotePid() const
34 {
35     return remotePid_;
36 }
37 
GetRemoteUid() const38 int CommAuthInfo::GetRemoteUid() const
39 {
40     return remoteUid_;
41 }
42 
GetRemoteTokenId() const43 uint32_t CommAuthInfo::GetRemoteTokenId() const
44 {
45     return tokenId_;
46 }
47 
GetRemoteDeviceId() const48 std::string CommAuthInfo::GetRemoteDeviceId() const
49 {
50     return deviceId_;
51 }
52 } // namespace OHOS
53