Commit 1c633eb1 authored by Daniel Teske's avatar Daniel Teske

Android: Connected devices should list all devices

E. g. waitForAvd needs all devices to correctly work.

Change-Id: I1b704e85bd7449d4c45ed36be48973f39148b8c4
Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
parent 9d0ae5be
......@@ -104,7 +104,15 @@ namespace {
bool androidDevicesLessThan(const AndroidDeviceInfo &dev1, const AndroidDeviceInfo &dev2)
{
return dev1.sdk < dev2.sdk;
if (dev1.serialNumber.contains("????") == dev2.serialNumber.contains("????"))
return !dev1.serialNumber.contains("????");
bool dev1IsEmulator = dev1.serialNumber.startsWith(QLatin1String("emulator"));
bool dev2IsEmulator = dev2.serialNumber.startsWith(QLatin1String("emulator"));
if (dev1IsEmulator != dev2IsEmulator)
return !dev1IsEmulator;
if (dev1.sdk != dev2.sdk)
return dev1.sdk < dev2.sdk;
return dev1.serialNumber < dev2.serialNumber;
}
}
......@@ -425,19 +433,8 @@ QVector<AndroidDeviceInfo> AndroidConfigurations::connectedDevices(QString *erro
// workaround for '????????????' serial numbers:
// can use "adb -d" when only one usb device attached
int usbDevicesNum = 0;
QStringList serialNumbers;
foreach (const QByteArray &device, adbDevs) {
const QString serialNo = QString::fromLatin1(device.left(device.indexOf('\t')).trimmed());;
if (!serialNo.startsWith(QLatin1String("emulator")))
++usbDevicesNum;
serialNumbers << serialNo;
}
foreach (const QString &serialNo, serialNumbers) {
if (serialNo.contains(QLatin1String("????")) && usbDevicesNum > 1)
continue;
dev.serialNumber = serialNo;
dev.sdk = getSDKVersion(dev.serialNumber);
dev.cpuAbi = getAbis(dev.serialNumber);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment