Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8eb7be5b authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Fix deadlock in IMMS checking hasNavigationBar

Since allowing IMEs to request hiding the fake IME navigation bar in
[1], we found that this would still be shown on emulator, which has
no system navigation bar, and would thus break some tests. This was
fixed in [2], but it looks like that fix can trigger a deadlock as it
goes through calling WindowManagerGlobal.getWindowManagerService, which
tries to acquire the lock on that class.

Instead, I added a path to call hasNavigationBar through
WindowManagerInternal, which also skips the IPC step. This will still
require the WindowManagerGlobalLock, but the internal class is currently
used throughout InputMethodManagerService, so it should be safe here.

  [1]: I8793db69fb846046300d5a56b3b0060138ef4cd5
  [2]: Ide89075836a527d806f28cbeeb8d90334b79428f

Test: atest InputMethodServiceTest#testNoNavigationBar_thenImeNoCaptionBar
Bug: 300359571
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d136b9bd629295c996367ed01f96a5f3fa658dc7)

Merged-In: I4d7a062a9abeaf59218505d384f94e04e1a8ed74
Change-Id: I4d7a062a9abeaf59218505d384f94e04e1a8ed74
parent c6d3bf6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment