Set ANDROID_LOG_NAME depending on application

Change-Id: I8ef6f87c92b01a089817a4902d33bf5d0c3a5a7a
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 4655cfd..403375f 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -13,6 +13,9 @@
 # To ignore possible wrong network configurations
 L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
 
+# Set Android log name
+L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
+
 ifdef CONFIG_DRIVER_NL80211
 L_CFLAGS += -DANDROID_BRCM_P2P_PATCH
 endif
diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index b8c5e2f..0588fc6 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -32,6 +32,10 @@
 
 #include <android/log.h>
 
+#ifndef ANDROID_LOG_NAME
+#define ANDROID_LOG_NAME	"wpa_supplicant"
+#endif
+
 void android_printf(int level, char *format, ...)
 {
 	if (level >= wpa_debug_level) {
@@ -45,7 +49,7 @@
 		else
 			level = ANDROID_LOG_DEBUG;
 		va_start(ap, format);
-		__android_log_vprint(level, "wpa_supplicant", format, ap);
+		__android_log_vprint(level, ANDROID_LOG_NAME, format, ap);
 		va_end(ap);
 	}
 }
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index 9d4b997..3d65cc6 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -31,6 +31,9 @@
 # To ignore possible wrong network configurations
 L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
 
+# Set Android log name
+L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
+
 ifdef CONFIG_DRIVER_NL80211
 L_CFLAGS += -DANDROID_BRCM_P2P_PATCH
 endif