diff options
| author | Ming-Shin Lu <lumark@google.com> | 2021-04-10 00:17:35 +0800 |
|---|---|---|
| committer | Ming-Shin Lu <lumark@google.com> | 2021-04-27 01:34:12 +0800 |
| commit | 2c8068c98a96a5439d1fdd537eee1f1729f7fab4 (patch) | |
| tree | 6db00be03e9c28b46959eb7bebd414b5f215cad6 /core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java | |
| parent | 4255d3626723c8e82198516da4c09fd2fb6ae542 (diff) | |
Consolidate InputMethodManager#toggleSoftInput reliability
As previously InputMethodManager#toggleSoftInput is designed to tell
InputMethodService directly through IInputMethodSession to toggle
soft-keyboard visibility, this could be happened some unexpected IME
visibility issues that when the app calling this method in the wrong
state like the app toggling IME visibility when the app is off-screen
but unexpectedly it ends up showing soft-keyboard when the IME is in
invisible state.
To minimize the app compatibility without changing the public API
surface and reducing unexpected IME visibilty been toggled behavior
especially happens when switching the apps, changed the internal IPC
protocols to call IMMS#showSoftInput or IMMS#hideSoftInput directly
according the previous IME consumer requested visibility state,
so that in IMMS side can validate to see if the token user is
still focused and ready to toggle the IME visibility to show or hide.
As the result, we deprecated toggleSoftInput and
toggleSoftInputFromWindow to state the reason as the above, and
recommand to use showSoftInput or hideSoftInputFromWindow instead,
so that framework side no longer has to call {InputMethodSessionWrapper,
InputMethodSessionImpl}#toggleSoftInput.
Bug: 182071625
Test: m checkapi doc-comment-check-docs
Test: atest KeyboardVisibilityControlTest#testToggleSoftInput
Change-Id: I390dc029e7bcc30c200926a9bfbbbd0268a1f714
Diffstat (limited to 'core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java')
| -rw-r--r-- | core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java b/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java index 4b02085726f1..0a2316508f09 100644 --- a/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java +++ b/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java @@ -167,16 +167,6 @@ public final class MultiClientInputMethodServiceDelegate { /** * Called when the associated IME client called {@link - * android.view.inputmethod.InputMethodManager#toggleSoftInput(int, int)}. - * - * @param showFlags The flag passed by the client. - * @param hideFlags The flag passed by the client. - * @see android.inputmethodservice.InputMethodService#onToggleSoftInput(int, int) - */ - void onToggleSoftInput(int showFlags, int hideFlags); - - /** - * Called when the associated IME client called {@link * android.view.inputmethod.InputMethodManager#updateCursorAnchorInfo(View, * CursorAnchorInfo)}. * |
