From 5aa71cee20f48dcf53cca110ad9193cb1eb8e15f Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Wed, 14 Dec 2022 12:13:19 -0600 Subject: [PATCH] Clean mPreviousSolution on change of CellLayout target The previous reorder solution is not peropperly cleaned and that leads to wrong solution being used. For example when longpressing an icon, it triggers a drag but the drag never finishes. Fix: 261122618 Test: You can no longer overlap a shortcut in the same app icon (see attached bug) Test: atest ReorderWidget Change-Id: Iff8651926cc4179561761c7ce0ac5007f13fc9af --- src/com/android/launcher3/CellLayout.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index fdc52b5e3d..ecfd2307c5 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -2716,6 +2716,7 @@ public class CellLayout extends ViewGroup { */ void onDragEnter() { mDragging = true; + mPreviousSolution = null; } /** @@ -2730,6 +2731,7 @@ public class CellLayout extends ViewGroup { } // Invalidate the drag data + mPreviousSolution = null; mDragCell[0] = mDragCell[1] = -1; mDragCellSpan[0] = mDragCellSpan[1] = -1; mDragOutlineAnims[mDragOutlineCurrent].animateOut();