From 78e278e9dbf7e391b0f3c0b67586fed739c6337d Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 1 May 2018 11:38:18 -0700 Subject: [PATCH] Clear all task button should not log as individual swipe up Bug: 78895803 Change-Id: I3a8c40e892396ea0781423fa1791a9e13a116c45 --- .../com/android/quickstep/views/RecentsView.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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();