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
This commit is contained in:
Sebastian Franco authored and Sebastián Franco committed 2022-02-07 19:10:55 +00:00
1 parent 116b51a999
commit 5a6e08c3cd
1 file changed
+3 -3
@@ -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);
}