[1/2][PiP2] Move removePip animation to transition
PiP1 currently relies on force-hideen flag to guarantee the order of onStop() and onPictureInPictureModeChanged() callbacks being sent to client. Therefore, PiP1 first runs the fade-out animation separately before starting a jumpcut removePip transition. In PiP2, we wanna avoid synchronization issues through moving deterministic animations into transitions. Hence, we wanna run the fadeout animation while the TRANSIT_REMOVE_PIP is playing. 1. This means we should not rely on force-hidden flag in PiP2, as that would stop activity immediately before we even start fade-out 2. Currently setting windowing mode, which updates config in Core, also ends up scheduling PiP mode change directly. Long-term we shouldn't have this direct scheduling done, as a transition will make sure to update and send config and lifecycle state updates at the right time (in this case isVisibleRequested=false -> so finishTransition would handle it). We opt to use a simpler in-Shell workaround for now by using deferConfigAtEnd, to pause the dispatch of config till transition is over. Bug: 381017000 Flag: com.android.wm.shell.enable_pip2 Test: atest PipSchedulerTest Test: atest PinnedStackTests#testStopBeforeMultiWindowCallbacksOnDismiss Change-Id: I94783796ebc470c1d500510e577b0c0e9de91b9c
Loading
Please register or sign in to comment