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

Commit 35e06276 authored by Felix Stern's avatar Felix Stern
Browse files

Copy requestedImeVisible state also if stylus is used

By not copying the previous requested IME state when using stylus, InputMethodService#showSoftInput won't be called. In some cases, the IME was therefore stuck.

Change-Id: Ie808e18a28b34c4c41eedc84a63c1e801ac1d4cc
Fix: 384608941
Test: StylusHandwritingTest#testOnViewClicked_withStylusTap
Flag: android.view.inputmethod.refactor_insets_controller
parent f120014b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -387,8 +387,9 @@ public final class ImeVisibilityStateComputer {
    @GuardedBy("ImfLock.class")
    void setWindowState(IBinder windowToken, @NonNull ImeTargetWindowState newState) {
        final ImeTargetWindowState state = mRequestWindowStateMap.get(windowToken);
        if (state != null && newState.hasEditorFocused()
                && newState.mToolType != MotionEvent.TOOL_TYPE_STYLUS) {
        if (state != null && newState.hasEditorFocused() && (
                newState.mToolType != MotionEvent.TOOL_TYPE_STYLUS
                        || Flags.refactorInsetsController())) {
            // Inherit the last requested IME visible state when the target window is still
            // focused with an editor.
            newState.setRequestedImeVisible(state.mRequestedImeVisible);