From 6eee3cabf214e3ccfadf43cbd30936d6dce5aca4 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 9 Jul 2024 23:51:52 +0000 Subject: Fix issue where highlight was drawing without bottom inset on one side only - If a drag is started over home, we ignore the bottom insets to draw the highlight the full height, however we were still handling taskVanished even if there is no drag in session, which meant that setForceIgnoreBottomMargin(true) could be called before the next drag session which does not reset it (it only reset it on hide()). This change properly skips handling taskVanished while not dragging and also resets setForceIgnoreBottomMargin() when the highlights should be showing for both tasks - Also add some descriptive logging for the drag flags Flag: EXEMPT bugfix Bug: 350016003 Test: Drag floating assistant over home, then over another app Change-Id: I175610a643b4a69850bc3b289032f1b3b8524a21 --- .../shell/draganddrop/DragAndDropController.java | 7 ++-- .../android/wm/shell/draganddrop/DragLayout.java | 2 + .../android/wm/shell/draganddrop/DragUtils.java | 47 +++++++++++++++++++++- .../android/wm/shell/draganddrop/DropZoneView.java | 12 +++++- 4 files changed, 62 insertions(+), 6 deletions(-) (limited to 'libs/WindowManager/Shell') 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 e0b08668b1d4..e00353d6ac82 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 @@ -302,7 +302,7 @@ public class DragAndDropController implements RemoteCallable 0) { mMarginView.invalidate(); @@ -159,8 +163,14 @@ public class DropZoneView extends FrameLayout { /** Sets the bottom inset so the drop zones are above bottom navigation. */ public void setBottomInset(float bottom) { + if (DEBUG_LAYOUT) { + ProtoLog.v(ShellProtoLogGroup.WM_SHELL_DRAG_AND_DROP, "setBottomInset: inset=%f", + bottom); + } mBottomInset = bottom; - ((LayoutParams) mSplashScreenView.getLayoutParams()).bottomMargin = (int) bottom; + final LayoutParams lp = (LayoutParams) mSplashScreenView.getLayoutParams(); + lp.bottomMargin = (int) bottom; + mSplashScreenView.setLayoutParams(lp); if (mMarginPercent > 0) { mMarginView.invalidate(); } -- cgit v1.2.3-59-g8ed1b