summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjnihelpers_p.h
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2022-03-27 15:50:42 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2022-04-05 12:06:23 +0300
commit8bca441b6f65c532915cf3e93ecbe8a5cd2750a9 (patch)
treee134e6c57cce7fb5149391fbfada50428af256f0 /src/corelib/kernel/qjnihelpers_p.h
parente6c80fc01179a0752357bad35d3e9e9068c4be84 (diff)
Android: Fix deadlock caused by a race between permissions query and IM
Android permissions query blocks Qt main thread. If the input method was activated before the permissions query started, android would try to invoke input method before returning back to permissions query. This will cause a deadlock. Fix the issue by moving the deadlock counter to Qt core and incrementing the value before the permissions query. This will prevent the input method queries to enter Qt main thread. Fixes: QTBUG-99484 Pick-to: 6.2 6.3 6.3.0 Change-Id: I54ea59578880cde4095c26fa2a6a264c4dc1b7ff Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/corelib/kernel/qjnihelpers_p.h')
-rw-r--r--src/corelib/kernel/qjnihelpers_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qjnihelpers_p.h b/src/corelib/kernel/qjnihelpers_p.h
index 2860cef4c3..c89c33b51e 100644
--- a/src/corelib/kernel/qjnihelpers_p.h
+++ b/src/corelib/kernel/qjnihelpers_p.h
@@ -137,6 +137,9 @@ namespace QtAndroidPrivate
Q_CORE_EXPORT int acuqireServiceSetup(int flags);
Q_CORE_EXPORT void setOnBindListener(OnBindListener *listener);
Q_CORE_EXPORT jobject callOnBindListener(jobject intent);
+
+ Q_CORE_EXPORT bool acquireAndroidDeadlockProtector();
+ Q_CORE_EXPORT void releaseAndroidDeadlockProtector();
}
#define Q_JNI_FIND_AND_CHECK_CLASS(CLASS_NAME) \