Fix PiP window on rotation

Per suggestion, check WindowState.mInRelayout instead of mSurfaceResized
when trying to apply the companion SurfaceControl.Transaction of
WindowContainerTransaction.

mSurfaceResized is false when the client calls to relayout and client
renderer is paused, which can be triggered from home screen rotation for
PiP window.

Bug: 154236022
Test: manually rotate with PiP on screen
Change-Id: Ibbe1632de054a8f99c006050701d3472ddc3bbd9
This commit is contained in:
Hongwei Wang
2020-04-16 14:10:08 -07:00
parent 74918ad98b
commit ed98ad9797

View File

@@ -884,8 +884,8 @@ class WindowStateAnimator {
clipRect = mTmpClipRect;
}
if (mSurfaceResized && (mAttrType == TYPE_BASE_APPLICATION) &&
(task != null) && (task.getMainWindowSizeChangeTransaction() != null)) {
if (w.mInRelayout && (mAttrType == TYPE_BASE_APPLICATION) && (task != null)
&& (task.getMainWindowSizeChangeTransaction() != null)) {
mSurfaceController.deferTransactionUntil(mWin.getClientViewRootSurface(),
mWin.getFrameNumber());
SurfaceControl.mergeToGlobalTransaction(task.getMainWindowSizeChangeTransaction());