Commit decefcbd authored by Ray Donnelly's avatar Ray Donnelly Committed by Daniel Teske

Use QProcess::kill() rather than QProcess::terminate() for adb.exe

terminate (on Windows) requires a Windows Event Loop to process it
so use kill() on all platforms instead.

Change-Id: Ic38d6813c3071fde67806b10d782e5ab3b0f1a18
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 4e540ce7
......@@ -412,7 +412,7 @@ QVector<AndroidDeviceInfo> AndroidConfigurations::connectedDevices(int apiLevel)
QProcess adbProc;
adbProc.start(adbToolPath().toString(), QStringList() << QLatin1String("devices"));
if (!adbProc.waitForFinished(-1)) {
adbProc.terminate();
adbProc.kill();
return devices;
}
QList<QByteArray> adbDevs = adbProc.readAll().trimmed().split('\n');
......@@ -565,7 +565,7 @@ QString AndroidConfigurations::startAVD(int *apiLevel, const QString &name) cons
proc.start(adbToolPath().toString(), QStringList() << QLatin1String("-e") << QLatin1String("wait-for-device"));
while (!proc.waitForFinished(500)) {
if (avdProcess->waitForFinished(0)) {
proc.terminate();
proc.kill();
proc.waitForFinished(-1);
return QString();
}
......@@ -575,7 +575,7 @@ QString AndroidConfigurations::startAVD(int *apiLevel, const QString &name) cons
// workaround for stupid adb bug
proc.start(adbToolPath().toString(), QStringList() << QLatin1String("devices"));
if (!proc.waitForFinished(-1)) {
proc.terminate();
proc.kill();
return QString();
}
......@@ -597,7 +597,7 @@ int AndroidConfigurations::getSDKVersion(const QString &device) const
<< QLatin1String("shell") << QLatin1String("getprop")
<< QLatin1String("ro.build.version.sdk"));
if (!adbProc.waitForFinished(-1)) {
adbProc.terminate();
adbProc.kill();
return -1;
}
return adbProc.readAll().trimmed().toInt();
......
......@@ -852,7 +852,7 @@ QStringList AndroidManager::dependencies(const Utils::FileName &readelfPath, con
readelfProc.start(readelfPath.toString(), QStringList() << QLatin1String("-d") << QLatin1String("-W") << lib);
if (!readelfProc.waitForFinished(-1)) {
readelfProc.terminate();
readelfProc.kill();
return libs;
}
......
......@@ -203,7 +203,7 @@ void AndroidPackageCreationStep::checkRequiredLibraries()
readelfProc.start(AndroidConfigurations::instance().readelfPath(target()->activeRunConfiguration()->abi().architecture()).toString(),
QStringList() << QLatin1String("-d") << QLatin1String("-W") << appPath);
if (!readelfProc.waitForFinished(-1)) {
readelfProc.terminate();
readelfProc.kill();
return;
}
QStringList libs;
......@@ -250,7 +250,7 @@ void AndroidPackageCreationStep::checkRequiredLibrariesForRun()
}
readelfProc.start(m_readElf.toString(), QStringList() << QLatin1String("-d") << QLatin1String("-W") << m_appPath.toUserOutput());
if (!readelfProc.waitForFinished(-1)) {
readelfProc.terminate();
readelfProc.kill();
return;
}
QStringList libs;
......@@ -467,7 +467,7 @@ void AndroidPackageCreationStep::stripAndroidLibs(const QStringList & files, Abi
QStringList()<<QLatin1String("--strip-unneeded") << file);
stripProcess.waitForStarted();
if (!stripProcess.waitForFinished())
stripProcess.terminate();
stripProcess.kill();
}
}
......
......@@ -82,7 +82,7 @@ void AndroidRunner::checkPID()
QStringList() << QLatin1String("-s") << m_deviceSerialNumber
<< QLatin1String("shell") << QLatin1String("readlink") << QLatin1String("$(which ps)"));
if (!psProc.waitForFinished(-1)) {
psProc.terminate();
psProc.kill();
return;
}
QByteArray which = psProc.readAll();
......@@ -251,7 +251,7 @@ void AndroidRunner::startLogcat()
void AndroidRunner::stop()
{
QMutexLocker locker(&m_mutex);
m_adbLogcatProcess.terminate();
m_adbLogcatProcess.kill();
m_adbLogcatProcess.waitForFinished(-1);
m_checkPIDTimer.stop();
if (m_processPID == -1)
......@@ -301,7 +301,7 @@ void AndroidRunner::adbKill(qint64 pid, const QString &device, int timeout, cons
process.start(AndroidConfigurations::instance().adbToolPath().toString(), arguments);
if (!process.waitForFinished(timeout))
process.terminate();
process.kill();
}
QString AndroidRunner::displayName() const
......
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