Android: Quit hosting Context only when app is entirely Qt

When quitting Qt, only quit the hosting Activity or Service if it's
primarily a Qt app, i.e. Qt is in the driver's seat. When using QtQuick
for Android, i.e. Qt is just a View, we do not want to forcefully quit
Activities, that is up to the app code.

Task-number: QTBUG-123711
Change-Id: Ib98700be8693c3d30a296998b863b0f224c9bf69
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3bcf55daa597888fcf0997e7ce2edd1d4c730a2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2bebec177dc25c620e79077de8884eacfd9d7962)
bb10
Tinja Paavoseppä 2024-11-26 14:20:52 +02:00 committed by Qt Cherry-pick Bot
parent 4dbdb57358
commit 758ae0432d
1 changed files with 1 additions and 1 deletions

View File

@ -468,7 +468,7 @@ static void startQtApplication(JNIEnv */*env*/, jclass /*clazz*/)
qWarning() << "dlclose failed:" << dlerror();
}
if (m_applicationClass)
if (m_applicationClass && QtAndroid::isQtApplication())
QJniObject::callStaticMethod<void>(m_applicationClass, "quitApp", "()V");
sem_post(&m_terminateSemaphore);