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 6.9
Change-Id: Ib98700be8693c3d30a296998b863b0f224c9bf69
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Tinja Paavoseppä 2024-11-26 14:20:52 +02:00
parent be33f2d323
commit 3bcf55daa5

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);