[wm]: Move split-secondary stack to front when split-screen is dismissed

In ATMS. Move the split-secondary stack to the front
if the split-screen primary stack shouldn't be focused
after it goes fullscreen.

In AS. If the activity in the primary stack calls moveTaskToBack,
both stacks are dismissed and the launcher is shown.
So move the stack to the bottom
before changing the primary stack to fullscreen stack.

Test: Manual - Exit an app in the split primary stack with the back key,
or drag the divider to the top of the screen.
Test: CtsWindowManagerDeviceTestCases:SplitScreenTests
Bug: 129508970

Change-Id: Ia00fd6ea814b58d59165e860d5390fcfbf1623f6
(cherry picked from commit 19469da7c2053e2c211f73c6da3d25dcaebc3498)
2 files changed