WM: Guard against released surfaces in forced rotator

Fixes: 119470176
Test: Rotate phone with cutout enabled, verify cutout overlay is still properly synchornized and SystemUI does not crash.
(cherry picked from commit dcb24ca471)

Merged-In: Ibce67ccede8f114b82779a74853e43b3abe44c55
Change-Id: Ibce67ccede8f114b82779a74853e43b3abe44c55
This commit is contained in:
Vishnu Nair
2018-11-20 08:01:57 -08:00
parent 5bdf255e0d
commit 4a17e47530

View File

@@ -75,12 +75,14 @@ public class ForcedSeamlessRotator {
public void finish(WindowToken token, WindowState win) {
mTransform.reset();
token.getPendingTransaction().setMatrix(token.mSurfaceControl, mTransform, mFloat9);
token.getPendingTransaction().deferTransactionUntil(token.mSurfaceControl,
win.mWinAnimator.mSurfaceController.mSurfaceControl.getHandle(),
win.getFrameNumber());
win.getPendingTransaction().deferTransactionUntil(win.mSurfaceControl,
win.mWinAnimator.mSurfaceController.mSurfaceControl.getHandle(),
win.getFrameNumber());
if (win.mWinAnimator.mSurfaceController != null) {
token.getPendingTransaction().deferTransactionUntil(token.mSurfaceControl,
win.mWinAnimator.mSurfaceController.mSurfaceControl.getHandle(),
win.getFrameNumber());
win.getPendingTransaction().deferTransactionUntil(win.mSurfaceControl,
win.mWinAnimator.mSurfaceController.mSurfaceControl.getHandle(),
win.getFrameNumber());
}
}
public void dump(PrintWriter pw) {