From 92c998a9fa0c49ba3371eb92b207f17a7ca0686e Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 8 Sep 2022 20:20:36 +0000 Subject: [PATCH] Fix issue with drags sometimes not being handled in tests - ACTION_DRAG_ENTERED does not actually have location data, and ACTION_DRAG_LOCATION may not always be sent, which results in no target being computed prior to the DROP. Since the DROP event also has location data, we should update in that case as well. Bug: 234653212 Test: atest TaplTestsTaskbar Change-Id: I1f7657a95a4f124d98fc0da78b8a3ac2237f91f6 --- .../com/android/wm/shell/draganddrop/DragAndDropController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java index 4697a0184eb4c..b59fe1818780e 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java @@ -258,12 +258,12 @@ public class DragAndDropController implements DisplayController.OnDisplaysChange break; case ACTION_DRAG_ENTERED: pd.dragLayout.show(); - pd.dragLayout.update(event); break; case ACTION_DRAG_LOCATION: pd.dragLayout.update(event); break; case ACTION_DROP: { + pd.dragLayout.update(event); return handleDrop(event, pd); } case ACTION_DRAG_EXITED: {