Commit Graph

14 Commits

Author SHA1 Message Date
Toni Barzic
5207024240 Improve TaskbarRecentAppsController on multi-display
Fixes two issues:
1.  TaskbarRecentAppsController was reflecting tasks from the first
    DesktopTasks it found in the RecentsModel - this does not work in
    multi-display environemnt where each display may have a separate
    DesktopTask. The CL updates the logic to gather tasks from all
    available DesktopTasks.
2.  RecentsModel supported a single recent apps changed listener. In
    multi-display, each display has its own taskbar, and thus its own
    TaskbarRecentAppsController, each of which needs to listen for
    RecentsModel changes. This meant that second taskbar that registered
    a listener was clearing out the listener set by the first taskbar.

Bug: 406183146
Flag: com.android.window.flags.enable_taskbar_connected_displays
Test: On multidisplay, open apps on different displays. Taskbar reflects
      all running desktop tasks regardless of the display on which
      they're open.
Change-Id: I1dd750e5bcd58d8d90b7b859053e2616c7d18441
2025-04-17 16:32:12 -07:00
Vinit Nayak
fdcfb61f1b Use shell's SplitBounds class instead of our own
* Previously we had duplicated classes because of some
launcher3 and quickstep package separation. That got refactored
so now we can conslidate to only use one class. Yay!

Bug: 254378592
Test: Compiles, manual
Flag: EXEMPT refactor

Change-Id: Ifea3358ac38c1d2881cb19bb88cf14ef9c0aaa29
2025-04-10 15:18:24 -04:00
Jagrut Desai
64d448a8db Fix Taskbar Flicker with Recents or Running Apps Present
Test: Manual, Presubmit
Bug: 404772481
Flag: EXEMPT bugfix
Change-Id: If3b87474e6e85fabf24a42ac2a3e4ac6a19a4358
2025-03-25 14:16:12 -07:00
minch
c48f662c7d Do not notify desk mode changes on visible desk tasks count changes
1. Trigger `notifyIsInDesktopModeChanged` on
   `visibleDesktopTasksCount` changes only when the multi-desks
   flags are disabled.
2. Make `DesktopVisibilityController.isInDesktopMode` variable
   private and legacy, which should only be used when the multi-desks
   feature is disabled. All the call sites should go to check
   `DesktopVisibilityController.isInDesktopMode(displayId)`, which
    works both with and without the multi-desks feature enabled.

Bug: 402222877
Test: m
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Change-Id: I291e2be6d99e81b0c918ae7f39c17a8cd4ea0918
2025-03-14 15:21:19 +00:00
minch
68e116e79f Get displayId from DesktopTask for DesktopTaskView
Bug: 401011627
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Test: Added a test in RecentTasksListTest
Change-Id: I21164de812d57b79cd84370bbf0426268c4b645d
2025-03-13 22:24:22 +00:00
Jagrut Desai
8b2e5eff9b Desktop Mode Taskbar Recreate Animation
This Cl includes
       - addition of entry/exit callback methods in DesktopVisibilityController.
       - taskbar manager now listens to desktop mode changes.
       - TaskbarBackrgroundRedererer can now individually animation backgrounds for transient and persistent taskbars
       - new channel for taskbar icon alpha added to TaskbarViewController
       - new animated float to handle background alpha while we are recreating taskbar with animation.

Solution:

we use the callabck we get from DekstopVisibilty for entry/exit to first change logic of when we are considered inDesktopMode. Upon entry/exit we notify display controller for info change.
we also at notify taskbar manager who is now a listener to the desktop mode change and start the recreate process. TaskbarManager first animates existing taskbar out of user view and then follows the original recreate flow.

Test: Presubmit
Bug: 343882478
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: Ib827564cacd194f499e7d9b1965e2bb13e3548ab
2025-02-24 11:59:53 -08:00
Ahmed Fakhry
dafc2d4c42 Add deskId to DesktopTask.
Now that `GroupedTaskInfo` propagates the `deskId` from
Shell (see ag/31825217), we need to plumb this value in
Launcher through `DesktopTask`.

Future CLs will use this value in Overview.

Bug: 395911284
Test: m, modified existing tests.
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Change-Id: I396250e0cac761c4c5f7e8b2d6cddbe68e646217
2025-02-21 17:50:13 +00:00
Treehugger Robot
b22158206b Merge "Introduce SingleTask and SplitTask" into main 2025-01-24 02:59:37 -08:00
Ahmed Fakhry
f87e44376b Introduce SingleTask and SplitTask
See go/refactor-group-task for details. This CL introduces `SingleTask`
and `SplitTask` and makes `GroupTask` abstract.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: I96d0eb0600420ce5cb2fff30ed9d766224b6961e
2025-01-23 23:48:01 +00:00
Treehugger Robot
86864f95c3 Merge "AllApps tray icon tap: use showDesktopApp() for existing Desktop tasks" into main 2025-01-23 03:34:55 -08:00
Gustav Sennton
1427068342 AllApps tray icon tap: use showDesktopApp() for existing Desktop tasks
When tapping an icon in the AllApps tray, before this CL, we would use
the WM Shell API startLaunchIntentTransition() to launch a task for that
app icon. However, this would break the window limit logic since in WM
Shell (startLaunchIntentTransition()) we think we're launching a new
task, when in fact we're just moving an existing one to the front.
With this CL we instead reuse the showDesktopApp() API whenever the app
we're trying to launch has an already visible / minimized Desktop task.

Bug: 391365151
Test: launch visible Desktop app from AllApps - doesn't overtrigger
window limit
Flag: com.android.window.flags.enable_desktop_app_launch_transitions_bugfix

Change-Id: Ia3638012226fe28c853ec6cfd0523a8fb23b8961
2025-01-23 00:46:08 -08:00
Toni Barzic
f817372651 Show desktop tasks when taskbar is pinned on home
Updates taskbar and KQS to show (running) desktop tasks when taskbar is
shown on the home screen - adds `shouldShowDesktopTasksInTaskbar` method
to TaskbarDesktopModeController to be used instead of
`areDesktopTasksVisible*()` to determine whether to show desktop tasks
in the taskbar. The method, in addition to desktop tasks visibility,
also considers whether taskbar should be shown on the home screen, and
whether current launcher state is home.

The launcher state is fetched from `TaskbarStashController`, which
already keeps track of this state. This is likely not ideal, but can be
removed in the long term - see http://b/390665752.

Furthermore, updates ReventsModel login not to always filter out desktop
tasks with no non-minimized tasks (which is currently expected behavior
in overview) in `getTasks()`. The filtering is now done by the filter
passed to `getTasks()` method, instead of when processing tasks in the
background. The filter used by default is updated to filter out such
desktop tasks, but callsites from `KeyboardQuickSwitchController` and
`TaskbarRecentAppsController` are updated to use an empty filter, so
they can display desktop tasks when they're all minimized.

Bug: 376711722
Bug: 390665160
Test: Manual on desktop device - verify that taskbar and KQS when shown
on home screen display desktop tasks, including the case all tasks are
minimized.
Flag: com.android.window.flags.enter_desktop_by_default_on_freeform_displays

Change-Id: Iabc22e20bf64aa9a826b4a5952f1edc6ea639cdc
2025-01-22 22:36:02 +00:00
Ahmed Fakhry
26a43abbe2 Remove some usages of GroupTask.task1
See go/refactor-group-task for details. This is another incremental
change towards deprecating `GroupTask.task1`.

Bug: 388593902
Test: m
Flag: EXEMPT pure refactor with no behavior change.
Change-Id: Ib9b38268374277f485c6856a012b5b7f02e37055
2025-01-17 17:47:26 +00:00
Sihua Ma
8fc266d063 Move tests to multivalent
Test: SysUI studio
Test: atest NexusLauncherRoboTests
Flag: EXEMPT test migration
Change-Id: Idd9e52f281d955e87f6db638ebfd8218a4dcb77f
2025-01-17 00:04:27 +00:00