From 50799a99484d50d79edab2ec6d64ad3287ed03f8 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Mon, 25 Jul 2011 11:35:45 +0100 Subject: 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 --- core/java/android/webkit/WebView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 6a3b2ffefae1..e24ab58503ad 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -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() + " " + -- cgit v1.2.3-59-g8ed1b