Bug 797151 - Use Froyo api for saving SharedPrefereces. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Tue, 02 Oct 2012 18:58:03 -0700
changeset 115280 7c779b27a9cebd5ff246c32d99f32f7b6be797b2
parent 115279 0b9c37de03a2b7cd7a9635f0ec77672ab8839444
child 115281 e444e0facfb56663bff8adcfcb659daa9c3248c1
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs797151
milestone18.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 797151 - Use Froyo api for saving SharedPrefereces. r=mfinkle
mobile/android/base/WebAppAllocator.java
--- a/mobile/android/base/WebAppAllocator.java
+++ b/mobile/android/base/WebAppAllocator.java
@@ -118,15 +118,19 @@ public class WebAppAllocator {
         int index = getIndexForApp(app);
         if (index == -1)
             return -1;
 
         releaseIndex(index);
         return index;
     }
 
-    public synchronized void releaseIndex(int index) {
-        mPrefs.edit()
-            .remove(appKey(index))
-            .remove(iconKey(index))
-            .apply();
+    public synchronized void releaseIndex(final int index) {
+        GeckoBackgroundThread.getHandler().post(new Runnable() {
+            public void run() {
+                mPrefs.edit()
+                    .remove(appKey(index))
+                    .remove(iconKey(index))
+                    .commit();
+            }
+        });
     }
 }