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

Commit 50799a99 authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Fix for Autofill calling WebView.getSettings on background thread.

Autofill was reading the WebView's WebSettings on a background thread.
Move it to the UI thread to conform to the WebView API and get rid of a
Strict Mode violation.

Bug: 5072283
Change-Id: Ib0ac60697f1e629ac1ef1743545b5cf0ac2cf52a
parent 142d7575
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4701,6 +4701,7 @@ public class WebView extends AbsoluteLayout
        private Message mUpdateMessage;
        private boolean mAutoFillable;
        private boolean mAutoComplete;
        private WebSettings mWebSettings;

        public RequestFormData(String name, String url, Message msg,
                boolean autoFillable, boolean autoComplete) {
@@ -4709,6 +4710,7 @@ public class WebView extends AbsoluteLayout
            mUpdateMessage = msg;
            mAutoFillable = autoFillable;
            mAutoComplete = autoComplete;
            mWebSettings = getSettings();
        }

        public void run() {
@@ -4718,8 +4720,7 @@ public class WebView extends AbsoluteLayout
                // Note that code inside the adapter click handler in WebTextView depends
                // on the AutoFill item being at the top of the drop down list. If you change
                // the order, make sure to do it there too!
                WebSettings settings = getSettings();
                if (settings != null && settings.getAutoFillProfile() != null) {
                if (mWebSettings != null && mWebSettings.getAutoFillProfile() != null) {
                    pastEntries.add(getResources().getText(
                            com.android.internal.R.string.autofill_this_form).toString() +
                            " " +