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

Commit e91a468a authored by Winson Chung's avatar Winson Chung
Browse files

Ignore empty tasks when unfreezing recents list after timeout

- The top task can sometimes be a root that doesn't have any
  children (ie. split root), which can lead to an empty
  task being in the recents list

Bug: 275425871
Test: atest SwitchBetweenSplitPairs
Change-Id: Ia0bd7a08870e8cbd4849f79506fd8db9a1d18d65
parent f9a77b96
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -338,7 +338,8 @@ class RecentTasks {
        synchronized (mService.mGlobalLock) {
            final Task focusedStack = mService.getTopDisplayFocusedRootTask();
            final Task topTask = focusedStack != null ? focusedStack.getTopMostTask() : null;
            resetFreezeTaskListReordering(topTask);
            final Task reorderToEndTask = topTask != null && topTask.hasChild() ? topTask : null;
            resetFreezeTaskListReordering(reorderToEndTask);
        }
    }

+5 −0
Original line number Diff line number Diff line
@@ -924,6 +924,11 @@ public class RecentTasksTest extends WindowTestsBase {

    @Test
    public void testFreezeTaskListOrder_timeout() {
        for (Task t : mTasks) {
            // Make all the tasks non-empty
            new ActivityBuilder(mAtm).setTask(t).build();
        }

        // Add some tasks
        mRecentTasks.add(mTasks.get(0));
        mRecentTasks.add(mTasks.get(1));