Improve error message
The previous message indicated that the fault was due to an already-
connected window, which was misleading at times.
Bug 12439318
Change-Id: I1e0a042673dd245d1b0d237af963c52946803eb6
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 0cc5265..b02ee0f 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -408,9 +408,11 @@
if (dp) {
EGLDisplay iDpy = dp->disp.dpy;
- if (native_window_api_connect(window, NATIVE_WINDOW_API_EGL) != OK) {
- ALOGE("EGLNativeWindowType %p already connected to another API",
- window);
+ int result = native_window_api_connect(window, NATIVE_WINDOW_API_EGL);
+ if (result != OK) {
+ ALOGE("eglCreateWindowSurface: native_window_api_connect (win=%p) "
+ "failed (%#x) (already connected to another API?)",
+ window, result);
return setError(EGL_BAD_ALLOC, EGL_NO_SURFACE);
}