From 5a6e08c3cdf30ed15d5d3bafea0ce1cfbfa0e01a Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Mon, 7 Feb 2022 11:09:24 -0800 Subject: [PATCH] Prediction icons in Taskbar were updating when dragging icon in the same place When dragging an icon in the Taskbar and dropping it in the same spot it triggers new predictions when it shouldn't. Basically, it was thinking that the icon was moved outside of the taskbar which should trigger new predictions. To fix it, it simply required to change the order of the events, sending the UNPIN event before the PIN event. Bug: 202922907 Test: Have at least two prediction icons in the Taskbar, drag an app icon in the Taskbar, and drop it in the same place the prediction icon shouldn't change Change-Id: I6079ff6eb69d7b1cb3c22bebc84511c0abd61cec --- .../src/com/android/launcher3/model/AppEventProducer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/model/AppEventProducer.java b/quickstep/src/com/android/launcher3/model/AppEventProducer.java index 7c29c5b4c6..4404ffb0e5 100644 --- a/quickstep/src/com/android/launcher3/model/AppEventProducer.java +++ b/quickstep/src/com/android/launcher3/model/AppEventProducer.java @@ -137,12 +137,12 @@ public class AppEventProducer implements StatsLogConsumer { if (mLastDragItem == null) { return; } - if (isTrackedForHotseatPrediction(atomInfo)) { - sendEvent(atomInfo, ACTION_PIN, CONTAINER_HOTSEAT_PREDICTION); - } if (isTrackedForHotseatPrediction(mLastDragItem)) { sendEvent(mLastDragItem, ACTION_UNPIN, CONTAINER_HOTSEAT_PREDICTION); } + if (isTrackedForHotseatPrediction(atomInfo)) { + sendEvent(atomInfo, ACTION_PIN, CONTAINER_HOTSEAT_PREDICTION); + } if (isTrackedForWidgetPrediction(atomInfo)) { sendEvent(atomInfo, ACTION_PIN, CONTAINER_WIDGETS_PREDICTION); }