Commit e26bbc84 authored by BogDan Vatra's avatar BogDan Vatra Committed by BogDan Vatra

Fix warnings

Don't try to write from another thread into a process stdin. Fixes
"QSocketNotifier: Socket notifiers cannot be enabled or disabled from
another thread" warnings.

Change-Id: Id93a40a6bee6d4042cf600c8fabb06bf965d8ccc
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent cb6acf32
......@@ -249,13 +249,19 @@ static int extractPid(const QString &exeName, const QByteArray &psOutput)
QByteArray AndroidRunner::runPs()
{
QByteArray psLine("ps");
if (m_isBusyBox)
psLine += " -w";
psLine += '\n';
m_psProc.write(psLine);
m_psProc.waitForBytesWritten(psLine.size());
return m_psProc.readAllStandardOutput();
if (QThread::currentThread() != thread()) {
QByteArray ret;
QMetaObject::invokeMethod(this, "runPs", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QByteArray, ret));
return ret;
} else {
QByteArray psLine("ps");
if (m_isBusyBox)
psLine += " -w";
psLine += '\n';
m_psProc.write(psLine);
m_psProc.waitForBytesWritten(psLine.size());
return m_psProc.readAllStandardOutput();
}
}
void AndroidRunner::checkPID()
......
......@@ -80,12 +80,12 @@ private slots:
void logcatReadStandardError();
void logcatReadStandardOutput();
void asyncStart();
QByteArray runPs();
private:
void adbKill(qint64 pid);
QStringList selector() const { return m_selector; }
void forceStop();
QByteArray runPs();
void findPs();
void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError);
bool adbShellAmNeedsQuotes();
......
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