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

Change-Id: Ia2553321230fec4202fa064cdc66ffd13d005281
This commit is contained in:
Winson Chung
2012-06-11 13:57:49 -07:00
parent 478244409e
commit d9e20bfba5
2 changed files with 15 additions and 11 deletions
@@ -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();