[24/N] Desks: Fix deactivation when more than one task is open
When the user is explicitly exiting desktop, such as when usign the
to-fullscreen or to-split buttons, willExitDesktop should always return
true regardless of whether the task moving is the last one or not,
otherwise the exit "cleanup", which includes deactivation, won't be
added to the WCT and will leave the desktop in a bad state.
For multi-desks specifically, this meant that moving to fullscreen when
you only have 1 task did deactivate the desk, but doing so when you had
2 tasks open did not.
Flag: com.android.window.flags.enable_multiple_desktops_backend
Bug: 394268248
Test: enter desktop, have at least two tasks open in the desktop, then
move one to fullscreen and verify new task launches open in fullscreen
and the repository dump shows the source desk as deactivated.
Change-Id: I71e6cd5dd60b7b2c1aa5081ba8b17f4c1b9864f5
2 files changed