Merge "Add missing headers to libbt-vendor"
diff --git a/msm8998/libbt-vendor/Android.mk b/msm8998/libbt-vendor/Android.mk
index f75ad1a..91d098e 100644
--- a/msm8998/libbt-vendor/Android.mk
+++ b/msm8998/libbt-vendor/Android.mk
@@ -66,6 +66,9 @@
         libcutils \
         liblog
 
+LOCAL_HEADER_LIBRARIES := \
+        libutils_headers
+
 LOCAL_MODULE := libbt-vendor
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
diff --git a/msm8998/libbt-vendor/include/hci_uart.h b/msm8998/libbt-vendor/include/hci_uart.h
index 21e9689..50740d7 100644
--- a/msm8998/libbt-vendor/include/hci_uart.h
+++ b/msm8998/libbt-vendor/include/hci_uart.h
@@ -20,6 +20,7 @@
 #define HCI_UART_H
 
 #include <asm-generic/ioctls.h>
+#include <termios.h>
 
 /* Variables to identify the platform */
 /*BT HS UART TTY DEVICE */
diff --git a/msm8998/libbt-vendor/include/hw_ar3k.h b/msm8998/libbt-vendor/include/hw_ar3k.h
index 2129548..1b22f4f 100644
--- a/msm8998/libbt-vendor/include/hw_ar3k.h
+++ b/msm8998/libbt-vendor/include/hw_ar3k.h
@@ -18,6 +18,8 @@
 #ifndef HW_AR3K_H
 #define HW_AR3K_H
 
+#include <sys/socket.h>
+
 /******************************************************************************
 **  Constants & Macros
 ******************************************************************************/
diff --git a/msm8998/libbt-vendor/src/bt_vendor_qcom.c b/msm8998/libbt-vendor/src/bt_vendor_qcom.c
index 8a8397c..c050fb6 100644
--- a/msm8998/libbt-vendor/src/bt_vendor_qcom.c
+++ b/msm8998/libbt-vendor/src/bt_vendor_qcom.c
@@ -26,20 +26,24 @@
 #define LOG_TAG "bt_vendor"
 #define BLUETOOTH_MAC_ADDR_BOOT_PROPERTY "ro.boot.btmacaddr"
 
-#include <utils/Log.h>
-#include <cutils/properties.h>
-#include <fcntl.h>
-#include <termios.h>
+#include "bt_vendor_lib.h"
+#include "bt_vendor_persist.h"
 #include "bt_vendor_qcom.h"
-#include "hci_uart.h"
 #include "hci_smd.h"
+#include "hci_uart.h"
+#include "hw_rome.h"
+
+#include <fcntl.h>
+#include <linux/un.h>
+#include <pthread.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <cutils/properties.h>
 #include <cutils/sockets.h>
-#include <linux/un.h>
-#include "bt_vendor_persist.h"
-#include "hw_rome.h"
-#include "bt_vendor_lib.h"
+#include <utils/Log.h>
 #define WAIT_TIMEOUT 200000
 #define BT_VND_OP_GET_LINESPEED 30
 
@@ -604,7 +608,7 @@
 
     q.rfkill_id = -1;
     q.enable_extldo = FALSE;
-    q.cb = cb;
+    q.cb = (bt_vendor_callbacks_t*)cb;
     q.ant_fd = -1;
     q.soc_type = get_bt_soc_type();
     soc_init(q.soc_type);
diff --git a/msm8998/libbt-vendor/src/hardware.c b/msm8998/libbt-vendor/src/hardware.c
index 6984ff0..cd6790b 100644
--- a/msm8998/libbt-vendor/src/hardware.c
+++ b/msm8998/libbt-vendor/src/hardware.c
@@ -26,20 +26,22 @@
 
 #define LOG_TAG "bt_vendor"
 
-#include <utils/Log.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <ctype.h>
-#include <cutils/properties.h>
-#include <stdlib.h>
 #include "bt_hci_bdroid.h"
 #include "bt_vendor_qcom.h"
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
 #include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <cutils/properties.h>
+#include <utils/Log.h>
 #define MAX_CNT_RETRY 100
 
 int hw_config(int nState)
diff --git a/msm8998/libbt-vendor/src/hci_smd.c b/msm8998/libbt-vendor/src/hci_smd.c
index 7e5b16d..9833281 100644
--- a/msm8998/libbt-vendor/src/hci_smd.c
+++ b/msm8998/libbt-vendor/src/hci_smd.c
@@ -24,15 +24,18 @@
 
 #define LOG_TAG "bt_vendor"
 
-#include <utils/Log.h>
-#include <termios.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
 #include "bt_vendor_qcom.h"
 #include "hci_smd.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
 #include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
 #include <cutils/properties.h>
+#include <utils/Log.h>
 
 /*****************************************************************************
 **   Macros & Constants
diff --git a/msm8998/libbt-vendor/src/hci_uart.c b/msm8998/libbt-vendor/src/hci_uart.c
index 2aeace8..fa0fc0f 100644
--- a/msm8998/libbt-vendor/src/hci_uart.c
+++ b/msm8998/libbt-vendor/src/hci_uart.c
@@ -26,14 +26,18 @@
 
 #define LOG_TAG "bt_vendor"
 
-#include <utils/Log.h>
-#include <termios.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
 #include "bt_vendor_qcom.h"
 #include "hci_uart.h"
+
+#include <asm-generic/ioctls.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
 #include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <utils/Log.h>
 
 /******************************************************************************
 **  Constants & Macros
diff --git a/msm8998/libbt-vendor/src/hw_ar3k.c b/msm8998/libbt-vendor/src/hw_ar3k.c
index 1a68aab..b484d0b 100644
--- a/msm8998/libbt-vendor/src/hw_ar3k.c
+++ b/msm8998/libbt-vendor/src/hw_ar3k.c
@@ -34,26 +34,29 @@
 
 #define LOG_TAG "bt_vendor"
 
-#include <sys/socket.h>
-#include <utils/Log.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <ctype.h>
-#include <cutils/properties.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <string.h>
-
 #include "bt_hci_bdroid.h"
 #include "bt_vendor_qcom.h"
+#include "bt_vendor_qcom.h"
 #include "hci_uart.h"
 #include "hw_ar3k.h"
-#include "bt_vendor_qcom.h"
+
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <termios.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <cutils/properties.h>
+#include <utils/Log.h>
 
 /******************************************************************************
 **  Variables
diff --git a/msm8998/libbt-vendor/src/hw_rome.c b/msm8998/libbt-vendor/src/hw_rome.c
index 58c0159..cf34006 100644
--- a/msm8998/libbt-vendor/src/hw_rome.c
+++ b/msm8998/libbt-vendor/src/hw_rome.c
@@ -34,26 +34,29 @@
 
 #define LOG_TAG "bt_vendor"
 
-#include <sys/socket.h>
-#include <utils/Log.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <time.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <ctype.h>
-#include <cutils/properties.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <string.h>
-#include <stdbool.h>
 #include "bt_hci_bdroid.h"
 #include "bt_vendor_qcom.h"
 #include "hci_uart.h"
 #include "hw_rome.h"
 
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <termios.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <cutils/properties.h>
+#include <utils/Log.h>
+
 #ifdef __cplusplus
 }
 #endif