Android: remove AndroidDeviceType and State from AndroidDeviceInfo

No need to have these enums which are now only a duplication of
IDevice::MachineType and IDevice::DeviceState.

Change-Id: Icc3f112f2670c7354bb282b36fad0f0631b9e047
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Assam Boudjelthia
2021-10-06 22:35:12 +03:00
parent affe3ccf51
commit ec55b1a483
9 changed files with 33 additions and 51 deletions

View File

@@ -613,17 +613,18 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
const QString deviceType = device.mid(device.indexOf('\t')).trimmed();
AndroidDeviceInfo dev;
dev.serialNumber = serialNo;
dev.type = serialNo.startsWith(QLatin1String("emulator")) ? AndroidDeviceInfo::Emulator : AndroidDeviceInfo::Hardware;
dev.type = serialNo.startsWith(QLatin1String("emulator")) ? IDevice::Emulator
: IDevice::Hardware;
dev.sdk = getSDKVersion(dev.serialNumber);
dev.cpuAbi = getAbis(dev.serialNumber);
if (deviceType == QLatin1String("unauthorized"))
dev.state = AndroidDeviceInfo::UnAuthorizedState;
dev.state = IDevice::DeviceConnected;
else if (deviceType == QLatin1String("offline"))
dev.state = AndroidDeviceInfo::OfflineState;
dev.state = IDevice::DeviceDisconnected;
else
dev.state = AndroidDeviceInfo::OkState;
dev.state = IDevice::DeviceReadyToUse;
if (dev.type == AndroidDeviceInfo::Emulator) {
if (dev.type == IDevice::Emulator) {
dev.avdname = getAvdName(dev.serialNumber);
if (dev.avdname.isEmpty())
dev.avdname = serialNo;