More test for taskbar overflow

Adds tests to TaskbarOverflowTests to verify that:
*   tapping overflow view toggles keyboard quick switch view
*   tasks associated with a hotseat item don't get added to
    recents taskbar section / overflow view
*   keyboard quick switch view shown from taskbar contains
    running tasks, excluding tasks associated with a hotseat item

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

Change-Id: Iee6316c33cef6322d567e853f9fa358b7af9e172
This commit is contained in:
Toni Barzic committed 2025-02-25 04:39:23 +00:00
1 parent bc872b2ae4
commit 501562f09a
3 files changed
+162 -7

No files matched your search

@@ -17,6 +17,7 @@ package com.android.launcher3.taskbar;
import static com.android.launcher3.Flags.enableAltTabKqsOnConnectedDisplays;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.pm.ActivityInfo;
import android.view.MotionEvent;
@@ -354,6 +355,27 @@ public final class KeyboardQuickSwitchController implements
}
}
@VisibleForTesting
boolean isShownFromTaskbar() {
return isShown() && mQuickSwitchViewController.wasOpenedFromTaskbar();
}
@VisibleForTesting
boolean isShown() {
return mQuickSwitchViewController != null
&& !mQuickSwitchViewController.isCloseAnimationRunning();
}
@VisibleForTesting
List<Integer> shownTaskIds() {
if (!isShown()) {
return Collections.emptyList();
}
return mTasks.stream().flatMap(
groupTask -> groupTask.getTasks().stream().map(task -> task.key.id)).toList();
}
@Override
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "KeyboardQuickSwitchController:");
@@ -423,7 +445,13 @@ public final class KeyboardQuickSwitchController implements
if (task == null) {
return false;
}
int runningTaskId = ActivityManagerWrapper.getInstance().getRunningTask().taskId;
ActivityManager.RunningTaskInfo runningTaskInfo =
ActivityManagerWrapper.getInstance().getRunningTask();
if (runningTaskInfo == null) {
return false;
}
int runningTaskId = runningTaskInfo.taskId;
return task.containsTask(runningTaskId);
}