summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2021-10-07 11:10:47 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2021-10-25 09:22:08 +0000
commit43f759a6b0e1e8311d43a750c46b8257d62a9b5e (patch)
treecb2fe8baff7a50e8c65a3cdd10d082467bebb92b
parentec55b1a48312187d356ef1b85adf251511d0326f (diff)
downloadqt-creator-43f759a6b0e1e8311d43a750c46b8257d62a9b5e.tar.gz
Android: remove unauthorized field form AndroidDeviceInfo
This is not really needed anymore, it was mainly used for physical devices to report whether they need user authorization to be used via adb. This is now handled by IDevice::DeviceState, where a Connected device is unauthorized, otherwise any physical device is ReadyToUse if authorization is good. Change-Id: If5c1e49b98063eabe4205cd8adb5b11515e1e1de Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r--src/plugins/android/androiddevice.cpp6
-rw-r--r--src/plugins/android/androiddeviceinfo.cpp4
-rw-r--r--src/plugins/android/androiddeviceinfo.h2
-rw-r--r--tests/auto/android/tst_avdmanageroutputparser.cpp3
4 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp
index c09966bb19..a5674313ee 100644
--- a/src/plugins/android/androiddevice.cpp
+++ b/src/plugins/android/androiddevice.cpp
@@ -99,6 +99,12 @@ AndroidDeviceWidget::AndroidDeviceWidget(const IDevice::Ptr &device)
const auto osString = QString("%1 (SDK %2)").arg(dev->androidVersion()).arg(dev->sdkLevel());
formLayout->addRow(AndroidDevice::tr("OS version:"), new QLabel(osString));
+ if (dev->machineType() == IDevice::Hardware) {
+ const QString authorizedStr = dev->deviceState() == IDevice::DeviceReadyToUse ? tr("Yes")
+ : tr("No");
+ formLayout->addRow(AndroidDevice::tr("Authorized:"), new QLabel(authorizedStr));
+ }
+
if (dev->machineType() == IDevice::Emulator) {
const QString targetName = dev->androidTargetName();
formLayout->addRow(AndroidDevice::tr("Android target flavor:"), new QLabel(targetName));
diff --git a/src/plugins/android/androiddeviceinfo.cpp b/src/plugins/android/androiddeviceinfo.cpp
index 707ee3a688..752a710c14 100644
--- a/src/plugins/android/androiddeviceinfo.cpp
+++ b/src/plugins/android/androiddeviceinfo.cpp
@@ -57,7 +57,7 @@ bool AndroidDeviceInfo::operator==(const AndroidDeviceInfo &other) const
return serialNumber == other.serialNumber && avdname == other.avdname && cpuAbi == other.cpuAbi
&& avdTarget == other.avdTarget && avdDevice == other.avdDevice
&& avdSkin == other.avdSkin && avdSdcardSize == other.avdSdcardSize && sdk == other.sdk
- && state == other.state && unauthorized == other.unauthorized && type == other.type;
+ && state == other.state && type == other.type;
}
QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device)
@@ -65,7 +65,7 @@ QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device)
stream << "Type:" << (device.type == ProjectExplorer::IDevice::Emulator ? "Emulator" : "Device")
<< ", ABI:" << device.cpuAbi << ", Serial:" << device.serialNumber
<< ", Name:" << device.avdname << ", API:" << device.sdk
- << ", Authorised:" << !device.unauthorized;
+ << ", Authorised:" << (device.state == IDevice::DeviceReadyToUse);
return stream;
}
diff --git a/src/plugins/android/androiddeviceinfo.h b/src/plugins/android/androiddeviceinfo.h
index ff4b662191..b43cbc6342 100644
--- a/src/plugins/android/androiddeviceinfo.h
+++ b/src/plugins/android/androiddeviceinfo.h
@@ -46,10 +46,8 @@ public:
QString avdDevice;
QString avdSkin;
QString avdSdcardSize;
-
int sdk = -1;
IDevice::DeviceState state = IDevice::DeviceDisconnected;
- bool unauthorized = false;
IDevice::MachineType type = IDevice::Emulator;
static QStringList adbSelector(const QString &serialNumber);
diff --git a/tests/auto/android/tst_avdmanageroutputparser.cpp b/tests/auto/android/tst_avdmanageroutputparser.cpp
index 059f479fea..ca3dcda19c 100644
--- a/tests/auto/android/tst_avdmanageroutputparser.cpp
+++ b/tests/auto/android/tst_avdmanageroutputparser.cpp
@@ -64,7 +64,6 @@ void tst_AvdManagerOutputParser::parse_data()
"512 MB",
-1,
IDevice::DeviceConnected,
- false,
IDevice::Emulator}})
<< QStringList();
@@ -91,7 +90,6 @@ void tst_AvdManagerOutputParser::parse_data()
"512 MB",
-1,
IDevice::DeviceConnected,
- false,
IDevice::Emulator},
{"",
"TestTablet",
@@ -102,7 +100,6 @@ void tst_AvdManagerOutputParser::parse_data()
"256 MB",
-1,
IDevice::DeviceConnected,
- false,
IDevice::Emulator}})
<< QStringList();
}