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

Commit d9597642 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android Git Automerger
Browse files

am 512234f1: Merge "Close input session when the view is detached from the window." into mnc-dev

* commit '512234f1':
  Close input session when the view is detached from the window.
parents d323f6cf 512234f1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -14506,6 +14506,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        onDetachedFromWindow();
        onDetachedFromWindowInternal();
        InputMethodManager imm = InputMethodManager.peekInstance();
        if (imm != null) {
            imm.onViewDetachedFromWindow(this);
        }
        ListenerInfo li = mListenerInfo;
        final CopyOnWriteArrayList<OnAttachStateChangeListener> listeners =
                li != null ? li.mOnAttachStateChangeListeners : null;
+16 −0
Original line number Diff line number Diff line
@@ -1320,6 +1320,22 @@ public final class InputMethodManager {
        }
    }

    /**
     * Call this when a view is being detached from a {@link android.view.Window}.
     * @hide
     */
    public void onViewDetachedFromWindow(View view) {
        synchronized (mH) {
            if (DEBUG) Log.v(TAG, "onViewDetachedFromWindow: " + view
                    + " mServedView=" + mServedView
                    + " hasWindowFocus=" + view.hasWindowFocus());
            if (mServedView == view && view.hasWindowFocus()) {
                mNextServedView = null;
                scheduleCheckFocusLocked(view);
            }
        }
    }

    static void scheduleCheckFocusLocked(View view) {
        ViewRootImpl viewRootImpl = view.getViewRootImpl();
        if (viewRootImpl != null) {