Refactor shortcuts drag and drop.

- Instead of creating our own drag view within the container, and
  handling logic to determine when to start a real drag, we start
  the drag immediately and just defer onDragStart().
- To determine when the deferred drag should start, we add a
  DeferDragCondition to DragOptions. The default DeferDragCondition
  never defers a drag, but is overridden for apps with shortcuts
  to defer until the icon is dragged a given distance.
- Because the drag is handled in DragController, including checking
  when to start the deferred drag, DeepShortcutsContainer no longer
  needs to handle touch events and ShortcutsContainerListener has
  been removed.

This change has several immediate benefits:
- The code is much cleaner, because it allows touch handling to be
  done by the DragController through the normal drag flow, without
  recreating logic in ShortcutsContainerListener/DeepShortcutContainer.
- The janky second haptic feedback has been removed (now it vibrates
  when you long press, like everywhere else, but not again when the
  shortcuts close after dragging a distance).
- Drops are animated, instead of just popping the icon back into place.

Bug: 30769920
Bug: 30465972
Bug: 31533078
Change-Id: I679b412b72fbf6c3895d76963311eb5010c8e8db
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b6474e6..2b64d42 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3109,7 +3109,17 @@
                                         longClickCellInfo.cellX, longClickCellInfo.cellY));
                 if (!(itemUnderLongClick instanceof Folder || isAllAppsButton)) {
                     // User long pressed on an item
-                    mWorkspace.startDrag(longClickCellInfo, new DragOptions());
+                    DragOptions dragOptions = new DragOptions();
+                    if (itemUnderLongClick instanceof BubbleTextView) {
+                        BubbleTextView icon = (BubbleTextView) itemUnderLongClick;
+                        if (icon.hasDeepShortcuts()) {
+                            DeepShortcutsContainer dsc = DeepShortcutsContainer.showForIcon(icon);
+                            if (dsc != null) {
+                                dragOptions.deferDragCondition = dsc.createDeferDragCondition(null);
+                            }
+                        }
+                    }
+                    mWorkspace.startDrag(longClickCellInfo, dragOptions);
                 }
             }
         }