[26/N] Desks: Apply desk activation logic when moving task to next display
Consolidates activation logic regardless of multi-desks being enabled
when moving a task to the desktop of another display. Prior to this
change, the target desk only got desk activation changes with the flag
enabled. Activation in this context means:
- Home/Wallpaper go to front to cover existing non-desktop windows (e.g.
if something was fullscreen in the target display)
- Existing inactive desktop tasks are brought to front to join the task
moving to the desktop in the new display
- The task moving to the new desktop/display may put the # of desktop
tasks over the task-limit, so minimization logic needs to be applied.
So with this change all that is applied even with multi-desks disabled
(which fixes pre-existing bugs), and allows the activation logic in the
moveToDisplay() function to be simplified to calling
addDeskActivationChanges(), which already internally handles multi-desk
flag differences.
Bug: 362720497
Flag: com.android.window.flags.enable_desktop_windowing_mode
Flag: com.android.window.flags.enable_move_to_next_display_shortcut
Flag: com.android.window.flags.enable_multiple_desktops_backend
Test: open a couple of freeform apps in an external display, move one to
fullscreen. Then, move a task from the internal display to the external
display and verify:
1) The fullscreen task is no longer visible
2) Wallpaper is visible in the background
3) Existing desktop tasks are visible
4) Going over the limit minimizes some of the existing tasks from (3)
Change-Id: I5c9ddf8c3de52ddc948c847036feed195e639c80
2 files changed