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

Commit 3227a4ec authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't return TYPE_RECENTS task in TopTaskTracker.getCachedTopTask" into main

parents 91af0982 6deccd8e
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -206,12 +206,17 @@ public class TopTaskTracker extends ISplitScreenListener.Stub
            Collections.addAll(mOrderedTaskList, tasks);
        }

        // Strip the pinned task
        ArrayList<RunningTaskInfo> tasks = new ArrayList<>(mOrderedTaskList);
        tasks.removeIf(t -> t.taskId == mPinnedTaskId);
        // Strip the pinned task and recents task
        tasks.removeIf(t -> t.taskId == mPinnedTaskId || isRecentsTask(t));
        return new CachedTaskInfo(tasks);
    }

    private static boolean isRecentsTask(RunningTaskInfo task) {
        return task != null && task.configuration.windowConfiguration
                .getActivityType() == ACTIVITY_TYPE_RECENTS;
    }

    /**
     * Class to provide information about a task which can be safely cached and do not change
     * during the lifecycle of the task.
@@ -267,8 +272,7 @@ public class TopTaskTracker extends ISplitScreenListener.Stub
        }

        public boolean isRecentsTask() {
            return mTopTask != null && mTopTask.configuration.windowConfiguration
                    .getActivityType() == ACTIVITY_TYPE_RECENTS;
            return TopTaskTracker.isRecentsTask(mTopTask);
        }

        /**