diff options
| author | 2023-08-23 21:40:15 +0000 | |
|---|---|---|
| committer | 2023-08-24 00:54:38 +0000 | |
| commit | d0c879bc37d27913103fa69a7ef84ae15d27e784 (patch) | |
| tree | 8c1f2436a53ff2fafe13d9b3b4e9335d1c75b8b3 /api/api.go | |
| parent | 442bbb160e1e6a5dc877318f066a913dc1e0587f (diff) | |
Ensure the MagThumbnail view is always inflated on the main thread.
I believe this is one cause of deadlock, in addition to going against
best practice that View inflation should only run on the main thread.
At the same time:
(1a) android.bg thread: FullScreenMagnificationController locks
A11yManagerService.mLock when calling onUserStateChanged.
(1b) AudioService thread: AudioService locks A11yManager.mLock
when checking A11yManager.isTouchExplorationEnabled
Then, at the same time:
(2a) android.bg thread: FullScreenMagnificationController inflates
MagnificationThumbnail which is waiting to lock A11yManager.mLock
in order to check A11yManager.isEnabled
(2b) AudioService thread: A11yManager.isTouchExplorationEnabled is
waiting to lock A11yManagerService.mLock in order to register the
A11yManager client.
By posting the View inflation to the system_server main thread we allow
1a to release its A11yManagerService.mLock so that 2b can proceed, releasing A11yManager.mLock (locked in 1b) so that 2a can proceed.
Bug: 287127293
Test: Log the thread ID/label of the mag thumbnail layout inflation,
ensure it is the main thread
Change-Id: Ibe2574e5c83729d749befd343299fb26e3036037
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions