🐞 fix(连接): 修复usb设备连接问题

调整usb连接以及wifi连接时对于adb device的处理逻辑
This commit is contained in:
huheng@kylinos.cn 2023-07-14 15:41:16 +08:00
parent 52c959f8de
commit 2429fe8ecd
1 changed files with 25 additions and 5 deletions

View File

@ -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设备连接暂时不处理