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:
Daniel Teske
2013-11-15 16:45:55 +01:00
parent 095d911452
commit fe0e3701b7

View File

@@ -772,8 +772,7 @@ bool AndroidConfigurations::hasFinishedBooting(const QString &device) const
QStringList AndroidConfigurations::getAbis(const QString &device) const QStringList AndroidConfigurations::getAbis(const QString &device) const
{ {
QStringList result; QStringList result;
int i = 1; for (int i = 1; i < 6; ++i) {
while (true) {
QStringList arguments = AndroidDeviceInfo::adbSelector(device); QStringList arguments = AndroidDeviceInfo::adbSelector(device);
arguments << QLatin1String("shell") << QLatin1String("getprop"); arguments << QLatin1String("shell") << QLatin1String("getprop");
if (i == 1) if (i == 1)
@@ -791,7 +790,6 @@ QStringList AndroidConfigurations::getAbis(const QString &device) const
if (abi.isEmpty()) if (abi.isEmpty())
break; break;
result << abi; result << abi;
++i;
} }
return result; return result;
} }