From f0a24dd2be43c650a9c21004a0c8c2f562f3883f Mon Sep 17 00:00:00 2001 From: Valerie Hau Date: Fri, 31 Jan 2020 14:28:00 -0800 Subject: [PATCH] Fix segfault in ViewRootImpl on BLAST Recent deferTransaction change created bootloop when BLAST is turned on Bug: 146345307 Test: build, boot, manual Change-Id: Ib5e484c39d11260026694fc2a32015d8a7f04baf --- core/java/android/view/ViewRootImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 2b4b71f01aa57..7613dd8f03559 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1691,7 +1691,7 @@ public final class ViewRootImpl implements ViewParent, .build(); setBoundsLayerCrop(); mTransaction.show(mBoundsLayer).apply(); - } + } return mBoundsLayer; } @@ -1699,7 +1699,9 @@ public final class ViewRootImpl implements ViewParent, if (mSurfaceControl == null || !mSurfaceControl.isValid()) { return null; } - if ((mBlastBufferQueue != null) && mBlastSurfaceControl.isValid()) { + if ((mBlastSurfaceControl != null) + && (mBlastBufferQueue == null) + && mBlastSurfaceControl.isValid()) { mBlastBufferQueue = new BLASTBufferQueue( mBlastSurfaceControl, width, height); }