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

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

am 5ad7fe49: Merge "Update IME focus when the active view is losing the focus." into mnc-dev

* commit '5ad7fe49':
  Update IME focus when the active view is losing the focus.
parents 6fbcaaa0 5ad7fe49
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -2018,7 +2018,6 @@ public final class ViewRootImpl implements ViewParent,
                mLastWasImTarget = imTarget;
                InputMethodManager imm = InputMethodManager.peekInstance();
                if (imm != null && imTarget) {
                    imm.startGettingWindowFocus(mView);
                    imm.onWindowFocus(mView, mView.findFocus(),
                            mWindowAttributes.softInputMode,
                            !mHasHadWindowFocus, mWindowAttributes.flags);
@@ -3322,10 +3321,6 @@ public final class ViewRootImpl implements ViewParent,

                    InputMethodManager imm = InputMethodManager.peekInstance();
                    if (mView != null) {
                        if (hasWindowFocus && imm != null && mLastWasImTarget &&
                                !isInLocalFocusMode()) {
                            imm.startGettingWindowFocus(mView);
                        }
                        mAttachInfo.mKeyDispatchState.reset();
                        mView.dispatchWindowFocusChanged(hasWindowFocus);
                        mAttachInfo.mTreeObserver.dispatchOnWindowFocusChange(hasWindowFocus);
+7 −29
Original line number Diff line number Diff line
@@ -282,11 +282,6 @@ public final class InputMethodManager {
    
    // -----------------------------------------------------------

    /**
     * This is the root view of the overall window that currently has input
     * method focus.
     */
    View mCurRootView;
    /**
     * This is the view that should currently be served by an input method,
     * regardless of the state of setting that up.
@@ -806,7 +801,6 @@ public final class InputMethodManager {
     * Disconnect any existing input connection, clearing the served view.
     */
    void finishInputLocked() {
        mCurRootView = null;
        mNextServedView = null;
        if (mServedView != null) {
            if (DEBUG) Log.v(TAG, "FINISH INPUT: " + mServedView);
@@ -1290,10 +1284,9 @@ public final class InputMethodManager {
    void focusInLocked(View view) {
        if (DEBUG) Log.v(TAG, "focusIn: " + view);
        
        if (mCurRootView != view.getRootView()) {
            // This is a request from a window that isn't in the window with
            // IME focus, so ignore it.
            if (DEBUG) Log.v(TAG, "Not IME target window, ignoring");
        if (!view.hasWindowFocus()) {
            // This is a request from a window that doesn't have window focus, so ignore it.
            if (DEBUG) Log.v(TAG, "Not focused window, ignoring");
            return;
        }
        
@@ -1310,19 +1303,12 @@ public final class InputMethodManager {
            if (DEBUG) Log.v(TAG, "focusOut: " + view
                    + " mServedView=" + mServedView
                    + " winFocus=" + view.hasWindowFocus());
            if (mServedView != view) {
                // The following code would auto-hide the IME if we end up
                // with no more views with focus.  This can happen, however,
                // whenever we go into touch mode, so it ends up hiding
                // at times when we don't really want it to.  For now it
                // seems better to just turn it all off.
                if (false && view.hasWindowFocus()) {
            if (mServedView == view && view.hasWindowFocus()) {
                mNextServedView = null;
                scheduleCheckFocusLocked(view);
            }
        }
    }
    }

    static void scheduleCheckFocusLocked(View view) {
        ViewRootImpl viewRootImpl = view.getViewRootImpl();
@@ -1442,13 +1428,6 @@ public final class InputMethodManager {
        }
    }
    
    /** @hide */
    public void startGettingWindowFocus(View rootView) {
        synchronized (mH) {
            mCurRootView = rootView;
        }
    }
    
    /**
     * Report the current selection range.
     *
@@ -2156,7 +2135,6 @@ public final class InputMethodManager {
                + " mBindSequence=" + mBindSequence
                + " mCurId=" + mCurId);
        p.println("  mCurMethod=" + mCurMethod);
        p.println("  mCurRootView=" + mCurRootView);
        p.println("  mServedView=" + mServedView);
        p.println("  mNextServedView=" + mNextServedView);
        p.println("  mServedConnecting=" + mServedConnecting);
+0 −1
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ public class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
    }

    public void showSoftInput() {
        mInput.startGettingWindowFocus(mEditText.getRootView());
        mInput.focusIn(mEditText);
        mInput.showSoftInput(mEditText, 0);
    }