Call down the chain for eglGetError

Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Test: Chromium starts up
Test: CtsDeqpTestCases:include-filter:dEQP-EGL.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES2.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES3.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES31.*
Bug: 110883880
Change-Id: I150113a05df8a2f60e3297a152e738d74ce3f51b
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 8202c4e..e3c708d 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -200,11 +200,7 @@
 
 EGLint eglGetError(void) {
     egl_connection_t* const cnx = &gEGLImpl;
-    if (cnx->platform.eglGetError) {
-        return cnx->platform.eglGetError();
-    } else {
-        return egl_tls_t::getError();
-    }
+    return cnx->platform.eglGetError();
 }
 
 __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char* procname) {
diff --git a/opengl/libs/EGL/egl_platform_entries.h b/opengl/libs/EGL/egl_platform_entries.h
index 7cd80d6..85b1db3 100644
--- a/opengl/libs/EGL/egl_platform_entries.h
+++ b/opengl/libs/EGL/egl_platform_entries.h
@@ -23,6 +23,7 @@
 
 namespace android {
 
+EGLint eglGetErrorImpl();
 EGLFuncPointer FindPlatformImplAddr(const char* name);
 
 }; // namespace android
diff --git a/opengl/libs/EGL/egl_tls.cpp b/opengl/libs/EGL/egl_tls.cpp
index b57c357..aaecb62 100644
--- a/opengl/libs/EGL/egl_tls.cpp
+++ b/opengl/libs/EGL/egl_tls.cpp
@@ -21,6 +21,7 @@
 #include <cutils/properties.h>
 #include <log/log.h>
 #include "CallStack.h"
+#include "egl_platform_entries.h"
 
 namespace android {
 
@@ -137,7 +138,7 @@
 void egl_tls_t::clearError() {
     // This must clear the error from all the underlying EGL implementations as
     // well as the EGL wrapper layer.
-    eglGetError();
+    android::eglGetErrorImpl();
 }
 
 EGLint egl_tls_t::getError() {