Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8fe8429 authored by Valerie Hau's avatar Valerie Hau
Browse files

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
parent 47c7acb5
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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);
        }