Android: notify qml profiler when app is stopped

As we cannot determine reliably what happened to the app we drop the
"success" parameter to notifyRemoteFinished(). It was almost always
true before and where it wasn't it didn't do anything useful. The
transition from AppRunning to AppKilled without AppDying in between
was invalid and would have triggered an assertion when it happened.

Task-number: QTCREATORBUG-11760
Change-Id: Iebf4ca9bddbcc7b152131f9574bc5f2c0a8ba44f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Ulf Hermann
2014-03-18 13:00:21 +01:00
parent 9c180ffded
commit 1111c06aac
7 changed files with 14 additions and 9 deletions

View File

@@ -82,7 +82,7 @@ public:
StartMode mode() const { return m_sp.startMode; }
virtual void notifyRemoteSetupDone(quint16) {}
virtual void notifyRemoteFinished(bool) {}
virtual void notifyRemoteFinished() {}
bool m_isRunning;

View File

@@ -102,6 +102,13 @@ void AndroidAnalyzeSupport::handleRemoteProcessStarted(int qmlPort)
m_qmlPort = qmlPort;
}
void AndroidAnalyzeSupport::handleRemoteProcessFinished(const QString &errorMsg)
{
if (m_runControl)
m_runControl->notifyRemoteFinished();
AndroidRunSupport::handleRemoteProcessFinished(errorMsg);
}
void AndroidAnalyzeSupport::handleRemoteOutput(const QByteArray &output)
{
const QString msg = QString::fromUtf8(output);

View File

@@ -56,6 +56,7 @@ public:
private slots:
void handleRemoteProcessStarted(int qmlPort);
void handleRemoteProcessFinished(const QString &errorMsg);
void handleRemoteOutput(const QByteArray &output);
void handleRemoteErrorOutput(const QByteArray &output);

View File

@@ -148,16 +148,13 @@ void QmlProfilerRunControl::stopEngine()
}
}
void QmlProfilerRunControl::notifyRemoteFinished(bool success)
void QmlProfilerRunControl::notifyRemoteFinished()
{
QTC_ASSERT(d->m_profilerState, return);
switch (d->m_profilerState->currentState()) {
case QmlProfilerStateManager::AppRunning : {
if (success)
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying);
else
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppKilled);
AnalyzerManager::stopTool();
runControlFinished();

View File

@@ -62,7 +62,7 @@ public slots:
void stopEngine();
private slots:
void notifyRemoteFinished(bool success = true);
void notifyRemoteFinished();
void cancelProcess();
void logApplicationMessage(const QString &msg, Utils::OutputFormat format);

View File

@@ -113,7 +113,7 @@ void QnxAnalyzeSupport::handleRemoteProcessFinished(bool success)
if (!success)
showMessage(tr("The %1 process closed unexpectedly.").arg(executable()),
Utils::NormalMessageFormat);
m_runControl->notifyRemoteFinished(success);
m_runControl->notifyRemoteFinished();
m_slog2Info->stop();
}

View File

@@ -160,7 +160,7 @@ void RemoteLinuxAnalyzeSupport::handleAppRunnerFinished(bool success)
reset();
if (!success)
showMessage(tr("Failure running remote process."), Utils::NormalMessageFormat);
d->runControl->notifyRemoteFinished(success);
d->runControl->notifyRemoteFinished();
}
void RemoteLinuxAnalyzeSupport::handleProfilingFinished()