Update desktop mode to identify minimized tasks

When a task is minimised, it becomes invisible but is still running.
WMShell now signals to the launcher when a task's visibility changes.
The task bar takes the visibility into account to know if a running task
is, in fact, minimised.

Test: atest NexusLauncherTests:DesktopTaskbarRunningAppsControllerTest
Flag: com.android.window.flags.enable_desktop_windowing_taskbar_running_apps
Bug: 333872717
Change-Id: Iaff6b1240d354bb3c4de8e4884948acf9bf40112
This commit is contained in:
Pierre Barbier de Reuille committed 2024-05-23 20:59:16 +01:00
1 parent 656f0e8d13
commit f60dd5471c
8 files changed
+145 -38

No files matched your search

@@ -68,7 +68,7 @@ public class TaskbarModelCallbacks implements
// Used to defer any UI updates during the SUW unstash animation.
private boolean mDeferUpdatesForSUW;
private Runnable mDeferredUpdates;
private DesktopVisibilityController.DesktopVisibilityListener mDesktopVisibilityListener =
private final DesktopVisibilityController.DesktopVisibilityListener mDesktopVisibilityListener =
visible -> updateRunningApps();
public TaskbarModelCallbacks(
@@ -235,20 +235,23 @@ public class TaskbarModelCallbacks implements
hotseatItemInfos = mControllers.taskbarRecentAppsController
.updateHotseatItemInfos(hotseatItemInfos);
Set<String> runningPackages = mControllers.taskbarRecentAppsController.getRunningApps();
Set<String> minimizedPackages = mControllers.taskbarRecentAppsController.getMinimizedApps();
if (mDeferUpdatesForSUW) {
ItemInfo[] finalHotseatItemInfos = hotseatItemInfos;
mDeferredUpdates = () ->
commitHotseatItemUpdates(finalHotseatItemInfos, runningPackages);
commitHotseatItemUpdates(finalHotseatItemInfos, runningPackages,
minimizedPackages);
} else {
commitHotseatItemUpdates(hotseatItemInfos, runningPackages);
commitHotseatItemUpdates(hotseatItemInfos, runningPackages, minimizedPackages);
}
}
private void commitHotseatItemUpdates(
ItemInfo[] hotseatItemInfos, Set<String> runningPackages) {
private void commitHotseatItemUpdates(ItemInfo[] hotseatItemInfos, Set<String> runningPackages,
Set<String> minimizedPackages) {
mContainer.updateHotseatItems(hotseatItemInfos);
mControllers.taskbarViewController.updateIconViewsRunningStates(runningPackages);
mControllers.taskbarViewController.updateIconViewsRunningStates(runningPackages,
minimizedPackages);
}
/**