Do not offset PiP when auto-enter-pip is ongoing

This is fix the problem when
- Swiping an auto-enter-pip enabled Activity to home AND
- Launcher activity gets destroyed and finishes the recents animation

then
- WMShell nevers gets onTaskAppeared for PiP since the Activity actually
  does not enter PiP
- However, WMShell does receive shelf height change in response to the
  re-creation of Launcher activity
- Therefore, WMShell tries to animating a blank leash using the default
  setup (like, default aspect ratio) and it's visible since we set the
  shadow radius on it

Fix this in WMShell by not allowing offset PiP while auto-enter-pip
animation is ongoing.

Bug: 232184236
Test: follow the reproduce step in bug
Change-Id: Idef3806c9e34813b39127d270138501d441c0884
This commit is contained in:
Hongwei Wang
2022-05-12 13:01:51 -07:00
parent 5f951629d3
commit a76c0f92f4

View File

@@ -1292,7 +1292,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
*/
public void scheduleOffsetPip(Rect originalBounds, int offset, int duration,
Consumer<Rect> updateBoundsCallback) {
if (mPipTransitionState.shouldBlockResizeRequest()) {
if (mPipTransitionState.shouldBlockResizeRequest()
|| mPipTransitionState.getInSwipePipToHomeTransition()) {
return;
}
if (mWaitForFixedRotation) {