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

Commit 72e8025f authored by Kevin's avatar Kevin
Browse files

Fix recents order being reversed sometimes

Occasionally, the recents list items were reversed.  This is because
RecentsTaskList#getTasks returns the actual backing list which we were
reversing, so we solve this by making a new array list.

Bug: 131367388
Test: Do repro in bug, no longer gives reversed order
Change-Id: I825d284e4768c2b53fedf07480e99d195acfa6d6
parent d9c0fe13
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ public final class TaskListLoader {
            return;
        }
        // TODO: Look into error checking / more robust handling for when things go wrong.
        mTaskListChangeId = mRecentsModel.getTasks(tasks -> {
        mTaskListChangeId = mRecentsModel.getTasks(loadedTasks -> {
            ArrayList<Task> tasks = new ArrayList<>(loadedTasks);
            // Reverse tasks to put most recent at the bottom of the view
            Collections.reverse(tasks);
            // Load task content