forked from qt-creator/qt-creator
Android: getAbis prevent endless loop
We need to check all ro.product.cpu.abi# properties, but there's a limited amount of those. So only check up to 5 to ensure that the loop always terminates. On irc a user reported that on his device adb shell getprop returns "/bin/sh: getprop: not found", so this loop was never terminated. Change-Id: I819b28cdbedb0bf557ba58e8495a8da5eeb8dc8d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
This commit is contained in:
@@ -772,8 +772,7 @@ bool AndroidConfigurations::hasFinishedBooting(const QString &device) const
|
||||
QStringList AndroidConfigurations::getAbis(const QString &device) const
|
||||
{
|
||||
QStringList result;
|
||||
int i = 1;
|
||||
while (true) {
|
||||
for (int i = 1; i < 6; ++i) {
|
||||
QStringList arguments = AndroidDeviceInfo::adbSelector(device);
|
||||
arguments << QLatin1String("shell") << QLatin1String("getprop");
|
||||
if (i == 1)
|
||||
@@ -791,7 +790,6 @@ QStringList AndroidConfigurations::getAbis(const QString &device) const
|
||||
if (abi.isEmpty())
|
||||
break;
|
||||
result << abi;
|
||||
++i;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user