[vulkan] Enable VK_ANDROID_external_memory_android_hardware_buffer

Fixes: 122080810

deqp vk mustpass failures up to 20;
let's fix forward as they are mainly around sync fd not working yet
and external memory opaque fd being wrongly advertised.

Change-Id: I274e58c74c683764cf85fa601d314b4251034e31
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp
index 5d39822..2ff7569 100644
--- a/system/vulkan_enc/ResourceTracker.cpp
+++ b/system/vulkan_enc/ResourceTracker.cpp
@@ -696,6 +696,7 @@
             "VK_KHR_sampler_ycbcr_conversion",
 #ifdef VK_USE_PLATFORM_ANDROID_KHR
             "VK_KHR_external_semaphore_capabilities",
+            "VK_KHR_external_memory_capabilities",
 #endif
             // TODO:
             // VK_KHR_external_memory_capabilities
@@ -772,6 +773,7 @@
             "VK_KHR_external_semaphore",
             "VK_KHR_external_semaphore_fd",
             // "VK_KHR_external_semaphore_win32", not exposed because it's translated to fd
+            "VK_KHR_external_memory",
 #endif
             // "VK_KHR_maintenance2",
             // "VK_KHR_maintenance3",
@@ -842,6 +844,24 @@
                 { "VK_KHR_external_semaphore_fd", 1});
         }
 
+        bool win32ExtMemAvailable =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_memory_win32") != -1;
+        bool posixExtMemAvailable =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_memory_fd") != -1;
+
+        bool hostHasExternalMemorySupport =
+            win32ExtMemAvailable || posixExtMemAvailable;
+
+        if (hostHasExternalMemorySupport) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+            filteredExts.push_back({
+                "VK_ANDROID_external_memory_android_hardware_buffer", 7
+            });
+#endif
+        }
+
         if (pPropertyCount) {
             *pPropertyCount = filteredExts.size();
         }