Merge "ViewRoot: Check Surface validity before initializing renderer from draw()." into pi-dev
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 19ead60..4bd6fc8 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -3272,7 +3272,8 @@
// eglTerminate() for instance.
if (mAttachInfo.mThreadedRenderer != null &&
!mAttachInfo.mThreadedRenderer.isEnabled() &&
- mAttachInfo.mThreadedRenderer.isRequested()) {
+ mAttachInfo.mThreadedRenderer.isRequested() &&
+ mSurface.isValid()) {
try {
mAttachInfo.mThreadedRenderer.initializeIfNeeded(