Fix check for current EGL context

Bug: 9055251
Change-Id: I97c361bc92cbd10fbd2b2ec9196991d2379bac96
diff --git a/tests/tests/media/src/android/media/cts/InputSurface.java b/tests/tests/media/src/android/media/cts/InputSurface.java
index a916b8f..8d5c133 100644
--- a/tests/tests/media/src/android/media/cts/InputSurface.java
+++ b/tests/tests/media/src/android/media/cts/InputSurface.java
@@ -118,7 +118,7 @@
      * Surface that was passed to our constructor.
      */
     public void release() {
-        if (EGL14.eglGetCurrentContext() == mEGLContext) {
+        if (EGL14.eglGetCurrentContext().equals(mEGLContext)) {
             // Clear the current context and surface to ensure they are discarded immediately.
             EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE,
                     EGL14.EGL_NO_CONTEXT);
diff --git a/tests/tests/media/src/android/media/cts/OutputSurface.java b/tests/tests/media/src/android/media/cts/OutputSurface.java
index 8494796..5274627 100644
--- a/tests/tests/media/src/android/media/cts/OutputSurface.java
+++ b/tests/tests/media/src/android/media/cts/OutputSurface.java
@@ -183,7 +183,7 @@
      */
     public void release() {
         if (mEGL != null) {
-            if (mEGL.eglGetCurrentContext() == mEGLContext) {
+            if (mEGL.eglGetCurrentContext().equals(mEGLContext)) {
                 // Clear the current context and surface to ensure they are discarded immediately.
                 mEGL.eglMakeCurrent(mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE,
                         EGL10.EGL_NO_CONTEXT);