Address race condition with drag from external window
When dragging from another window, e.g. when pinning an app shortcut,
there's a race condition as follows if launcher is killed:
- System drag starts
- Workspace loads and starts binding, canceling the drag
With this change, the drag will get onDragStart() again after this
case and allow completion of the drop.
Change-Id: I3f1c786ad1d451ecda9bbac5e9a9a3e0d8b66f73
diff --git a/src/com/android/launcher3/dragndrop/BaseItemDragListener.java b/src/com/android/launcher3/dragndrop/BaseItemDragListener.java
index 9b91a1d..e47a16f 100644
--- a/src/com/android/launcher3/dragndrop/BaseItemDragListener.java
+++ b/src/com/android/launcher3/dragndrop/BaseItemDragListener.java
@@ -92,7 +92,7 @@
postCleanup();
return false;
}
- if (event.getAction() == DragEvent.ACTION_DRAG_STARTED) {
+ if (event.getAction() == DragEvent.ACTION_DRAG_STARTED || !mDragController.isDragging()) {
if (onDragStart(event)) {
return true;
} else {