Bug 833625 - Part 0: fix strict mode in titlebar pref. r=rnewman
authorChenxia Liu <liuche@mozilla.com>
Fri, 10 May 2013 20:53:41 -0700
changeset 142601 bfe5a09bd4db3d86671170a8801fecac018abf23
parent 142600 c26aa2631a5070d537371ae1c0dbf90269c2fc0b
child 142602 42adc74b087dfb48f3583fe4d1c3f4e9fb76f509
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs833625
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 833625 - Part 0: fix strict mode in titlebar pref. r=rnewman
mobile/android/base/GeckoPreferences.java
--- a/mobile/android/base/GeckoPreferences.java
+++ b/mobile/android/base/GeckoPreferences.java
@@ -550,18 +550,23 @@ public class GeckoPreferences
         };
         pref.setEntries(entries);
         pref.setEntryValues(entries);
         pref.setValueIndex(value ? 0 : 1);
         pref.setSummary(value ? entries[0] : entries[1]);
 
         pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
             @Override
-            public boolean onPreferenceChange(Preference preference, Object newValue) {
-                settings.edit()
-                        .putBoolean(BrowserToolbar.PREFS_SHOW_URL, newValue.toString().equals(entries[0]))
-                        .commit();
+            public boolean onPreferenceChange(Preference preference, final Object newValue) {
+                ThreadUtils.postToBackgroundThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        settings.edit()
+                                .putBoolean(BrowserToolbar.PREFS_SHOW_URL, newValue.toString().equals(entries[0]))
+                                .commit();
+                    }
+                });
                 pref.setSummary(newValue.toString());
                 return true;
             }
         });
     }
 }