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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user