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

Commit 1c3d52c1 authored by Huihong Luo's avatar Huihong Luo
Browse files

Fix NullPointerException on ThreadedRenderer

The variable, mAttachInfo.mThreadedRenderer, might be null.

Bug: 188614814
Test: run x86_64 cts test: CtsInputMethodTestCases
Change-Id: I5c441d8948dd357992ad5ef94d03deff547baa37
parent c0115519
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1410,8 +1410,6 @@ public final class ViewRootImpl implements ViewParent,
                final boolean translucent = attrs.format != PixelFormat.OPAQUE || hasSurfaceInsets;
                mAttachInfo.mThreadedRenderer = ThreadedRenderer.create(mContext, translucent,
                        attrs.getTitle().toString());
                addASurfaceTransactionCallback();
                mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl);
                updateColorModeIfNeeded(attrs.getColorMode());
                updateForceDarkMode();
                if (mAttachInfo.mThreadedRenderer != null) {
@@ -1420,6 +1418,8 @@ public final class ViewRootImpl implements ViewParent,
                    if (mHardwareRendererObserver != null) {
                        mAttachInfo.mThreadedRenderer.addObserver(mHardwareRendererObserver);
                    }
                    addASurfaceTransactionCallback();
                    mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl);
                }
            }
        }