mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-18 16:04:40 -04:00
@@ -18,7 +18,7 @@
|
||||
#include <thread>
|
||||
|
||||
#include "securec.h"
|
||||
#include "session_mock.h"
|
||||
#include "session.h"
|
||||
|
||||
constexpr int32_t DH_SUCCESS = 0;
|
||||
const uint32_t AUTH_SESSION_SIDE_CLIENT = 1;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "socket_mock.h"
|
||||
#include "socket.h"
|
||||
|
||||
int32_t Socket(SocketInfo info)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "softbus_bus_center_mock.h"
|
||||
#include "softbus_bus_center.h"
|
||||
|
||||
constexpr int32_t DH_SUCCESS = 0;
|
||||
int32_t GetLocalNodeDeviceInfo(const char *pkgName, NodeBasicInfo *info)
|
||||
|
||||
@@ -257,7 +257,7 @@ int32_t DistributedInputTransportBase::StartSession(const std::string &remoteDev
|
||||
|
||||
PeerSocketInfo peerSocketInfo = {
|
||||
.name = const_cast<char*>(peerSessionName.c_str()),
|
||||
.deviceId = const_cast<char*>(remoteDevId.c_str()),
|
||||
.networkId = const_cast<char*>(remoteDevId.c_str()),
|
||||
.pkgName = const_cast<char*>(DINPUT_PKG_NAME.c_str()),
|
||||
.dataType = DATA_TYPE_BYTES
|
||||
};
|
||||
@@ -376,11 +376,11 @@ void DistributedInputTransportBase::EraseSessionId(const std::string &remoteDevI
|
||||
int32_t DistributedInputTransportBase::OnSessionOpened(int32_t sessionId, PeerSocketInfo info)
|
||||
{
|
||||
DHLOGI("OnSessionOpened, socket: %d, peerSocketName: %s, peerNetworkId: %s, peerPkgName: %s",
|
||||
sessionId, info.name, info.deviceId, info.pkgName);
|
||||
sessionId, info.name, info.networkId, info.pkgName);
|
||||
FinishAsyncTrace(DINPUT_HITRACE_LABEL, DINPUT_OPEN_SESSION_START, DINPUT_OPEN_SESSION_TASK);
|
||||
|
||||
std::string peerDevId;
|
||||
peerDevId.assign(info.deviceId);
|
||||
peerDevId.assign(info.networkId);
|
||||
{
|
||||
std::unique_lock<std::mutex> sessionLock(operationMutex_);
|
||||
remoteDevSessionMap_[peerDevId] = sessionId;
|
||||
|
||||
@@ -91,11 +91,10 @@ HWTEST_F(DistributedInputTransbaseTest, GetDevIdBySessionId01, testing::ext::Tes
|
||||
|
||||
HWTEST_F(DistributedInputTransbaseTest, OnSessionOpened01, testing::ext::TestSize.Level0)
|
||||
{
|
||||
|
||||
int32_t sessionId = 0;
|
||||
PeerSocketInfo peerSocketInfo = {
|
||||
.name = const_cast<char*>(PEER_SESSION_NAME.c_str()),
|
||||
.deviceId = const_cast<char*>(REMOTE_DEV_ID.c_str()),
|
||||
.networkId = const_cast<char*>(REMOTE_DEV_ID.c_str()),
|
||||
.pkgName = const_cast<char*>(DINPUT_PKG_NAME_TEST.c_str()),
|
||||
.dataType = DATA_TYPE_BYTES
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user