[PiP2] Fix swipe-to-pip from transparent activity

Swiping to enter PiP from a transparent activity causes
a flicker because the background activity (in multi-activit enter PiP)
is PAUSED instead of STOPPED.

This means the moment TRANSIT_PIP's startTx is applied, the transient
hide original host task will be temporarily visible due to a
non-stopping top activity as per policy. This is corrected when the
transient-launch transition is finished and that background activity is
eventually stopped and its layer is moved to back.

This also means that earlier we were just effectively were not seeing
the last parent before PiP flickering, just cause the background
activity would be stopped.

Instead we should explicitly hide the last parent before PiP if it's
specifically a transient hide task in a currently playing transition;
we also do this in sync with the reparenting of the layers once enter
PiP plays on the Shell side.

Bug: 423211835
Flag: com.android.wm.shell.enable_pip2
Test: manually swipe to PiP from a spotify video podcast
Change-Id: I2707b7e34fe247b2963ed1d4aad38679026909ab
1 file changed