Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] android/bluetooth: Don't set remote name to empty string
@ 2014-02-21 16:49 Szymon Janc
  2014-02-21 16:49 ` [PATCH 2/2] android/hal-ipc: Fix race condition when closing IPC Szymon Janc
  2014-02-24 19:36 ` [PATCH 1/2] android/bluetooth: Don't set remote name to empty string Szymon Janc
  0 siblings, 2 replies; 3+ messages in thread
From: Szymon Janc @ 2014-02-21 16:49 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

If remote device has name but it is empty (0 bytes) just ignore it and
continue using address as name. This will avoid sending remote device
property notification with empty name.
---
 android/bluetooth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 31092e3..e225264 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1096,7 +1096,7 @@ static void update_new_device(struct device *dev, int8_t rssi,
 		ev->num_props++;
 	}
 
-	if (eir->name) {
+	if (eir->name && strlen(eir->name)) {
 		g_free(dev->name);
 		dev->name = g_strdup(eir->name);
 		size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_NAME,
@@ -1136,7 +1136,7 @@ static void update_device(struct device *dev, int8_t rssi,
 		ev->num_props++;
 	}
 
-	if (eir->name && strcmp(dev->name, eir->name)) {
+	if (eir->name && strlen(eir->name) && strcmp(dev->name, eir->name)) {
 		g_free(dev->name);
 		dev->name = g_strdup(eir->name);
 		size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_NAME,
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-24 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21 16:49 [PATCH 1/2] android/bluetooth: Don't set remote name to empty string Szymon Janc
2014-02-21 16:49 ` [PATCH 2/2] android/hal-ipc: Fix race condition when closing IPC Szymon Janc
2014-02-24 19:36 ` [PATCH 1/2] android/bluetooth: Don't set remote name to empty string Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox