Clear all task button should not log as individual swipe up

Bug: 78895803

Change-Id: I3a8c40e892396ea0781423fa1791a9e13a116c45
This commit is contained in:
Hyunyoung Song 2018-05-01 11:38:18 -07:00
parent cbebaa19f9
commit 78e278e9db
1 changed files with 9 additions and 6 deletions

View File

@ -735,12 +735,15 @@ public abstract class RecentsView<T extends BaseActivity> 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<T extends BaseActivity> 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<T extends BaseActivity> 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();