From 6d16c8c340eace35b0ea40496918edae47082f85 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Fri, 21 Feb 2020 12:04:31 -0800 Subject: RESTRICT AUTOMERGE - Explicitly disable BLAST for SurfaceControlViewHost surfaces Right now it crashes because the ViewRoot expects to receive a BLAST surface but the WindowlessWindowManager doesn't support it. Adding support should be relatively trivial (coming in a follow-up) but we haven't tested it yet so suggesting merging this patch for today. Bug: 150000636 Test: Existing tests pass Change-Id: I4b36d190c8f4f022dada656e02452034113a4000 (cherry picked from commit b4727e0f55a83dae0dff09dcdcde92d9eabc71a5) --- core/java/android/view/ViewRootImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 148b32744e30..4a093e6038b8 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -322,7 +322,7 @@ public final class ViewRootImpl implements ViewParent, */ private boolean mForceNextConfigUpdate; - private final boolean mUseBLASTAdapter; + private boolean mUseBLASTAdapter; /** * Signals that compatibility booleans have been initialized according to @@ -9639,4 +9639,16 @@ public final class ViewRootImpl implements ViewParent, public void onDescendantUnbufferedRequested() { mUnbufferedInputSource = mView.mUnbufferedInputSource; } + + /** + * Force disabling use of the BLAST adapter regardless of the system + * flag. Needs to be called before addView. + */ + void forceDisableBLAST() { + mUseBLASTAdapter = false; + } + + boolean useBLAST() { + return mUseBLASTAdapter; + } } -- cgit v1.2.3