• 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 "softbus_listener_mock.h"
17 
18 #include "gtest/gtest.h"
19 
20 namespace OHOS {
21 namespace DistributedHardware {
ShiftLNNGear(bool isWakeUp,const std::string & callerId)22 int32_t SoftbusListener::ShiftLNNGear(bool isWakeUp, const std::string &callerId)
23 {
24     return DmSoftbusListener::dmSoftbusListener->ShiftLNNGear(isWakeUp, callerId);
25 }
26 
GetUdidByNetworkId(const char * networkId,std::string & udid)27 int32_t SoftbusListener::GetUdidByNetworkId(const char *networkId, std::string &udid)
28 {
29     return DmSoftbusListener::dmSoftbusListener->GetUdidByNetworkId(networkId, udid);
30 }
31 
GetDeviceSecurityLevel(const char * networkId,int32_t & securityLevel)32 int32_t SoftbusListener::GetDeviceSecurityLevel(const char *networkId, int32_t &securityLevel)
33 {
34     return DmSoftbusListener::dmSoftbusListener->GetDeviceSecurityLevel(networkId, securityLevel);
35 }
36 
GetDeviceInfo(const std::string & networkId,DmDeviceInfo & info)37 int32_t SoftbusListener::GetDeviceInfo(const std::string &networkId, DmDeviceInfo &info)
38 {
39     return DmSoftbusListener::dmSoftbusListener->GetDeviceInfo(networkId, info);
40 }
41 
GetUuidByNetworkId(const char * networkId,std::string & uuid)42 int32_t SoftbusListener::GetUuidByNetworkId(const char *networkId, std::string &uuid)
43 {
44     return DmSoftbusListener::dmSoftbusListener->GetUuidByNetworkId(networkId, uuid);
45 }
46 
GetTargetInfoFromCache(const std::string & deviceId,PeerTargetId & targetId,ConnectionAddrType & addrType)47 int32_t SoftbusListener::GetTargetInfoFromCache(const std::string &deviceId, PeerTargetId &targetId,
48     ConnectionAddrType &addrType)
49 {
50     return DmSoftbusListener::dmSoftbusListener->GetTargetInfoFromCache(deviceId, targetId, addrType);
51 }
52 
GetTrustedDeviceList(std::vector<DmDeviceInfo> & deviceInfoList)53 int32_t SoftbusListener::GetTrustedDeviceList(std::vector<DmDeviceInfo> &deviceInfoList)
54 {
55     return DmSoftbusListener::dmSoftbusListener->GetTrustedDeviceList(deviceInfoList);
56 }
57 
GetLocalDeviceInfo(DmDeviceInfo & deviceInfo)58 int32_t SoftbusListener::GetLocalDeviceInfo(DmDeviceInfo &deviceInfo)
59 {
60     return DmSoftbusListener::dmSoftbusListener->GetLocalDeviceInfo(deviceInfo);
61 }
62 
GetDeviceScreenStatus(const char * networkId,int32_t & screenStatus)63 int32_t SoftbusListener::GetDeviceScreenStatus(const char *networkId, int32_t &screenStatus)
64 {
65     return DmSoftbusListener::dmSoftbusListener->GetDeviceScreenStatus(networkId, screenStatus);
66 }
67 
GetIPAddrTypeFromCache(const std::string & deviceId,const std::string & ip,ConnectionAddrType & addrType)68 int32_t SoftbusListener::GetIPAddrTypeFromCache(const std::string &deviceId, const std::string &ip,
69     ConnectionAddrType &addrType)
70 {
71     return DmSoftbusListener::dmSoftbusListener->GetIPAddrTypeFromCache(deviceId, ip, addrType);
72 }
73 
GetNetworkTypeByNetworkId(const char * networkId,int32_t & networkType)74 int32_t SoftbusListener::GetNetworkTypeByNetworkId(const char *networkId, int32_t &networkType)
75 {
76     return DmSoftbusListener::dmSoftbusListener->GetNetworkTypeByNetworkId(networkId, networkType);
77 }
78 
SetLocalDisplayName(const std::string & displayName)79 int32_t SoftbusListener::SetLocalDisplayName(const std::string &displayName)
80 {
81     return DmSoftbusListener::dmSoftbusListener->SetLocalDisplayName(displayName);
82 }
83 
GetUdidFromDp(const std::string & udidHash,std::string & udid)84 int32_t SoftbusListener::GetUdidFromDp(const std::string &udidHash, std::string &udid)
85 {
86     return DmSoftbusListener::dmSoftbusListener->GetUdidFromDp(udidHash, udid);
87 }
88 
GetAllTrustedDeviceList(const std::string & pkgName,const std::string & extra,std::vector<DmDeviceInfo> & deviceList)89 int32_t SoftbusListener::GetAllTrustedDeviceList(const std::string &pkgName, const std::string &extra,
90     std::vector<DmDeviceInfo> &deviceList)
91 {
92     return DmSoftbusListener::dmSoftbusListener->GetAllTrustedDeviceList(pkgName, extra, deviceList);
93 }
94 
StopRefreshSoftbusLNN(uint16_t subscribeId)95 int32_t SoftbusListener::StopRefreshSoftbusLNN(uint16_t subscribeId)
96 {
97     return DmSoftbusListener::dmSoftbusListener->StopRefreshSoftbusLNN(subscribeId);
98 }
SendAclChangedBroadcast(const std::string & msg)99 void SoftbusListener::SendAclChangedBroadcast(const std::string &msg)
100 {
101     DmSoftbusListener::dmSoftbusListener->SendAclChangedBroadcast(msg);
102 }
103 } // namespace DistributedHardware
104 } // namespace OHOS