SoftInput flag requires focused View to show IME
Historically SOFT_INPUT_STATE_VISIBLE/SOFT_INPUT_STATE_ALWAYS_VISIBLE have not required focused editor View [1] to work. This is easy to use, but also easy to tell IMEs to connect to InputConnection, which is often recognized as a bug by users because often nothing happens when the user taps the software keyboard. This would become more obvious when we start allowing nothing to have focus (Bug 68841055) in Android P. Although how we should deal with "dummy InputConnection" is still an open question, ignoring these SoftInput flags for apps that target P+ when there is no focused editor view is probably better than the current behavior, where non-functional software keyboard is likely to be shown. The user is still able to show the IME by explicitly tap the edit field. As an implementation note, this CL trusts the targetSdkVersion reported from the target application process, which is in general unsafe. That said, for this particular purpose it is acceptable. [1]: focused View that returns true from View#onCheckIsTextEditor(). Bug: 69256929 Test: atest CtsInputMethodTestCases Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodUtilsTest Change-Id: I56682c7dee71d461687b9e80ab746d382fd55e0c
Loading
Please register or sign in to comment