[22/N] Desks: Implement move-to-next-display
Ensures move-to-next display continues to work with the multi-desk
backend. In short:
1) Reparents the task to default desk in the next display, rather than
the TDA
2) Activates that desk
3) Deactivates the origin desk, if applicable
When the thing moving is a split-task:
4) Adds missing desktop clean up (which includes desk deactivation) of
the desk in the destination display
Flag: com.android.window.flags.enable_multiple_desktops_backend
Bug: 394268248
Test: with 2 displays, open a task, then use `adb
shell dumpsys activity service SystemUIService WMShell desktopmode
moveToNextDisplay <taskId>` to move it to the other display and verify
hierarchy/repository state is correct. There's multiple edge cases to
test here such as:
- The task can be fullscreen/desktop/split
- The origin desk may need to be deactivated if moving the last task
- The destination desk may or may not be activated already
- When moving a split root, and there's a desk active in the destination
display it needs to be deactivated
Change-Id: I972fa586108f0c01b14c192aa0a30c0fad1d66fd
6 files changed