Fix NPE in deferToPendingTransaction.

Just because a child window has a surface doesn't necessarily
mean the parent window will have a surface. destroySurfaceLocked()
only takes care of setting mAttachedHidden so the child surface
will be invisible, but it may not be destroyed until a later point.

Bug: 30813094
Change-Id: Idb1b03fd61a7537ebfe33bafc93f278c0e6751f4
This commit is contained in:
Robert Carr
2016-08-11 13:03:02 -07:00
parent ff38f6a699
commit c24078f1a2

View File

@@ -2066,7 +2066,8 @@ class WindowStateAnimator {
if (time > mDeferTransactionTime + PENDING_TRANSACTION_FINISH_WAIT_TIME) {
mDeferTransactionTime = -1;
mDeferTransactionUntilFrame = -1;
} else {
} else if (mWin.mAttachedWindow != null &&
mWin.mAttachedWindow.mWinAnimator.hasSurface()) {
mSurfaceController.deferTransactionUntil(
mWin.mAttachedWindow.mWinAnimator.mSurfaceController.getHandle(),
mDeferTransactionUntilFrame);