summaryrefslogtreecommitdiff
path: root/android/pan.c
diff options
context:
space:
mode:
authorRavi kumar Veeramally <ravikumar.veeramally@linux.intel.com>2013-12-18 16:53:11 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-12-19 10:11:14 +0200
commitfe8dabaaa1eb0583e24709031ad51d5b7ff73413 (patch)
tree321b79f26f2d4978acf79657a37ca72462f7d9e9 /android/pan.c
parentf8a38f2f684d8805a874c3e6d4a2fb981141128d (diff)
downloadbluez-fe8dabaaa1eb0583e24709031ad51d5b7ff73413.tar.gz
android/pan: Change local_role to NONE only when device list is empty
Diffstat (limited to 'android/pan.c')
-rw-r--r--android/pan.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/android/pan.c b/android/pan.c
index 2bbba9e99..b83f534f7 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -67,8 +67,6 @@ static int device_cmp(gconstpointer s, gconstpointer user_data)
static void pan_device_free(struct pan_device *dev)
{
- local_role = HAL_PAN_ROLE_NONE;
-
if (dev->watch > 0) {
g_source_remove(dev->watch);
dev->watch = 0;
@@ -81,6 +79,9 @@ static void pan_device_free(struct pan_device *dev)
devices = g_slist_remove(devices, dev);
g_free(dev);
+
+ if (g_slist_length(devices) == 0)
+ local_role = HAL_PAN_ROLE_NONE;
}
static void bt_pan_notify_conn_state(struct pan_device *dev, uint8_t state)