Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d537968b authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Finish recents animation on task dismissal only if the task is a live tile task

Fixes: 191831190
Test: manual
Change-Id: Ie1dd02a2e8cc401a613a0ed2199400712c6d5291
Merged-In: Ie1dd02a2e8cc401a613a0ed2199400712c6d5291
parent 835fab23
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -2369,13 +2369,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                if (success) {
                    if (shouldRemoveTask) {
                        if (taskView.getTask() != null) {
                            if (LIVE_TILE.get() && taskView.isRunningTask()) {
                                finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
                                    () -> {
                                UI_HELPER_EXECUTOR.getHandler().postDelayed(() ->
                                        ActivityManagerWrapper.getInstance().removeTask(
                                                taskView.getTask().key.id),
                                        REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
                            });
                                        () -> removeTaskInternal(taskView));
                            } else {
                                removeTaskInternal(taskView);
                            }
                            mActivity.getStatsLogManager().logger()
                                    .withItemInfo(taskView.getItemInfo())
                                    .log(LAUNCHER_TASK_DISMISS_SWIPE_UP);
@@ -2421,6 +2420,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        return anim;
    }

    private void removeTaskInternal(TaskView taskView) {
        UI_HELPER_EXECUTOR.getHandler().postDelayed(() ->
                        ActivityManagerWrapper.getInstance().removeTask(
                                taskView.getTask().key.id),
                REMOVE_TASK_WAIT_FOR_APP_STOP_MS);
    }

    /**
     * @return {@code true} if one of the task thumbnails would intersect/overlap with the
     *         {@link #mSplitPlaceholderView}