From a8fe8429737e86002669a540d4ab5f731f81d8f8 Mon Sep 17 00:00:00 2001 From: Valerie Hau Date: Fri, 14 Feb 2020 16:40:42 -0800 Subject: Fixing another crash when creating/updating BLASTBufferQueue If the BLAST surface control was not returned, fail early instead of trying to update the BLAST adapter Bug: N/A Test: build, boot, turn BLAST on, no crash Change-Id: Ib921fdb8c5313519ff0b09304d1e0359fcc7c018 --- core/java/android/view/ViewRootImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index b971a20d11c9..688517d86af8 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1705,12 +1705,13 @@ public final class ViewRootImpl implements ViewParent, } Surface getOrCreateBLASTSurface(int width, int height) { - if (mSurfaceControl == null || !mSurfaceControl.isValid()) { + if (mSurfaceControl == null + || !mSurfaceControl.isValid() + || mBlastSurfaceControl == null + || !mBlastSurfaceControl.isValid()) { return null; } - if ((mBlastSurfaceControl != null) - && (mBlastBufferQueue == null) - && mBlastSurfaceControl.isValid()) { + if (mBlastBufferQueue == null) { mBlastBufferQueue = new BLASTBufferQueue( mBlastSurfaceControl, width, height); } -- cgit v1.2.3-59-g8ed1b