summaryrefslogtreecommitdiff
path: root/api/api_test.go
diff options
context:
space:
mode:
author Cosmin Băieș <cosminbaies@google.com> 2025-03-13 14:22:19 +0100
committer Cosmin Băieș <cosminbaies@google.com> 2025-03-13 14:38:49 +0100
commitd49faacf566f1347ee4971fda66618c7ecbbea3c (patch)
tree8d398d0f7b706352de082221cdd4668c3cf8c1cc /api/api_test.go
parent4a2e7e3a7fd57db0f02070d9e30ed834a432b3ec (diff)
Register IME back callback in doStartInput
Normally the IME back callback is registered at the end of showWindow. However, we can get a doStartInput call without a subsequent showWindow call, and doStartInput will first doFinishInput, which will unregister the callback. If showWindow was previously called, we should try to register the callback again, so that back navigation while the IME is shown will be processed by the IME first, before the activity underneath. This lead to the callback being left unregistered due to a race condition, with the failing case order being: * ImeInsetsSourceProvider#invokeOnImeRequestedChangedListener * IMM#startInputInner * DefaultImeVisibilityApplier#performShowIme (from ImeChangedListener) * IMMS#attachNewInputLocked (from startInputInner) * IME#showSoftInput (from performShowIme) * IME#registerDefaultOnBackInvokedCallback (from showSoftInput) * IME#dispatchStartInput (from attachNewInputLocked) * IME#unregisterDefaultOnBackInvokedCallback (from dispatchStartInput) and the passing case (expected) order being: * ImeInsetsSourceProvider#invokeOnImeRequestedChangedListener * IMM#startInputInner * IMMS#attachNewInputLocked (from startInputInner) * IME#dispatchStartInput (from attachNewInputLocked) * IME#unregisterDefaultOnBackInvokedCallback (from dispatchStartInput) * DefaultImeVisibilityApplier#performShowIme (from ImeChangedListener) * IME#showSoftInput (from performShowIme) * IME#registerDefaultOnBackInvokedCallback (from showSoftInput) Flag: EXEMPT bugfix: Test: atest KeyboardVisibilityControlTest#testIMEVisibleInSplitScreenWithWindowInsetsApi Bug: 402671709 Change-Id: I0d0f823a2998a08b8dfc2b0d6e39a0a9de521b14
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions