summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BrowserSettings.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-08-17 11:27:15 -0700
committerJohn Reck <jreck@google.com>2011-08-17 11:40:31 -0700
commitc477e71ec9b3b65d6ef633d4e536ae6cc19dd0f9 (patch)
tree8bd51d60aa0448615701e4e4148f3e84b490f1f4 /src/com/android/browser/BrowserSettings.java
parentbb29699e9fdb65f7a194c3cc46c124c578f5a22e (diff)
downloadandroid_packages_apps_Gello-c477e71ec9b3b65d6ef633d4e536ae6cc19dd0f9.tar.gz
android_packages_apps_Gello-c477e71ec9b3b65d6ef633d4e536ae6cc19dd0f9.tar.bz2
android_packages_apps_Gello-c477e71ec9b3b65d6ef633d4e536ae6cc19dd0f9.zip
More BrowserSettings initialization shuffling
Bug: 5019676 BrowserSettings.setController required early initialization. Tweak it so that syncSharedSettings is called as late as possible Change-Id: I16ab56d9f2e31faf1a108808069c29c76a2627c2
Diffstat (limited to 'src/com/android/browser/BrowserSettings.java')
-rw-r--r--src/com/android/browser/BrowserSettings.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index d4f1ba33..09c72007 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -103,6 +103,7 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
private AutofillHandler mAutofillHandler;
private WeakHashMap<WebSettings, String> mCustomUserAgents;
private static boolean sInitialized = false;
+ private boolean mNeedsSharedSync = true;
// Cached values
private int mPageCacheCapacity = 1;
@@ -134,7 +135,9 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
public void setController(Controller controller) {
mController = controller;
- syncSharedSettings();
+ if (sInitialized) {
+ syncSharedSettings();
+ }
if (mController != null && (mSearchEngine instanceof InstantSearchEngine)) {
((InstantSearchEngine) mSearchEngine).setController(mController);
@@ -142,6 +145,9 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
}
public void startManagingSettings(WebSettings settings) {
+ if (mNeedsSharedSync) {
+ syncSharedSettings();
+ }
synchronized (mManagedSettings) {
syncStaticSettings(settings);
syncSetting(settings);
@@ -290,6 +296,7 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
}
private void syncSharedSettings() {
+ mNeedsSharedSync = false;
CookieManager.getInstance().setAcceptCookie(acceptCookies());
if (mController != null) {
mController.setShouldShowErrorConsole(enableJavascriptConsole());
@@ -405,6 +412,7 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
}
public boolean isDebugEnabled() {
+ requireInitialization();
return mPrefs.getBoolean(PREF_DEBUG_MENU, false);
}