Fix NullPointerException on ThreadedRenderer
The variable, mAttachInfo.mThreadedRenderer, might be null. Bug: 188614814 Test: run x86_64 cts test: CtsInputMethodTestCases Change-Id: I5c441d8948dd357992ad5ef94d03deff547baa37
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user