Extract GPDIFP2 getProducerUsage path to seperate function

Extracting the GPDIFP2 logic to its own function makes it easier to
exit early from the GPDIFP2 path when we need to fall back to the
GetSwapchainGrallocUsage*ANDROID path.

This change also fixes an issue where we would exit getProducerUsage
early instead of falling back to the gralloc paths if GPDIFP2 would
return an error when called with an unsupported format.

Bug: 379230826
Test: atest libvulkan_test
Flag: EXEMPT bugfix
Change-Id: I42f1fe31e5e4a01c472a12854a1f4e989d2786dc
diff --git a/vulkan/libvulkan/Android.bp b/vulkan/libvulkan/Android.bp
index 879d2d0..be8fb3e 100644
--- a/vulkan/libvulkan/Android.bp
+++ b/vulkan/libvulkan/Android.bp
@@ -22,6 +22,13 @@
     default_applicable_licenses: ["frameworks_native_license"],
 }
 
+// Expose internal header files to test testing binary
+cc_library_headers {
+    name: "libvulkanprivate_headers-testing",
+    export_include_dirs: ["."],
+    visibility: ["//frameworks/native/vulkan/tests"],
+}
+
 ndk_library {
     name: "libvulkan",
     symbol_file: "libvulkan.map.txt",