Do not move PiP upon Display change during exit

GMM with Morris triggers Display change when exit PiP to fullscreen mode
and this creates race condition results in bounds (caused by stable
insets) offset on the final app presentation.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bq5i3we32cd8pdxAmcIMzW
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/d4FYwZ8aBnGs4Jn5uQQZVj
Bug: 184941272
Bug: 186184696
Test: manual in both gesture and button nav, see videos
Change-Id: I8e694d441cdcc7f263eb86a11d1b64a844f14c02
This commit is contained in:
Hongwei Wang
2021-05-18 15:22:21 -07:00
parent 85cf59de2f
commit 9238955119

View File

@@ -36,7 +36,6 @@ import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;
@@ -451,7 +450,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
null /* windowContainerTransaction */);
};
if (saveRestoreSnapFraction) {
if (mPipTaskOrganizer.isInPip() && saveRestoreSnapFraction) {
// Calculate the snap fraction of the current stack along the old movement bounds
final PipSnapAlgorithm pipSnapAlgorithm = mPipBoundsAlgorithm.getSnapAlgorithm();
final Rect postChangeStackBounds = new Rect(mPipBoundsState.getBounds());