Add a no recent tasks message to the keyboard quick switch view

Flag: ENABLE_KEYBOARD_QUICK_SWITCH
Fixes: 280652620
Test: launched the keyboard quick switch with 0, <=6 and >6 tasks launched
Change-Id: I560707645b83b79ba2203460e62e4c540f5da421
This commit is contained in:
Schneider Victor-tulias
2023-05-10 11:43:25 -07:00
parent 8f23be7b6f
commit b29355c192
8 changed files with 88 additions and 19 deletions

View File

@@ -129,8 +129,8 @@ public final class KeyboardQuickSwitchController implements
*/
int launchFocusedTask() {
// Return -1 so that the RecentsView is not incorrectly opened when the user closes the
// quick switch view by tapping the screen.
return mQuickSwitchViewController == null
// quick switch view by tapping the screen or when there are no recent tasks.
return mQuickSwitchViewController == null || mTasks.isEmpty()
? -1 : mQuickSwitchViewController.launchFocusedTask();
}