4b/ Migrate TopTaskTracker to use visible running tasks from Shell

- When enable_shell_top_task_tracking is enabled, use the shell
  provided signals to keep an up-to-date running (visible) task list
  on the Launcher side, instead of managing the list via to-front
  signals from Core via TaskStackListener.  In doing so, we also
  update CachedTaskInfo to use this visible task list in preparation
  for future refactoring to use the GroupedTaskInfos directly instead.

Bug: 346588978
Flag: EXEMPT adding new flag enable_shell_top_task_tracking
Test: Build SystemUI & Launcher
Test: atest WMShellUnitTests
Change-Id: I16d515243760a17258a727e2502e35387da87589
This commit is contained in:
Winson Chung committed 2024-11-13 07:05:43 +00:00
1 parent ba81c0f345
commit dde53a10e3
9 files changed
+392 -122

No files matched your search

@@ -1353,15 +1353,17 @@ public class TouchInteractionService extends Service {
&& runningTask != null
&& runningTask.isRootChooseActivity();
// In the case where we are in an excluded, translucent overlay, ignore it and treat the
// running activity as the task behind the overlay.
TopTaskTracker.CachedTaskInfo otherVisibleTask = runningTask == null
? null
: runningTask.getVisibleNonExcludedTask();
if (otherVisibleTask != null) {
ActiveGestureProtoLogProxy.logUpdateGestureStateRunningTask(
otherVisibleTask.getPackageName(), runningTask.getPackageName());
gestureState.updateRunningTask(otherVisibleTask);
if (!com.android.wm.shell.Flags.enableShellTopTaskTracking()) {
// In the case where we are in an excluded, translucent overlay, ignore it and treat the
// running activity as the task behind the overlay.
TopTaskTracker.CachedTaskInfo otherVisibleTask = runningTask == null
? null
: runningTask.getVisibleNonExcludedTask();
if (otherVisibleTask != null) {
ActiveGestureProtoLogProxy.logUpdateGestureStateRunningTask(
otherVisibleTask.getPackageName(), runningTask.getPackageName());
gestureState.updateRunningTask(otherVisibleTask);
}
}
boolean previousGestureAnimatedToLauncher =
@@ -1663,6 +1665,7 @@ public class TouchInteractionService extends Service {
ContextualSearchStateManager.INSTANCE.get(this).dump("\t", pw);
SystemUiProxy.INSTANCE.get(this).dump(pw);
DeviceConfigWrapper.get().dump(" ", pw);
TopTaskTracker.INSTANCE.get(this).dump(pw);
}
private AbsSwipeUpHandler createLauncherSwipeHandler(