Merge remote-tracking branch 'remotes/origin/caf/github/master' into ant.lnx.3.0

Change-Id: If39823f7336d805f1eee468fd05b79712c7ab4fa
diff --git a/Android.mk b/Android.mk
index 0124dad..6a1d050 100644
--- a/Android.mk
+++ b/Android.mk
@@ -77,6 +77,8 @@
 	$(LOCAL_PATH)/src/common/inc \
 	$(LOCAL_PATH)/app
 
+LOCAL_C_INCLUDES += frameworks/base/core/jni/include
+
 LOCAL_CFLAGS:= -g -c -W -Wall -O2
 
 LOCAL_SRC_FILES:= \
diff --git a/src/bluez_hci/Android.mk b/src/bluez_hci/Android.mk
index d638c19..ad98858 100644
--- a/src/bluez_hci/Android.mk
+++ b/src/bluez_hci/Android.mk
@@ -28,12 +28,12 @@
 LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/src/common/inc \
    $(LOCAL_PATH)/$(ANT_DIR)/inc \
-   system/bluetooth/bluez-clean-headers \
+   system/bluetooth/bluez-clean-headers
 
 ifeq ($(BOARD_ANT_WIRELESS_POWER),"bluedroid")
 LOCAL_CFLAGS += \
    -DBOARD_HAVE_ANT_WIRELESS \
-   -DUSE_EXTERNAL_POWER_LIBRARY \
+   -DUSE_EXTERNAL_POWER_LIBRARY
 
 LOCAL_C_INCLUDES += system/bluetooth/bluedroid/include/bluedroid
 endif # BOARD_ANT_WIRELESS_POWER = bluedroid
@@ -43,24 +43,24 @@
    $(COMMON_DIR)/ant_utils.c \
    $(ANT_DIR)/ant_native_hci.c \
    $(ANT_DIR)/ant_rx.c \
-   $(ANT_DIR)/ant_tx.c \
+   $(ANT_DIR)/ant_tx.c
 
 # JNI
 LOCAL_C_INCLUDE += $(JNI_H_INCLUDE)
 
 LOCAL_SHARED_LIBRARIES += \
-   libnativehelper \
+   libnativehelper
 
 # chip power
 LOCAL_SHARED_LIBRARIES += \
-   libbluedroid \
+   libbluedroid
 
 # logging
 LOCAL_SHARED_LIBRARIES += \
    libcutils \
+   liblog
 
 LOCAL_MODULE_TAGS := optional
-LOCAL_PRELINK_MODULE := false
 LOCAL_MODULE := libantradio
 LOCAL_SYSTEM_EXT_MODULE := true
 
diff --git a/src/bt-vendor_vfs/Android.mk b/src/bt-vendor_vfs/Android.mk
index 669cbbc..71b3130 100644
--- a/src/bt-vendor_vfs/Android.mk
+++ b/src/bt-vendor_vfs/Android.mk
@@ -19,39 +19,44 @@
 LOCAL_CFLAGS := -g -c -W -Wall -O2
 
 # needed to pull in the header file for libbt-vendor.so
-BDROID_DIR:= external/bluetooth/bluedroid
+BDROID_DIR:= system/bt
+QCOM_DIR:= hardware/qcom/bt/libbt-vendor
 
 # Added hci/include to give access to the header for the libbt-vendorso interface.
 LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/src/common/inc \
    $(LOCAL_PATH)/$(ANT_DIR)/inc \
    $(BDROID_DIR)/hci/include \
+   $(QCOM_DIR)/include
+
 
 ifeq ($(BOARD_ANT_WIRELESS_DEVICE),"qualcomm-uart")
 LOCAL_C_INCLUDES += \
-   $(LOCAL_PATH)/$(ANT_DIR)/qualcomm/uart \
+   $(LOCAL_PATH)/$(ANT_DIR)/qualcomm/uart
 
 endif # BOARD_ANT_WIRELESS_DEVICE = "qualcomm-uart"
 
 LOCAL_SRC_FILES := \
-   $(COMMON_DIR)/JAntNative.cpp \
    $(COMMON_DIR)/ant_utils.c \
    $(ANT_DIR)/ant_native_chardev.c \
-   $(ANT_DIR)/ant_rx_chardev.c \
+   $(ANT_DIR)/ant_rx_chardev.c
+
+LOCAL_SRC_FILES += $(COMMON_DIR)/JAntNative.cpp
+
 
 # JNI
 LOCAL_C_INCLUDE += $(JNI_H_INCLUDE)
 
 LOCAL_SHARED_LIBRARIES += \
-   libnativehelper \
+   libnativehelper
 
 # logging and dll loading
 LOCAL_SHARED_LIBRARIES += \
    libcutils \
    libdl \
+   liblog
 
 LOCAL_MODULE_TAGS := optional
-LOCAL_PRELINK_MODULE := false
 LOCAL_MODULE := libantradio
 LOCAL_SYSTEM_EXT_MODULE := true
 
diff --git a/src/bt-vendor_vfs/ant_native_chardev.c b/src/bt-vendor_vfs/ant_native_chardev.c
index a90c8c4..ec801a8 100644
--- a/src/bt-vendor_vfs/ant_native_chardev.c
+++ b/src/bt-vendor_vfs/ant_native_chardev.c
@@ -34,6 +34,7 @@
 #include <stdint.h> /* for uint64_t */
 #include <sys/eventfd.h> /* For eventfd() */
 #include <unistd.h> /* for read(), write(), and close() */
+#include <string.h>
 
 #include "ant_types.h"
 #include "ant_native.h"
@@ -43,7 +44,7 @@
 #include "ant_rx_chardev.h"
 #include "ant_hci_defines.h"
 #include "ant_log.h"
-#include "bt_vendor_lib.h" /* used by qualcomms code to call into libbt-vendor.so */
+#include "bt_vendor_qcom.h" /* used by qualcomms code to call into libbt-vendor.so */
 #include <cutils/properties.h> /* used by qualcomms additions for logging. */
 // The following functions are dummy implementations of the callbacks required by libbt-vendor.
 static void vendor_fwcfg_cb(bt_vendor_op_result_t result) {
@@ -915,7 +916,6 @@
         if (vendor_interface) {
             ALOGE("Close and cleanup the interfaces");
             int ret = vendor_interface->op(BT_VND_OP_ANT_USERIAL_CLOSE, NULL);
-
             ALOGE("ret value: %d", ret);
             ALOGI("Turn off BT power");
             powerstate = BT_VND_PWR_OFF;
diff --git a/src/bt-vendor_vfs/ant_rx_chardev.c b/src/bt-vendor_vfs/ant_rx_chardev.c
index 69656b2..6336524 100644
--- a/src/bt-vendor_vfs/ant_rx_chardev.c
+++ b/src/bt-vendor_vfs/ant_rx_chardev.c
@@ -30,6 +30,7 @@
 #include <poll.h>
 #include <pthread.h>
 #include <stdint.h> /* for uint64_t */
+#include <string.h>
 
 #include "ant_types.h"
 #include "antradio_power.h"
diff --git a/src/common/JAntNative.cpp b/src/common/JAntNative.cpp
index 2e3beb0..9653bfd 100644
--- a/src/common/JAntNative.cpp
+++ b/src/common/JAntNative.cpp
@@ -25,7 +25,6 @@
 *
 \*******************************************************************************/
 
-#include "android_runtime/AndroidRuntime.h"
 #include "jni.h"
 #include "nativehelper/JNIHelp.h"
 
diff --git a/src/vfs/Android.mk b/src/vfs/Android.mk
index 2fb235f..f636af1 100644
--- a/src/vfs/Android.mk
+++ b/src/vfs/Android.mk
@@ -16,7 +16,7 @@
 

 include $(CLEAR_VARS)

 

-LOCAL_CFLAGS := -g -c -W -Wall -O2

+LOCAL_CFLAGS := -g -c -W -Wall -O2 -Wno-unused-parameter

 

 LOCAL_C_INCLUDES := \

    $(LOCAL_PATH)/src/common/inc \

@@ -46,14 +46,14 @@
 LOCAL_C_INCLUDE += $(JNI_H_INCLUDE)

 

 LOCAL_SHARED_LIBRARIES += \

-   libnativehelper \

+   libnativehelper

 

 # logging

 LOCAL_SHARED_LIBRARIES += \

    libcutils \

+   liblog

 

 LOCAL_MODULE_TAGS := optional

-LOCAL_PRELINK_MODULE := false

 LOCAL_MODULE := libantradio

 LOCAL_SYSTEM_EXT_MODULE := true

 

diff --git a/src/vfs/ant_native_chardev.c b/src/vfs/ant_native_chardev.c
index 1ab8f29..2605776 100644
--- a/src/vfs/ant_native_chardev.c
+++ b/src/vfs/ant_native_chardev.c
@@ -27,6 +27,7 @@
 \******************************************************************************/
 
 #include <errno.h>
+#include <string.h>
 #include <fcntl.h> /* for open() */
 #include <linux/ioctl.h> /* For hard reset */
 #include <pthread.h>
diff --git a/src/vfs/ant_rx_chardev.c b/src/vfs/ant_rx_chardev.c
index c1027d5..3876119 100644
--- a/src/vfs/ant_rx_chardev.c
+++ b/src/vfs/ant_rx_chardev.c
@@ -27,6 +27,7 @@
 \******************************************************************************/
 
 #include <errno.h>
+#include <string.h>
 #include <poll.h>
 #include <pthread.h>
 #include <stdint.h> /* for uint64_t */