Merge "Create new ShortcutInfo when dropping predicted deep shortcuts." into ub-launcher3-master

This commit is contained in:
TreeHugger Robot 2018-02-20 21:38:09 +00:00 committed by Android (Google) Code Review
commit 224f58c4bc
1 changed files with 9 additions and 3 deletions

View File

@ -2716,10 +2716,16 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
if (info.container == NO_ID && info instanceof AppInfo) {
if (info.container == NO_ID) {
// Came from all apps -- make a copy
info = ((AppInfo) info).makeShortcut();
d.dragInfo = info;
if (info instanceof AppInfo) {
info = ((AppInfo) info).makeShortcut();
d.dragInfo = info;
} else if (info instanceof ShortcutInfo) {
info = new ShortcutInfo((ShortcutInfo) info);
d.dragInfo = info;
}
}
view = mLauncher.createShortcut(cellLayout, (ShortcutInfo) info);
break;