Mark some libs as double_loadable

Following libs are explicitly marked as double_loadable since they are
one of the (indirect) dependencies of LLNDK libraries and at the same
time they themselves are marked as VNDK. Such lib can be double loaded
inside a vendor process.

* libgui and libbinder: due to indirect dependency from libmediandk via
libmediaomx. libmediandk is LLNDK)

* libui: due to dependency from libnativewindow, which is LLNDK.

Also, dependencies from libui and libgui to libpdx_default_transport and
libbufferhubque are cut when building libui and libgui for vendors. This
is primarily to exclude libpdx* and libbufferhubqueue from VNDK and
secondly not to mark transitive dependencies of the libs (such as
libcrypto) as double_loadable.

Note: even without this change, the library is already capable of being
double loaded due to the dependency chain towards it. This change is to
make it explicit so that double loading of a library is carefully
tracked and signed-off by the owner of the lib.

Bug: 77155589
Test: m -j
Change-Id: Id4768162aeb72b71d63d7e4498980f276ef58e6b
diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp
index 5fb778a..b29c1d5 100644
--- a/libs/gui/Android.bp
+++ b/libs/gui/Android.bp
@@ -23,6 +23,7 @@
     vndk: {
         enabled: true,
     },
+    double_loadable: true,
 
     clang: true,
     cflags: [
@@ -139,10 +140,26 @@
         "android.hardware.configstore-utils",
     ],
 
+    // bufferhub is not used when building libgui for vendors
+    target: {
+        vendor: {
+            cflags: ["-DNO_BUFFERHUB"],
+            exclude_srcs: [
+                "BufferHubConsumer.cpp",
+                "BufferHubProducer.cpp",
+            ],
+            exclude_shared_libs: [
+                "libbufferhubqueue",
+                "libpdx_default_transport",
+            ],
+        },
+    },
+
     header_libs: [
         "libdvr_headers",
         "libnativebase_headers",
         "libgui_headers",
+        "libpdx_headers",
     ],
 
     export_shared_lib_headers: [