From ef67165a877b1cd17d4afc6e2e17caa97fc399f2 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 25 Nov 2010 17:17:58 +0000 Subject: Make BrowserSettings.loadFromDb asynchronous loadFromDb does a lot of disk IO, including accessing SQLite and SharedPreferences. This should not be done on the UI thread. With this patch we move it into an AsyncTask. However there is one caveat with this solution - all settings must be read and sent to WebCore before BrowserActivity.onCreate is called so we must block there if the async task is not complete. This is better than doing the IO on the UI thread though and fixes a load of Browser StrictMode violations. Change-Id: I0ab37ee9e95c682a59d6170a1327ae4ad1deceec --- src/com/android/browser/Browser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/android/browser/Browser.java') diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java index 7822ec88f..97b99672a 100644 --- a/src/com/android/browser/Browser.java +++ b/src/com/android/browser/Browser.java @@ -57,7 +57,7 @@ public class Browser extends Application { CookieSyncManager.createInstance(this); // remove all expired cookies CookieManager.getInstance().removeExpiredCookie(); - BrowserSettings.getInstance().loadFromDb(this); + BrowserSettings.getInstance().asyncLoadFromDb(this); } static Intent createBrowserViewIntent() { -- cgit v1.2.3