Unify libstagefright_bufferqueue_helper and client.so

make sure the libstagefright_bufferqueue_helper.so uses the static,
no-binder version of bq on vendor side, while uses libgui on client side.

bug: 139201422
test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small

build and manually check the correct version gets installed on
apex & system.
Change-Id: I51ca0943fd89cd944f285e5f4be3db789fd6dc20
diff --git a/media/codec2/sfplugin/Android.bp b/media/codec2/sfplugin/Android.bp
index cb60a45..94034b5 100644
--- a/media/codec2/sfplugin/Android.bp
+++ b/media/codec2/sfplugin/Android.bp
@@ -45,7 +45,7 @@
         "libmedia_codeclist",
         "libmedia_omx",
         "libsfplugin_ccodec_utils",
-        "libstagefright_bufferqueue_helper_client",
+        "libstagefright_bufferqueue_helper",
         "libstagefright_codecbase",
         "libstagefright_foundation",
         "libstagefright_omx",
diff --git a/media/libstagefright/bqhelper/Android.bp b/media/libstagefright/bqhelper/Android.bp
index f4548ff..9c64d79 100644
--- a/media/libstagefright/bqhelper/Android.bp
+++ b/media/libstagefright/bqhelper/Android.bp
@@ -1,5 +1,10 @@
-cc_defaults {
-    name: "libstagefright_bufferqueue-defaults",
+cc_library_shared {
+    name: "libstagefright_bufferqueue_helper",
+    vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
+
     double_loadable: true,
     srcs: [
         "FrameDropper.cpp",
@@ -21,6 +26,7 @@
     shared_libs: [
         "libbase",
         "libcutils",
+        "libgui",
         "libhidlbase",
         "libhidlmemory",
         "liblog",
@@ -29,12 +35,14 @@
         "libutils",
 
         "android.hardware.graphics.bufferqueue@1.0",
+        "android.hardware.graphics.bufferqueue@2.0",
     ],
 
     export_shared_lib_headers: [
         "libhidlmemory",
         "libstagefright_foundation",
         "android.hardware.graphics.bufferqueue@1.0",
+        "android.hardware.graphics.bufferqueue@2.0",
     ],
 
     cflags: [
@@ -44,6 +52,26 @@
         "-Wno-documentation",
     ],
 
+    target: {
+        vendor: {
+            exclude_shared_libs: [
+                "libgui",
+            ],
+            static_libs: [
+                "libgui_bufferqueue_static",
+            ],
+            shared_libs: [
+                "android.hidl.token@1.0-utils",
+                "libEGL",
+                "libnativewindow",
+                "libvndksupport",
+            ],
+            cflags: [
+                "-DNO_BINDER",
+            ],
+        },
+    },
+
     sanitize: {
         misc_undefined: [
             "signed-integer-overflow",
@@ -52,38 +80,3 @@
         cfi: true,
     },
 }
-
-cc_library_shared {
-    name: "libstagefright_bufferqueue_helper",
-    defaults: ["libstagefright_bufferqueue-defaults"],
-    vendor_available: true,
-    vndk: {
-        enabled: true,
-    },
-    static_libs: [
-        "libgui_bufferqueue_static"
-    ],
-    shared_libs: [
-        "android.hardware.graphics.bufferqueue@2.0",
-        "android.hidl.token@1.0-utils",
-        "libEGL",
-        "libnativewindow",
-        "libvndksupport",
-    ],
-    export_shared_lib_headers: [
-        "android.hardware.graphics.bufferqueue@2.0",
-    ],
-    cflags: [
-        "-DNO_BINDER",
-    ],
-}
-
-cc_library_shared {
-    name: "libstagefright_bufferqueue_helper_client",
-    defaults: ["libstagefright_bufferqueue-defaults"],
-    vendor_available: false,
-    shared_libs: [
-        "libgui"
-    ],
-}
-