From 2429fe8ecd07ebcbce6b5732c5cedb0c02917ed0 Mon Sep 17 00:00:00 2001 From: "huheng@kylinos.cn" Date: Fri, 14 Jul 2023 15:41:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E8=BF=9E=E6=8E=A5):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dusb=E8=AE=BE=E5=A4=87=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整usb连接以及wifi连接时对于adb device的处理逻辑 --- connectmanage/connectionservice.cpp | 30 ++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/connectmanage/connectionservice.cpp b/connectmanage/connectionservice.cpp index 4a26544..a090b42 100644 --- a/connectmanage/connectionservice.cpp +++ b/connectmanage/connectionservice.cpp @@ -616,11 +616,31 @@ void ConnectionService::onAdbExec(AdbProcess::ADB_EXEC_RESULT processResult) if (m_deviceSerialList.size() > 1) { qInfo() << "There are currently multiple wired devices!"; if (m_messageTcpSocket != nullptr) { - // 已存在连接,说明为WiFi连接 - qInfo() - << "Currently, there are multiple wired devices, and WiFi anti control is not supported " - "temporarily!"; - m_androidConnType = AndroidConnType::CONNECTWIFI; + QString serials = ""; + for (auto &item : m_deviceSerialList) { + if (item.contains(":5555")) { + serials = item; + break; + } + } + if (!serials.isEmpty()) { + qInfo() << "There are currently WiFi adb devices present!"; + // 存在wifiadb + if (isSameDevice(serials)) { + // 同一设备 + m_isSupportADB = true; + m_androidConnType = AndroidConnType::WIFIADB; + } else { + m_isSupportADB = false; + m_androidConnType = AndroidConnType::CONNECTWIFI; + } + } else { + // 已存在连接,说明为WiFi连接 + qInfo() + << "Currently, there are multiple wired devices, and WiFi anti control is not supported " + "temporarily!"; + m_androidConnType = AndroidConnType::CONNECTWIFI; + } handleConnected(); } else { // 不存在连接,当前有多个adb设备连接,暂时不处理