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

Commit 7dee7a38 authored by Jack Palevich's avatar Jack Palevich
Browse files

Notify monitor waiters when changing mSurfaceIsBad value.

Otherwise the waiters might not wake up, leading to ANRs.

Bug: 6307843
Change-Id: I0646b4e8368f80dbff46342f75709992796973fd
parent c38cf4c7
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1459,7 +1459,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
                            Log.w("GLThread", "egl createSurface");
                        }
                        if (!mEglHelper.createSurface()) {
                            synchronized(sGLThreadManager) {
                                mSurfaceIsBad = true;
                                sGLThreadManager.notifyAll();
                            }
                            continue;
                        }
                        createEglSurface = false;
@@ -1519,7 +1522,11 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
                            // but we haven't been notified yet.
                            // Log the error to help developers understand why rendering stopped.
                            EglHelper.logEglErrorAsWarning("GLThread", "eglSwapBuffers", swapError);

                            synchronized(sGLThreadManager) {
                                mSurfaceIsBad = true;
                                sGLThreadManager.notifyAll();
                            }
                            break;
                    }