Commit 77d885bf authored by Daniel Teske's avatar Daniel Teske

Android: Handle offline state

Task-number: QTCREATORBUG-11056
Change-Id: I81b58d08b66b4fb8322e5c6c4935ddfb9470318f
Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
parent 3befd911
......@@ -431,7 +431,12 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
dev.type = serialNo.startsWith(QLatin1String("emulator")) ? AndroidDeviceInfo::Emulator : AndroidDeviceInfo::Hardware;
dev.sdk = getSDKVersion(dev.serialNumber);
dev.cpuAbi = getAbis(dev.serialNumber);
dev.unauthorized = (deviceType == QLatin1String("unauthorized"));
if (deviceType == QLatin1String("unauthorized"))
dev.state = AndroidDeviceInfo::UnAuthorizedState;
else if (deviceType == QLatin1String("offline"))
dev.state = AndroidDeviceInfo::OfflineState;
else
dev.state = AndroidDeviceInfo::OkState;
devices.push_back(dev);
}
......@@ -575,7 +580,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices() const
// armeabi-v7a devices can also run armeabi code
if (dev.cpuAbi == QStringList(QLatin1String("armeabi-v7a")))
dev.cpuAbi << QLatin1String("armeabi");
dev.unauthorized = false;
dev.state = AndroidDeviceInfo::OkState;
dev.type = AndroidDeviceInfo::Emulator;
devices.push_back(dev);
}
......
......@@ -56,6 +56,8 @@ struct AndroidDeviceInfo
QString serialNumber;
QStringList cpuAbi;
int sdk;
enum State { OkState, UnAuthorizedState, OfflineState };
State state;
bool unauthorized;
enum AndroidDeviceType { Hardware, Emulator };
AndroidDeviceType type;
......
......@@ -331,9 +331,12 @@ void AndroidDeviceModel::setDevices(const QVector<AndroidDeviceInfo> &devices)
AndroidDeviceModelNode *incompatibleDevices = 0; // created on demand
foreach (const AndroidDeviceInfo &device, devices) {
QString error;
if (device.unauthorized) {
if (device.state == AndroidDeviceInfo::UnAuthorizedState) {
error = AndroidDeviceDialog::tr("Unauthorized. Please check the confirmation dialog on your device %1.")
.arg(device.serialNumber);
}else if (device.state == AndroidDeviceInfo::OfflineState) {
error = AndroidDeviceDialog::tr("Offline. Please check the state of your device %1.")
.arg(device.serialNumber);
} else if (!device.cpuAbi.contains(m_abi)) {
error = AndroidDeviceDialog::tr("ABI is incompatible, device supports ABIs: %1.")
.arg(device.cpuAbi.join(QLatin1String(" ")));
......
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