Update KQS to better support desktop tasks

While we wait for a way to display a sreenshot of the desktop statically, using a placeholder solution.

Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 335632286
Test: TaplTestKeyboardQuickSwitch
Change-Id: I2525ab89eb3a5a902e7ab55367187d87aada1f10
This commit is contained in:
Schneider Victor-tulias
2024-04-18 10:41:38 -04:00
parent 2fb15b12d5
commit ec39107105
5 changed files with 65 additions and 68 deletions
@@ -151,20 +151,10 @@ public final class KeyboardQuickSwitchController implements
private void processLoadedTasks(ArrayList<GroupTask> tasks) {
// Only store MAX_TASK tasks, from most to least recent
Collections.reverse(tasks);
// Hide all desktop tasks and show them on the hidden tile
int hiddenDesktopTasks = 0;
DesktopTask desktopTask = findDesktopTask(tasks);
if (desktopTask != null) {
hiddenDesktopTasks = desktopTask.tasks.size();
tasks = tasks.stream()
.filter(t -> !(t instanceof DesktopTask))
.collect(Collectors.toCollection(ArrayList<GroupTask>::new));
}
mTasks = tasks.stream()
.limit(MAX_TASKS)
.collect(Collectors.toList());
mNumHiddenTasks = Math.max(0, tasks.size() - MAX_TASKS) + hiddenDesktopTasks;
mNumHiddenTasks = Math.max(0, tasks.size() - MAX_TASKS);
}
private void processLoadedTasksOnDesktop(ArrayList<GroupTask> tasks) {