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

Commit eca9b1f5 authored by Romain Guy's avatar Romain Guy
Browse files

Prevent crash in VPN settings

Bug #5217245

Change-Id: Ibacf4cbd40537cd417f1518b5ac4367a3f3d7d03
parent 97c46181
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -413,8 +413,8 @@ public abstract class HardwareRenderer {
                if (error != EGL_SUCCESS) {
                    // something bad has happened revert to
                    // normal rendering.
                    fallback(error != EGL11.EGL_CONTEXT_LOST);
                    Log.w(LOG_TAG, "EGL error: " + GLUtils.getEGLErrorString(error));
                    fallback(error != EGL11.EGL_CONTEXT_LOST);
                }
            }
        }
@@ -702,9 +702,10 @@ public abstract class HardwareRenderer {

        @Override
        void setup(int width, int height) {
            checkCurrent();
            if (validate()) {
                mCanvas.setViewport(width, height);
            }
        }

        boolean canDraw() {
            return mGl != null && mCanvas != null;
@@ -810,9 +811,9 @@ public abstract class HardwareRenderer {
            if (!mEglContext.equals(sEgl.eglGetCurrentContext()) ||
                    !mEglSurface.equals(sEgl.eglGetCurrentSurface(EGL_DRAW))) {
                if (!sEgl.eglMakeCurrent(sEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
                    fallback(true);
                    Log.e(LOG_TAG, "eglMakeCurrent failed " +
                            GLUtils.getEGLErrorString(sEgl.eglGetError()));
                    fallback(true);
                    return SURFACE_STATE_ERROR;
                } else {
                    return SURFACE_STATE_UPDATED;
+1 −1
Original line number Diff line number Diff line
@@ -1352,7 +1352,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
                    mAttachInfo.mHardwareRenderer != null &&
                    mAttachInfo.mHardwareRenderer.isEnabled())) {
                mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight);
                if (!hwInitialized) {
                if (!hwInitialized && mAttachInfo.mHardwareRenderer.isEnabled()) {
                    mAttachInfo.mHardwareRenderer.invalidate(mHolder);
                }
            }