[PiP2]Send config changes after stop upon PiP-exit
Context: In an effort to have PiP2 rely on Transitions as much as possible, we had it adhere to Transitions policy on lifecycle and config-changes. More specifically, with PiP2 we just send configuration updates upon transition start/end as needed. Issue: When an activity's isVisibleRequested=false, Transitions framework skips the dispatch of config-updates to the client after lifecycle updates (i.e. onStop). However, PiP needs to follow a contract wherein onPictureInPictureModeChanged(inPip, newConfig) is dispatched with the latest new config even after the activity receives onStop. Solution: To send config updates for the activity leaving PiP right after scheduling its stopping. Unlike how it's done in PiP1 with a special-case force-hidden, we are doing this at the end of the transition, as our goal is to keep running the remove-PiP animation as a part of TRANSIT_REMOVE_PIP while the activity is PAUSED. We can reuse ActivityRecord#updatePictureInPictureMode() for this. Bug: 403103525 Flag: com.android.wm.shell.enable_pip2 Test: atest PinnedStackTests#testStopBeforeMultiWindowCallbacksOnDismiss Change-Id: I2f1f7a11fb44dcbcb582d8693089a0893da3d013
Loading
Please register or sign in to comment