Adapt TaskbarOverflow tests to check items added overflow view

Adds a step to verify that TaskbarOverflowView items get set to the list
of the least recent tasks. Adds test cases for an edge case where
taskbar hits max number of items event without recent tasks
(b/379774843).
Has a fix for a further edge case where taskbar overflow view could be
created with a single item (in which case we can just show that item
directly).

Bug: 379774843
Flag: com.android.launcher3.taskbar_overflow
Test: atest TaskbarOverflowTest

Change-Id: I004676da3e17f26b8110d14d39589c84a9f384d8
This commit is contained in:
Toni Barzic committed 2024-12-06 19:39:47 +00:00
1 parent 9fdf9efdd2
commit 7bea1821d4
3 files changed
+74 -1

No files matched your search

@@ -613,7 +613,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
// accounted for when comparing current icon count to max number of icons.
int nonTaskIconsToBeAdded = 1;
boolean supportsOverflow = Flags.taskbarOverflow();
boolean supportsOverflow = Flags.taskbarOverflow() && recentTasks.size() > 1;
int overflowSize = 0;
if (supportsOverflow) {
mIdealNumIcons = mNextViewIndex + recentTasks.size() + nonTaskIconsToBeAdded;