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

Commit a1d1702b authored by Mady Mellor's avatar Mady Mellor
Browse files

Don't add multiwindow/alwaysOnTop tasks to recents animation

Bug: 148977538
Test: manual
Change-Id: If8fa7c9862f0edeae1e7a75d43f675c69ecf5b3e
parent 50c75788
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -389,9 +389,7 @@ public class RecentsAnimationController implements DeathRecipient {
        final int taskCount = visibleTasks.size();
        for (int i = 0; i < taskCount; i++) {
            final Task task = visibleTasks.get(i);
            final WindowConfiguration config = task.getWindowConfiguration();
            if (config.tasksAreFloating()
                    || config.getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
            if (skipAnimation(task)) {
                continue;
            }
            addAnimation(task, !recentTaskIds.get(task.mTaskId));
@@ -434,6 +432,19 @@ public class RecentsAnimationController implements DeathRecipient {
        }
    }


    /**
     * Whether a task should be filtered from the recents animation. This can be true for tasks
     * being displayed outside of recents.
     */
    private boolean skipAnimation(Task task) {
        final WindowConfiguration config = task.getWindowConfiguration();
        return task.isAlwaysOnTop()
                || config.tasksAreFloating()
                || config.getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
    }


    @VisibleForTesting
    AnimationAdapter addAnimation(Task task, boolean isRecentTaskInvisible) {
        return addAnimation(task, isRecentTaskInvisible, false /* hidden */,
@@ -529,8 +540,9 @@ public class RecentsAnimationController implements DeathRecipient {

    void addTaskToTargets(Task task, OnAnimationFinishedCallback finishedCallback) {
        if (mRunner != null) {
            // No need to send task appeared when the task target already exists.
            if (isAnimatingTask(task)) {
            // No need to send task appeared when the task target already exists, or when the
            // task is being managed as a multi-window mode outside of recents (e.g. bubbles).
            if (isAnimatingTask(task) || skipAnimation(task)) {
                return;
            }
            final RemoteAnimationTarget target = createTaskRemoteAnimation(task, finishedCallback);