Show correct drop targets for All-apps predicted item drags.
This change fixes a bug where, after a user drags and drops a
predicted app from the all apps page once, dragging that item again
results in the "Remove" drop target being shown rather than the
"Do Not Suggest" drop target.
Bug: 221057278
Test: Verified correct drop down targets were present after fix when
dropping all apps prediction item on workspace multiple times in a row.
Change-Id: I95940eeebbd547861fcdfbb5d02769b82446184d
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index a7fc2f5..e3e8cc0 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2751,6 +2751,12 @@
info = ((AppInfo) info).makeWorkspaceItem();
d.dragInfo = info;
}
+ if (info instanceof WorkspaceItemInfo
+ && info.container == LauncherSettings.Favorites.CONTAINER_PREDICTION) {
+ // Came from all apps prediction row -- make a copy
+ info = new WorkspaceItemInfo((WorkspaceItemInfo) info);
+ d.dragInfo = info;
+ }
if (info instanceof SearchActionItemInfo) {
info = ((SearchActionItemInfo) info).createWorkspaceItem(
mLauncher.getModel());