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
2024-05-17 13:24:22 +01:00
parent 656f0e8d13
commit f60dd5471c
8 changed files with 145 additions and 38 deletions
@@ -510,14 +510,30 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
/** Updates which icons are marked as running given the Set of currently running packages. */
public void updateIconViewsRunningStates(Set<String> runningPackages) {
public void updateIconViewsRunningStates(Set<String> runningPackages,
Set<String> minimizedPackages) {
for (View iconView : getIconViews()) {
if (iconView instanceof BubbleTextView btv) {
btv.updateRunningState(runningPackages.contains(btv.getTargetPackageName()));
btv.updateRunningState(
getRunningAppState(btv.getTargetPackageName(), runningPackages,
minimizedPackages));
}
}
}
private BubbleTextView.RunningAppState getRunningAppState(
String packageName,
Set<String> runningPackages,
Set<String> minimizedPackages) {
if (minimizedPackages.contains(packageName)) {
return BubbleTextView.RunningAppState.MINIMIZED;
}
if (runningPackages.contains(packageName)) {
return BubbleTextView.RunningAppState.RUNNING;
}
return BubbleTextView.RunningAppState.NOT_RUNNING;
}
/**
* Defers any updates to the UI for the setup wizard animation.
*/