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

Commit ebd27c99 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge "Fix IME be dismissed abruptly" into sc-dev

parents e7276c82 e525c014
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -3372,9 +3372,9 @@ public final class ViewRootImpl implements ViewParent,
        }
        // TODO (b/131181940): Make sure this doesn't leak Activity with mActivityConfigCallback
        // config changes.
        final View focusedView = mView != null ? mView.findFocus() : null;
        if (hasWindowFocus) {
            mInsetsController.onWindowFocusGained(focusedView != null /* hasViewFocused */);
            mInsetsController.onWindowFocusGained(
                    getFocusedViewOrNull() != null /* hasViewFocused */);
        } else {
            mInsetsController.onWindowFocusLost();
        }
@@ -3423,7 +3423,8 @@ public final class ViewRootImpl implements ViewParent,

            // Note: must be done after the focus change callbacks,
            // so all of the view state is set up correctly.
            mImeFocusController.onPostWindowFocus(focusedView, hasWindowFocus, mWindowAttributes);
            mImeFocusController.onPostWindowFocus(
                    getFocusedViewOrNull(), hasWindowFocus, mWindowAttributes);

            if (hasWindowFocus) {
                // Clear the forward bit.  We can just do this directly, since
@@ -6392,6 +6393,11 @@ public final class ViewRootImpl implements ViewParent,
        mView.dispatchTooltipHoverEvent(event);
    }

    @Nullable
    private View getFocusedViewOrNull() {
        return mView != null ? mView.findFocus() : null;
    }

    /**
     * Performs synthesis of new input events from unhandled input events.
     */