Make system/bt build with the VNDK.

When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive
restricted sets of headers and that automatic global
headers are restricted.

Test: build system/bt with BOARD_VNDK_VERSION=current
Bug: 37342627
Change-Id: Ie1507e9b5bdb626fa0049faadd225c2c1f451661
Merged-In: Ie1507e9b5bdb626fa0049faadd225c2c1f451661
(cherry picked from commit 41401a5916f750f29af61bae35ca99f7e851333f)
diff --git a/stack/Android.bp b/stack/Android.bp
index aee82f1..5a74f70 100644
--- a/stack/Android.bp
+++ b/stack/Android.bp
@@ -19,6 +19,9 @@
         "smp",
         "srvc",
     ],
+    header_libs: [
+        "libhardware_headers",
+    ],
     include_dirs: [
         "external/aac/libAACenc/include",
         "external/aac/libSYS/include",
diff --git a/vendor_libs/linux/interface/h4_protocol.cc b/vendor_libs/linux/interface/h4_protocol.cc
index 99aeb74..e7acff4 100644
--- a/vendor_libs/linux/interface/h4_protocol.cc
+++ b/vendor_libs/linux/interface/h4_protocol.cc
@@ -20,6 +20,7 @@
 #include <android-base/logging.h>
 #include <assert.h>
 #include <fcntl.h>
+#include <sys/uio.h>
 #include <utils/Log.h>
 
 namespace android {
diff --git a/vendor_libs/test_vendor_lib/Android.bp b/vendor_libs/test_vendor_lib/Android.bp
index 7ff33e7..2905e73 100644
--- a/vendor_libs/test_vendor_lib/Android.bp
+++ b/vendor_libs/test_vendor_lib/Android.bp
@@ -37,6 +37,9 @@
         "include",
     ],
     export_include_dirs: ["include"],
+    header_libs: [
+        "libhardware_headers",
+    ],
     include_dirs: [
         "system/bt",
         "system/bt/utils/include",