Offer to delete broken promise icons.
Track state of promise in the info, not the view.
Fix bugs around moving promises to folders.
Fix bugs around filterign and removing promises.
Bug: 12764789
Change-Id: If5e8b6d315e463154b5bafe8aef7ef4f9889bb95
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 07389c9..4d0ec78 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -2975,6 +2975,7 @@
info.setIcon(mIconCache.getIcon(intent, info.title.toString(), info.user));
info.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
info.restoredIntent = intent;
+ info.setState(ShortcutInfo.PACKAGE_STATE_UNKNOWN);
return info;
}
@@ -3088,6 +3089,9 @@
if (i instanceof ShortcutInfo) {
ShortcutInfo info = (ShortcutInfo) i;
ComponentName cn = info.intent.getComponent();
+ if (info.restoredIntent != null) {
+ cn = info.restoredIntent.getComponent();
+ }
if (cn != null && f.filterItem(null, info, cn)) {
filtered.add(info);
}
@@ -3095,6 +3099,9 @@
FolderInfo info = (FolderInfo) i;
for (ShortcutInfo s : info.contents) {
ComponentName cn = s.intent.getComponent();
+ if (s.restoredIntent != null) {
+ cn = s.restoredIntent.getComponent();
+ }
if (cn != null && f.filterItem(info, s, cn)) {
filtered.add(s);
}