diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 51b787ba0e..68aabafeaf 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -735,12 +735,15 @@ public abstract class RecentsView extends PagedView impl duration, LINEAR, anim); } - private void removeTask(Task task, PendingAnimation.OnEndListener onEndListener) { + private void removeTask(Task task, PendingAnimation.OnEndListener onEndListener, + boolean shouldLog) { if (task != null) { ActivityManagerWrapper.getInstance().removeTask(task.key.id); - mActivity.getUserEventDispatcher().logTaskLaunchOrDismiss( - onEndListener.logAction, Direction.UP, - TaskUtils.getComponentKeyForTask(task.key)); + if (shouldLog) { + mActivity.getUserEventDispatcher().logTaskLaunchOrDismiss( + onEndListener.logAction, Direction.UP, + TaskUtils.getComponentKeyForTask(task.key)); + } } } @@ -823,7 +826,7 @@ public abstract class RecentsView extends PagedView impl mPendingAnimation.addEndListener((onEndListener) -> { if (onEndListener.isSuccess) { if (shouldRemoveTask) { - removeTask(taskView.getTask(), onEndListener); + removeTask(taskView.getTask(), onEndListener, true); } int pageToSnapTo = mCurrentPage; if (draggedIndex < pageToSnapTo) { @@ -859,7 +862,7 @@ public abstract class RecentsView extends PagedView impl if (onEndListener.isSuccess) { while (getChildCount() != 0) { TaskView taskView = getPageAt(getChildCount() - 1); - removeTask(taskView.getTask(), onEndListener); + removeTask(taskView.getTask(), onEndListener, false); removeView(taskView); } onAllTasksRemoved();