Skip to content

Android A11Y: Fix deadlock in QtAndroidAccessibility::runInObjectContext()

Shivodit Gill requested to merge shivodayt/qtbase:a11y-crash-fix into kde/5.15

This commit is necessary to fix deadlock-related crashes that occur in the Android version of Okular when opening files.

On android the event loop is normally blocked, when the application
is suspended, e.g. when it enters the background or when the screen is
locked (see This leads to a problem
when we try to process events after this happens, e.g. when android
sends us an ACTION_CLEAR_ACCESSIBILITY_FOCUS event after the event loop
is suspended. While handling it we eventually call
QtAndroidAccessibility::runInObjectContext() which tries to do a
blocking call on the object context, however, with the event loop being
suspended we run into a deadlock which leads to an ANR.  So we need to
make sure to never make a blocking call while the event loop is

Task-number: QTBUG-102594
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I33f0440a3da84fb4bdae5ab0fc10d514c73f23ad
Reviewed-by: Assam Boudjelthia <>
(cherry picked from commit ac984bd8768b3d7e6439e0ffd98fd8b53e16b922)

Merge request reports