Fixing issue where items that were not yet added were not removed from the db. (Bug 6428418)

Change-Id: I8f76af1ccaa2bc5053f3e1f6606202310855aaae
This commit is contained in:
Winson Chung
2012-05-03 12:31:48 -07:00
parent 2ceccf83f4
commit 2efec4e29f
2 changed files with 66 additions and 16 deletions
@@ -1674,6 +1674,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