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

Commit f59392f6 authored by John Reck's avatar John Reck Committed by The Android Automerger
Browse files

Fix NPE in setSurfaceTexure

Bug: 20088412
Change-Id: I9b78636a7d89438c8924bb1bf2adba00e74366eb
parent c68772b6
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -730,9 +730,13 @@ public class TextureView extends View {
        }
        mSurface = surfaceTexture;

        // If the view is visible, update the listener in the new surface to use
        // the existing listener in the view.
        if (((mViewFlags & VISIBILITY_MASK) == VISIBLE)) {
        /*
         * If the view is visible and we already made a layer, update the
         * listener in the new surface to use the existing listener in the view.
         * Otherwise this will be called when the view becomes visible or the
         * layer is created
         */
        if (((mViewFlags & VISIBILITY_MASK) == VISIBLE) && mLayer != null) {
            mSurface.setOnFrameAvailableListener(mUpdateListener, mAttachInfo.mHandler);
        }
        mUpdateSurface = true;