Adding additional synchronized blocks when committing changes to the new-apps list. (Bug 6621553)

Change-Id: Ia2553321230fec4202fa064cdc66ffd13d005281
This commit is contained in:
Winson Chung committed 2012-06-11 13:58:30 -07:00
1 parent 478244409e
commit d9e20bfba5
2 files changed
+15 -11

No files matched your search

@@ -191,10 +191,12 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
final Set<String> savedNewApps = newApps;
new Thread("setNewAppsThread") {
public void run() {
sharedPrefs.edit()
.putInt(NEW_APPS_PAGE_KEY, screen)
.putStringSet(NEW_APPS_LIST_KEY, savedNewApps)
.commit();
synchronized (savedNewApps) {
sharedPrefs.edit()
.putInt(NEW_APPS_PAGE_KEY, screen)
.putStringSet(NEW_APPS_LIST_KEY, savedNewApps)
.commit();
}
}
}.start();