core: Fix calling adapter_auto_connect_add when connected

This call shouldn't depend on whether we're already connected or not.
This commit is contained in:
Johan Hedberg 2014-07-01 13:54:13 +03:00
parent 5df3c149f2
commit b99ec9df94

View File

@ -4084,14 +4084,15 @@ static void device_set_auto_connect(struct btd_device *device, gboolean enable)
return;
}
/* Enabling auto connect */
adapter_auto_connect_add(device->adapter, device);
if (device->attrib) {
DBG("Already connected");
return;
}
/* Enabling auto connect */
adapter_connect_list_add(device->adapter, device);
adapter_auto_connect_add(device->adapter, device);
}
static gboolean start_discovery(gpointer user_data)