diff options
author | Ben Murdoch <benm@google.com> | 2010-11-25 17:17:58 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-11-26 10:10:33 +0000 |
commit | ef67165a877b1cd17d4afc6e2e17caa97fc399f2 (patch) | |
tree | 718a0a805936360214e65758ea2bce419e81f2fe /src/com/android/browser/Browser.java | |
parent | 50438d9205f5bebc9f3cefd8e00ae37850e2eb4d (diff) | |
download | packages_apps_Browser-ef67165a877b1cd17d4afc6e2e17caa97fc399f2.zip packages_apps_Browser-ef67165a877b1cd17d4afc6e2e17caa97fc399f2.tar.gz packages_apps_Browser-ef67165a877b1cd17d4afc6e2e17caa97fc399f2.tar.bz2 |
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
Diffstat (limited to 'src/com/android/browser/Browser.java')
-rw-r--r-- | src/com/android/browser/Browser.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java index 7822ec8..97b9967 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() { |