Reset to default did not reset cached settings
Some settings such as the current search engine to use was cached
in the BrowserSetting object and not always read from shared
preferences. When settings were reset to default these cached values
were not reset causing the old (possibly non-default) value to still
be used.
Change-Id: I805a339a6238c96dc73cbda47981053bd4f6eace
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 8dfd4d7..7d3195a 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -506,9 +506,14 @@
.clear()
.putLong(GoogleAccountLogin.PREF_AUTOLOGIN_TIME, gal)
.apply();
+ resetCachedValues();
syncManagedSettings();
}
+ private void resetCachedValues() {
+ updateSearchEngine(false);
+ }
+
public AutoFillProfile getAutoFillProfile() {
return mAutofillHandler.getAutoFillProfile();
}