Bug 1061430 - Change SharedPreferences.Editor commit() to apply() where appropriate (GeckoProfile.java) r=rnewman
authorMark Finkle <mfinkle@mozilla.com>
Wed, 03 Sep 2014 02:00:42 -0400
changeset 218670 14f25bd4fc2b633cc38bf10a7d2e2ed482d377b1
parent 218669 65787da02f1905fa516ab21065094d12fda491e0
child 218671 886529efa472a06a663a9fbf025cd8fed29e6511
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1061430
milestone35.0a1
Bug 1061430 - Change SharedPreferences.Editor commit() to apply() where appropriate (GeckoProfile.java) r=rnewman
mobile/android/base/GeckoProfile.java
--- a/mobile/android/base/GeckoProfile.java
+++ b/mobile/android/base/GeckoProfile.java
@@ -181,17 +181,17 @@ public final class GeckoProfile {
         if (profile == null) {
             return false;
         }
         final boolean success = profile.remove();
 
         if (success) {
             // Clear all shared prefs for the given profile.
             GeckoSharedPrefs.forProfileName(context, profileName)
-                            .edit().clear().commit();
+                            .edit().clear().apply();
         }
 
         return success;
     }
 
     public static GeckoProfile createGuestProfile(Context context) {
         try {
             removeGuestProfile(context);
@@ -265,17 +265,17 @@ public final class GeckoProfile {
             }
         } catch (Exception ex) {
             Log.e(LOGTAG, "Error removing guest profile", ex);
         }
 
         if (success) {
             // Clear all shared prefs for the guest profile.
             GeckoSharedPrefs.forProfileName(context, GUEST_PROFILE)
-                            .edit().clear().commit();
+                            .edit().clear().apply();
         }
     }
 
     public static boolean delete(File file) throws IOException {
         // Try to do a quick initial delete
         if (file.delete())
             return true;