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

Commit 71d17e40 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Only close the IME if it is Active on the WebView.

Bug: 2955391

Some applications want to leave the IME open even though
the WebView is loading a page.  Only hide the IME if it
is Active on the WebView or the WebTextView.

Change-Id: I1e7f973f649d78561bd8585c628a83c9b18a66ad
parent e93a4921
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -594,8 +594,10 @@ import java.util.ArrayList;
     */
    /* package */ void remove() {
        // hide the soft keyboard when the edit text is out of focus
        InputMethodManager.getInstance(mContext).hideSoftInputFromWindow(
                getWindowToken(), 0);
        InputMethodManager imm = InputMethodManager.getInstance(mContext);
        if (imm.isActive(this)) {
            imm.hideSoftInputFromWindow(getWindowToken(), 0);
        }
        mWebView.removeView(this);
        mWebView.requestFocus();
    }
+4 −2
Original line number Diff line number Diff line
@@ -3701,9 +3701,11 @@ public class WebView extends AbsoluteLayout
    private void hideSoftKeyboard() {
        InputMethodManager imm = (InputMethodManager)
                getContext().getSystemService(Context.INPUT_METHOD_SERVICE);

        if (imm.isActive(this)
                || (inEditingMode() && imm.isActive(mWebTextView))) {
            imm.hideSoftInputFromWindow(this.getWindowToken(), 0);
        }
    }

    /*
     * This method checks the current focus and cursor and potentially rebuilds