summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-07-25 11:35:45 +0100
committerBen Murdoch <benm@google.com>2011-07-25 11:35:45 +0100
commit50799a99484d50d79edab2ec6d64ad3287ed03f8 (patch)
treee67cf0fa172f22027ee3e28f86c1e5a2dec387f0
parent142d7575b52d03d46246e3b142e22ebc32d45a84 (diff)
downloadframeworks_base-50799a99484d50d79edab2ec6d64ad3287ed03f8.zip
frameworks_base-50799a99484d50d79edab2ec6d64ad3287ed03f8.tar.gz
frameworks_base-50799a99484d50d79edab2ec6d64ad3287ed03f8.tar.bz2
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
-rw-r--r--core/java/android/webkit/WebView.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 6a3b2ff..e24ab58 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() +
" " +