• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 "multiple_user_connector_mock.h"
17 
18 #include "gtest/gtest.h"
19 
20 namespace OHOS {
21 namespace DistributedHardware {
GetCurrentAccountUserID(void)22 int32_t MultipleUserConnector::GetCurrentAccountUserID(void)
23 {
24     return DmMultipleUserConnector::dmMultipleUserConnector->GetCurrentAccountUserID();
25 }
26 
GetFirstForegroundUserId(void)27 int32_t MultipleUserConnector::GetFirstForegroundUserId(void)
28 {
29     return DmMultipleUserConnector::dmMultipleUserConnector->GetFirstForegroundUserId();
30 }
31 
GetAccountInfoByUserId(int32_t userId)32 DMAccountInfo MultipleUserConnector::GetAccountInfoByUserId(int32_t userId)
33 {
34     return DmMultipleUserConnector::dmMultipleUserConnector->GetAccountInfoByUserId(userId);
35 }
36 
GetBackgroundUserIds(std::vector<int32_t> & userIdVec)37 int32_t MultipleUserConnector::GetBackgroundUserIds(std::vector<int32_t> &userIdVec)
38 {
39     return DmMultipleUserConnector::dmMultipleUserConnector->GetBackgroundUserIds(userIdVec);
40 }
41 
GetForegroundUserIds(std::vector<int32_t> & userVec)42 int32_t MultipleUserConnector::GetForegroundUserIds(std::vector<int32_t> &userVec)
43 {
44     return DmMultipleUserConnector::dmMultipleUserConnector->GetForegroundUserIds(userVec);
45 }
46 
GetOhosAccountId(void)47 std::string MultipleUserConnector::GetOhosAccountId(void)
48 {
49     return DmMultipleUserConnector::dmMultipleUserConnector->GetOhosAccountId();
50 }
51 
GetTokenIdAndForegroundUserId(uint32_t & tokenId,int32_t & userId)52 void MultipleUserConnector::GetTokenIdAndForegroundUserId(uint32_t &tokenId, int32_t &userId)
53 {
54     return DmMultipleUserConnector::dmMultipleUserConnector->GetTokenIdAndForegroundUserId(tokenId, userId);
55 }
56 
GetOhosAccountIdByUserId(int32_t userId)57 std::string MultipleUserConnector::GetOhosAccountIdByUserId(int32_t userId)
58 {
59     return DmMultipleUserConnector::dmMultipleUserConnector->GetOhosAccountIdByUserId(userId);
60 }
61 
GetAccountNickName(int32_t userId)62 std::string MultipleUserConnector::GetAccountNickName(int32_t userId)
63 {
64     return DmMultipleUserConnector::dmMultipleUserConnector->GetAccountNickName(userId);
65 }
66 
GetCallerUserId(int32_t & userId)67 void MultipleUserConnector::GetCallerUserId(int32_t &userId)
68 {
69     return DmMultipleUserConnector::dmMultipleUserConnector->GetCallerUserId(userId);
70 }
71 } // namespace DistributedHardware
72 } // namespace OHOS