mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
am 898f152d: Merge "Adding additional synchronized blocks when committing changes to the new-apps list. (Bug 6621553)" into jb-dev
* commit '898f152d79e06828675361a176772cdf1cef56ca': Adding additional synchronized blocks when committing changes to the new-apps list. (Bug 6621553)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -148,14 +148,16 @@ public class UninstallShortcutReceiver extends BroadcastReceiver {
|
||||
final Set<String> savedNewApps = newApps;
|
||||
new Thread("setNewAppsThread-remove") {
|
||||
public void run() {
|
||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
||||
editor.putStringSet(InstallShortcutReceiver.NEW_APPS_LIST_KEY,
|
||||
savedNewApps);
|
||||
if (savedNewApps.isEmpty()) {
|
||||
// Reset the page index if there are no more items
|
||||
editor.putInt(InstallShortcutReceiver.NEW_APPS_PAGE_KEY, -1);
|
||||
synchronized (savedNewApps) {
|
||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
||||
editor.putStringSet(InstallShortcutReceiver.NEW_APPS_LIST_KEY,
|
||||
savedNewApps);
|
||||
if (savedNewApps.isEmpty()) {
|
||||
// Reset the page index if there are no more items
|
||||
editor.putInt(InstallShortcutReceiver.NEW_APPS_PAGE_KEY, -1);
|
||||
}
|
||||
editor.commit();
|
||||
}
|
||||
editor.commit();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user