diff options
author | Winson Chung <winsonc@google.com> | 2012-06-28 14:02:31 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-28 14:02:31 -0700 |
commit | 1e96390f51630f6b277b6ccf31e090c134891f95 (patch) | |
tree | 703bd8dc793a7a19238242e3ce01445e83bb2ecd | |
parent | 14c5a2cdb05d17a175ff3138f1c111cb8e7bd3ad (diff) | |
parent | 42490a5aa093e5ff653b041538c9f3ddf2b3e65f (diff) | |
download | android_packages_apps_Trebuchet-1e96390f51630f6b277b6ccf31e090c134891f95.tar.gz android_packages_apps_Trebuchet-1e96390f51630f6b277b6ccf31e090c134891f95.tar.bz2 android_packages_apps_Trebuchet-1e96390f51630f6b277b6ccf31e090c134891f95.zip |
Merge "Removing unnecessary check of shortcut infos (now that we key removals off package names already). (Bug 6755420)"
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 18 | ||||
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 38 |
2 files changed, 13 insertions, 43 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 6080411b3..1657a508a 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -1722,24 +1722,6 @@ public class LauncherModel extends BroadcastReceiver { } /** - * Returns all the Workspace ShortcutInfos associated with a particular package. - * @param intent - * @return - */ - ArrayList<ShortcutInfo> getShortcutInfosForPackage(String packageName) { - ArrayList<ShortcutInfo> infos = new ArrayList<ShortcutInfo>(); - for (ItemInfo i : sWorkspaceItems) { - if (i instanceof ShortcutInfo) { - ShortcutInfo info = (ShortcutInfo) i; - if (packageName.equals(info.getPackageName())) { - infos.add(info); - } - } - } - return infos; - } - - /** * This is called from the code that adds shortcuts from the intent receiver. This * doesn't have a Cursor, but */ diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 7248950e8..feb4ed077 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -3635,11 +3635,7 @@ public class Workspace extends SmoothPagedView }); } - // It is no longer the case the BubbleTextViews correspond 1:1 with the workspace items in - // the database (and LauncherModel) since shortcuts are not added and animated in until - // the user returns to launcher. As a result, we really should be cleaning up the Db - // regardless of whether the item was added or not (unlike the logic above). This is only - // relevant for direct workspace items. + // Clean up new-apps animation list post(new Runnable() { @Override public void run() { @@ -3649,26 +3645,18 @@ public class Workspace extends SmoothPagedView Set<String> newApps = sp.getStringSet(InstallShortcutReceiver.NEW_APPS_LIST_KEY, null); - for (String packageName: packageNames) { - // Remove all items that have the same package, but were not removed above - ArrayList<ShortcutInfo> infos = - mLauncher.getModel().getShortcutInfosForPackage(packageName); - for (ShortcutInfo info : infos) { - LauncherModel.deleteItemFromDatabase(mLauncher, info); - } - // Remove all queued items that match the same package - if (newApps != null) { - synchronized (newApps) { - Iterator<String> iter = newApps.iterator(); - while (iter.hasNext()) { - try { - Intent intent = Intent.parseUri(iter.next(), 0); - String pn = ItemInfo.getPackageName(intent); - if (packageNames.contains(pn)) { - iter.remove(); - } - } catch (URISyntaxException e) {} - } + // Remove all queued items that match the same package + if (newApps != null) { + synchronized (newApps) { + Iterator<String> iter = newApps.iterator(); + while (iter.hasNext()) { + try { + Intent intent = Intent.parseUri(iter.next(), 0); + String pn = ItemInfo.getPackageName(intent); + if (packageNames.contains(pn)) { + iter.remove(); + } + } catch (URISyntaxException e) {} } } } |