From d0012b8c7b439403490729e39f9ef2e056d5f9f6 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Sat, 18 Feb 2023 08:12:39 +0000 Subject: [PATCH] Fix issue with both shell and launcher updating drag surface - The shell drop target should only handle successful drops, otherwise either the system will create a return animation, or if the drag starter requests DRAG_FLAG_REQUEST_SURFACE_FOR_RETURN_ANIMATION, then the starter will own the surface when it is not handled Bug: 269814838 Test: Drag an app from the taskbar to an area that does not trigger a split and ensure it animates back to the taskbar without flickering Change-Id: I86aa03d3bef41d92cc7868c57103b03212967aed --- .../src/com/android/wm/shell/draganddrop/DragLayout.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java index 3ade1ed9392fe..bb6e3917ff3c9 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java @@ -369,7 +369,9 @@ public class DragLayout extends LinearLayout { // Start animating the drop UI out with the drag surface hide(event, dropCompleteCallback); - hideDragSurface(dragSurface); + if (handledDrop) { + hideDragSurface(dragSurface); + } return handledDrop; }