bluez: pand: Enable android logging

Signed-off-by: San Mehat <san@google.com>
diff --git a/compat/Android.mk b/compat/Android.mk
index 429f703..9a7a566 100755
--- a/compat/Android.mk
+++ b/compat/Android.mk
@@ -13,14 +13,14 @@
 	pand.c bnep.c sdp.c
 
 LOCAL_CFLAGS:= \
-	-DVERSION=\"4.47\" -DSTORAGEDIR=\"/data/misc/bluetoothd\" -DNEED_PPOLL
+	-DVERSION=\"4.47\" -DSTORAGEDIR=\"/data/misc/bluetoothd\" -DNEED_PPOLL -D__ANDROID__
 
 LOCAL_C_INCLUDES:=\
 	$(LOCAL_PATH)/../include \
 	$(LOCAL_PATH)/../common \
 
 LOCAL_SHARED_LIBRARIES := \
-	libbluetooth
+	libbluetooth libcutils
 
 LOCAL_STATIC_LIBRARIES := \
 	libbluez-common-static
diff --git a/compat/pand.c b/compat/pand.c
index c3f3933..747661f 100644
--- a/compat/pand.c
+++ b/compat/pand.c
@@ -51,6 +51,11 @@
 #include "sdp.h"
 #include "pand.h"
 
+#ifdef __ANDROID__
+#include <android/log.h>
+#define syslog android_log
+#endif
+
 #ifdef NEED_PPOLL
 #include "ppoll.h"
 #endif
@@ -99,6 +104,25 @@
 	int	nsk;
 };
 
+#ifdef __ANDROID__
+static void android_log(int priority, const char *format, ...)
+{
+    va_list ap;
+    int alog_lvl;
+
+    if (priority <= LOG_ERR)
+      alog_lvl = ANDROID_LOG_ERROR;
+    else if (priority == LOG_WARNING)
+      alog_lvl = ANDROID_LOG_WARN;
+    else if (priority <= LOG_INFO)
+      alog_lvl = ANDROID_LOG_INFO;
+    else
+      alog_lvl = ANDROID_LOG_DEBUG;
+    va_start(ap, format);
+    __android_log_vprint(alog_lvl, "pand", format, ap);
+    va_end(ap);
+}
+#endif
 static void run_script(char *script, char *dev, char *dst, int sk, int nsk)
 {
 	char *argv[4];