Android: Do not wait for service onBind() in service embedding path

When embedding QML into an Android service, Qt is not actually running
as a service. Avoid checking for QtAndroid::Service() and assuming that
means we are running as a service.

Task-number: QTBUG-118874
Change-Id: I5eea32b9fc200c4f34f1507d591aa1a483849118
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Petri Virkkunen 2024-02-15 10:04:48 +02:00
parent aa1e658755
commit b43341f678

View File

@ -441,7 +441,7 @@ static void waitForServiceSetup(JNIEnv *env, jclass /*clazz*/)
Q_UNUSED(env);
// The service must wait until the QCoreApplication starts otherwise onBind will be
// called too early
if (QtAndroidPrivate::service().isValid())
if (QtAndroidPrivate::service().isValid() && QtAndroid::isQtApplication())
QtAndroidPrivate::waitForServiceSetup();
}