Skip to content
Commit 38be9e32 authored by Shan Huang's avatar Shan Huang
Browse files

Migrate InputMethodService to use OnBackInvokedDispatcher

We currently close the IME by having the target application forward
KEYCODE_BACK to the IME process through InputMethodManager#dispatchInputEvent and having the IME handle the keycode in InputMethodService#onKeyDown. When apps opt in to OnBackInvokedDispatcher API, we will not dispatch KEYCODE_BACK to apps anymore. Thus we need to migrate IME to the new API for it to close on back invocation.

This CL migrates the client side IME code to register and unregister callbacks, and also updates the WM side logic to make sure IME callback priority works correctly with other application callbacks.

Test: In BackTestApp home activity, Show IME -> try swipe back. Open WidgetTestActivity, show IME by clicking on EditText -> try swipe back.
Test: Install Micrsoft SwiftKey. Set as primary IME. Repeat the above
steps in BackTestApp and make sure IME behaves correctly.

Bug: 228358882

Change-Id: Idb246cf1858a7515f6fc34a5ccde33f25f56d404
parent 6585242e
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