Bug 1061430 - Change SharedPreferences.Editor commit() to apply() where appropriate (BrowserLocaleManager.java) r=rnewman
authorMark Finkle <mfinkle@mozilla.com>
Wed, 03 Sep 2014 02:00:38 -0400
changeset 203404 2a9e2fe78b5f8f34572d4436a4e2f5b487ad4e0a
parent 203403 12e1c3df054ee685209240fc9c495230a84bd31b
child 203405 65787da02f1905fa516ab21065094d12fda491e0
push id48665
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:40:15 +0000
treeherdermozilla-inbound@0da762e6868a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1061430
milestone35.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 1061430 - Change SharedPreferences.Editor commit() to apply() where appropriate (BrowserLocaleManager.java) r=rnewman
mobile/android/base/BrowserLocaleManager.java
--- a/mobile/android/base/BrowserLocaleManager.java
+++ b/mobile/android/base/BrowserLocaleManager.java
@@ -277,17 +277,17 @@ public class BrowserLocaleManager implem
 
         return resultant;
     }
 
     @Override
     public void resetToSystemLocale(Context context) {
         // Wipe the pref.
         final SharedPreferences settings = getSharedPreferences(context);
-        settings.edit().remove(PREF_LOCALE).commit();
+        settings.edit().remove(PREF_LOCALE).apply();
 
         // Apply the system locale.
         updateLocale(context, systemLocale);
 
         // Tell Gecko.
         GeckoEvent ev = GeckoEvent.createBroadcastEvent(EVENT_LOCALE_CHANGED, "");
         GeckoAppShell.sendEventToGecko(ev);
     }
@@ -319,17 +319,17 @@ public class BrowserLocaleManager implem
         if ("".equals(locale)) {
             return null;
         }
         return locale;
     }
 
     private void persistLocale(Context context, String localeCode) {
         final SharedPreferences settings = getSharedPreferences(context);
-        settings.edit().putString(PREF_LOCALE, localeCode).commit();
+        settings.edit().putString(PREF_LOCALE, localeCode).apply();
     }
 
     @Override
     public Locale getCurrentLocale(Context context) {
         if (currentLocale != null) {
             return currentLocale;
         }