Correctly expose EGL_ANDROID_native_fence_sync to hwui

When we moved off of gui/SyncFeatures for retrieving this extension, we
accidentally didn't include the eglQueryStringImplementationANDROID path
for retrieving extensions. Fortunately this extension is only used for
TextureView synchronization, but we should still use the extension when
available.

Bug: 159921224
Test: Manually inject log statements to verify the extension is
correctly visible.

Change-Id: Idaa872778afc13e86bdea918da8631b4747fe9c1
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 32c4173..c701353 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -208,8 +208,12 @@
     return config;
 }
 
+extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name);
+
 void EglManager::initExtensions() {
     auto extensions = StringUtils::split(eglQueryString(mEglDisplay, EGL_EXTENSIONS));
+    auto extensionsAndroid =
+            StringUtils::split(eglQueryStringImplementationANDROID(mEglDisplay, EGL_EXTENSIONS));
 
     // For our purposes we don't care if EGL_BUFFER_AGE is a result of
     // EGL_EXT_buffer_age or EGL_KHR_partial_update as our usage is covered
@@ -228,9 +232,12 @@
     EglExtensions.displayP3 = extensions.has("EGL_EXT_gl_colorspace_display_p3_passthrough");
     EglExtensions.contextPriority = extensions.has("EGL_IMG_context_priority");
     EglExtensions.surfacelessContext = extensions.has("EGL_KHR_surfaceless_context");
-    EglExtensions.nativeFenceSync = extensions.has("EGL_ANDROID_native_fence_sync");
     EglExtensions.fenceSync = extensions.has("EGL_KHR_fence_sync");
     EglExtensions.waitSync = extensions.has("EGL_KHR_wait_sync");
+
+    // EGL_ANDROID_native_fence_sync is not exposed to applications, so access
+    // this through the private Android-specific query instead.
+    EglExtensions.nativeFenceSync = extensionsAndroid.has("EGL_ANDROID_native_fence_sync");
 }
 
 bool EglManager::hasEglContext() {