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
Pick-to: 6.8
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>
This commit is contained in:
Tinja Paavoseppä 2024-11-26 14:20:52 +02:00 committed by Qt Cherry-pick Bot
parent fbc78ff287
commit 2bebec177d

View File

@ -471,7 +471,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);