From ab581a4c04adc88b178f754c20c1915d73e204d1 Mon Sep 17 00:00:00 2001 From: chaviw Date: Mon, 20 Apr 2020 12:48:19 -0700 Subject: Check for null mBlastBufferQueue If there is a sync transaction, but blast is not enabled, mNextDrawUseBLASTSyncTransaction will be true, but mBlastBufferQueue will be null. This will cause a NPE when trying to call mBlastBufferQueue.setNextTransaction Test: Use sync transaction without blast Fixes: 154527936 Change-Id: Ibff2de7fc7460f882acaceb0182c68ea4b05afb7 --- core/java/android/view/ViewRootImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index ed1edc3bd526..bcfc8c34231c 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3769,7 +3769,9 @@ public final class ViewRootImpl implements ViewParent, mNextReportConsumeBLAST = true; mNextDrawUseBLASTSyncTransaction = false; - mBlastBufferQueue.setNextTransaction(mRtBLASTSyncTransaction); + if (mBlastBufferQueue != null) { + mBlastBufferQueue.setNextTransaction(mRtBLASTSyncTransaction); + } } boolean canUseAsync = draw(fullRedrawNeeded); if (usingAsyncReport && !canUseAsync) { -- cgit v1.2.3-59-g8ed1b