Do not reflow dismissed grid task is already in split select.

When the task is not found in top or bottom set, return current page. This fixes rotation in overview while split select is already active.

Fix: 420546041
Test: TaskGridNavHelperTest
Flag: com.android.launcher3.enable_expressive_dismiss_task_motion
Change-Id: I4f654b017a0c051bd373e78ebd3d3f02f7bdf3cf
This commit is contained in:
Pat Manning
2025-05-29 14:49:55 +01:00
parent 6396824a0c
commit 14b76f7867
2 changed files with 15 additions and 0 deletions
@@ -59,6 +59,10 @@ class TaskGridNavHelper(
cycle: Boolean,
): Int {
val inTop = topRowIds.contains(currentPageTaskViewId)
val inBottom = bottomRowIds.contains(currentPageTaskViewId)
if (!inTop && !inBottom) {
return currentPageTaskViewId
}
val index =
if (inTop) topRowIds.indexOf(currentPageTaskViewId)
else bottomRowIds.indexOf(currentPageTaskViewId)
@@ -786,6 +786,17 @@ class TaskGridNavHelperTest {
.isEqualTo(ADD_DESK_PLACEHOLDER_ID)
}
/*
5 3 1 |
CLEAR_ALL | Invalid ID:
6 4 2 | [25] --> [25]
*/
@Test
fun nextGridPage_invalidId_pressTab_noCycle_returnsCurrentPage() {
assertThat(getNextGridPage(currentPageTaskViewId = 25, TAB, delta = -1, cycle = false))
.isEqualTo(25)
}
// Col offset: 0 1 2
// -----------
// ID grid: 4 2 0 start