Add a flag to cancelDragAndDrop to skip animation
When running cancel animation for drag shadow image, the system cannot
start another drag operation, which is problematic when the system would
start the other drag operation quickly.
Bug: 130313958
Test: Cancel drag operation by calling cancelDragAndDrop
Change-Id: I5d6650a0ce9a4cd80bbdb1beabc9e514349ccadc
diff --git a/services/core/java/com/android/server/wm/DragDropController.java b/services/core/java/com/android/server/wm/DragDropController.java
index 716e4ef..f8f6334 100644
--- a/services/core/java/com/android/server/wm/DragDropController.java
+++ b/services/core/java/com/android/server/wm/DragDropController.java
@@ -236,7 +236,7 @@
}
}
- void cancelDragAndDrop(IBinder dragToken) {
+ void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation) {
if (DEBUG_DRAG) {
Slog.d(TAG_WM, "cancelDragAndDrop");
}
@@ -257,7 +257,7 @@
}
mDragState.mDragResult = false;
- mDragState.cancelDragLocked();
+ mDragState.cancelDragLocked(skipAnimation);
}
} finally {
mCallback.get().postCancelDragAndDrop();