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

Commit 40777239 authored by Leon Scroggins's avatar Leon Scroggins
Browse files

Make WebView inactive when title bar takes focus.

Bug:3296938
Change-Id: I656e8582044acf3b0e9b417f41337833fe72c181
parent b25de055
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ import junit.framework.Assert;
    private boolean mAutoFillable; // Is this textview part of an autofillable form?
    private int mQueryId;
    private boolean mAutoFillProfileIsSet;
    // Used to determine whether onFocusChanged was called as a result of
    // calling remove().
    private boolean mInsideRemove;

    // Types used with setType.  Keep in sync with CachedInput.h
    private static final int NORMAL_TEXT_FIELD = 0;
@@ -540,6 +543,11 @@ import junit.framework.Assert;
            Rect previouslyFocusedRect) {
        mFromFocusChange = true;
        super.onFocusChanged(focused, direction, previouslyFocusedRect);
        if (focused) {
            mWebView.setActive(true);
        } else if (!mInsideRemove) {
            mWebView.setActive(false);
        }
        mFromFocusChange = false;
    }

@@ -770,8 +778,10 @@ import junit.framework.Assert;
        if (imm.isActive(this)) {
            imm.hideSoftInputFromWindow(getWindowToken(), 0);
        }
        mInsideRemove = true;
        mWebView.removeView(this);
        mWebView.requestFocus();
        mInsideRemove = false;
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -5050,7 +5050,7 @@ public class WebView extends AbsoluteLayout
    public void onGlobalFocusChanged(View oldFocus, View newFocus) {
    }

    private void setActive(boolean active) {
    void setActive(boolean active) {
        if (active) {
            if (hasFocus()) {
                // If our window regained focus, and we have focus, then begin