diff options
author | Winson Chung <winsonc@google.com> | 2013-07-24 15:33:46 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-07-26 12:58:45 -0700 |
commit | 997a92348a6d6e061737399321393449c16cd4d8 (patch) | |
tree | ee2cb2a37a4009cbcfcd0d45e6b9f8caad653ac1 /src/com/android/launcher3/UninstallShortcutReceiver.java | |
parent | bffe745b1e195deedc1dcc60f37950b3b0b4c652 (diff) | |
download | android_packages_apps_Trebuchet-997a92348a6d6e061737399321393449c16cd4d8.tar.gz android_packages_apps_Trebuchet-997a92348a6d6e061737399321393449c16cd4d8.tar.bz2 android_packages_apps_Trebuchet-997a92348a6d6e061737399321393449c16cd4d8.zip |
Removing old new-app animation code, and refactoring InstallShortcutReceiver to use new add/bind logic.
Change-Id: Ide27dbcf1d1b1631fcd33a6c54a51b31e125c2f4
Diffstat (limited to 'src/com/android/launcher3/UninstallShortcutReceiver.java')
-rw-r--r-- | src/com/android/launcher3/UninstallShortcutReceiver.java | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/com/android/launcher3/UninstallShortcutReceiver.java b/src/com/android/launcher3/UninstallShortcutReceiver.java index 8e968cd76..2e1ed6967 100644 --- a/src/com/android/launcher3/UninstallShortcutReceiver.java +++ b/src/com/android/launcher3/UninstallShortcutReceiver.java @@ -79,19 +79,15 @@ public class UninstallShortcutReceiver extends BroadcastReceiver { private static void processUninstallShortcut(Context context, PendingUninstallShortcutInfo pendingInfo) { - String spKey = LauncherAppState.getSharedPreferencesKey(); - SharedPreferences sharedPrefs = context.getSharedPreferences(spKey, Context.MODE_PRIVATE); - final Intent data = pendingInfo.data; LauncherAppState app = LauncherAppState.getInstance(); synchronized (app) { // TODO: make removeShortcut internally threadsafe - removeShortcut(context, data, sharedPrefs); + removeShortcut(context, data); } } - private static void removeShortcut(Context context, Intent data, - final SharedPreferences sharedPrefs) { + private static void removeShortcut(Context context, Intent data) { Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT); String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME); boolean duplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true); @@ -132,33 +128,6 @@ public class UninstallShortcutReceiver extends BroadcastReceiver { Toast.makeText(context, context.getString(R.string.shortcut_uninstalled, name), Toast.LENGTH_SHORT).show(); } - - // Remove any items due to be animated - boolean appRemoved; - Set<String> newApps = new HashSet<String>(); - newApps = sharedPrefs.getStringSet(InstallShortcutReceiver.NEW_APPS_LIST_KEY, newApps); - synchronized (newApps) { - do { - appRemoved = newApps.remove(intent.toUri(0).toString()); - } while (appRemoved); - } - if (appRemoved) { - final Set<String> savedNewApps = newApps; - new Thread("setNewAppsThread-remove") { - public void run() { - 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(); - } - } - }.start(); - } } } } |