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

Commit a607060b authored by John Reck's avatar John Reck
Browse files

Prevent adapter flickering

 Bug: 5403763
 Prevent rapidly switching between a null adapter and a valid
 adapter by only clearing if the node pointer changes or the text view
 is no longer autocompletable.

Change-Id: Ie594396db807b5ad5e1a5a0e68ec0c7677364aaf
parent afb119c5
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -892,7 +892,10 @@ import junit.framework.Assert;
     *          WebTextView represents.
     */
    /* package */ void setNodePointer(int ptr) {
        if (ptr != mNodePointer) {
            mNodePointer = ptr;
            setAdapterCustom(null);
        }
    }

    /**
@@ -1047,11 +1050,12 @@ import junit.framework.Assert;
        }
        setHint(null);
        setThreshold(1);
        boolean autoComplete = false;
        if (single) {
            mWebView.requestLabel(mWebView.nativeFocusCandidateFramePointer(),
                    mNodePointer);
            maxLength = mWebView.nativeFocusCandidateMaxLength();
            boolean autoComplete = mWebView.nativeFocusCandidateIsAutoComplete();
            autoComplete = mWebView.nativeFocusCandidateIsAutoComplete();
            if (type != PASSWORD && (mAutoFillable || autoComplete)) {
                String name = mWebView.nativeFocusCandidateName();
                if (name != null && name.length() > 0) {
@@ -1066,8 +1070,9 @@ import junit.framework.Assert;
        setInputType(inputType);
        setImeOptions(imeOptions);
        setVisibility(VISIBLE);
        AutoCompleteAdapter adapter = null;
        setAdapterCustom(adapter);
        if (!autoComplete) {
            setAdapterCustom(null);
        }
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -3241,8 +3241,7 @@ public class WebView extends AbsoluteLayout
    public void clearFormData() {
        checkThread();
        if (inEditingMode()) {
            AutoCompleteAdapter adapter = null;
            mWebTextView.setAdapterCustom(adapter);
            mWebTextView.setAdapterCustom(null);
        }
    }