diff options
author | Winson Chung <winsonc@google.com> | 2012-05-03 12:31:48 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-05-04 10:23:38 -0700 |
commit | 2efec4e29f80db4293664d3ed4a89d37454510e1 (patch) | |
tree | 59eb668e5c7e4cb4a7ba97994a0dcc49c884c096 /src/com/android/launcher2/LauncherModel.java | |
parent | 2ceccf83f479d4e161a5f87ee51b21230600abef (diff) | |
download | android_packages_apps_Trebuchet-2efec4e29f80db4293664d3ed4a89d37454510e1.tar.gz android_packages_apps_Trebuchet-2efec4e29f80db4293664d3ed4a89d37454510e1.tar.bz2 android_packages_apps_Trebuchet-2efec4e29f80db4293664d3ed4a89d37454510e1.zip |
Fixing issue where items that were not yet added were not removed from the db. (Bug 6428418)
Change-Id: I8f76af1ccaa2bc5053f3e1f6606202310855aaae
Diffstat (limited to 'src/com/android/launcher2/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index b76df39c6..ff4abc6b3 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -1675,6 +1675,24 @@ 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 (info.intent.getPackage().equals(packageName)) { + 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 */ |