diff --git a/src/device.c b/src/device.c
index 3dde8b8..bdea55b 100644
--- a/src/device.c
+++ b/src/device.c
struct gatt_probe_data *data = user_data;
struct btd_service *service;
- if (p->device_probe == NULL)
+ if (!p->remote_uuid || bt_uuid_strcmp(p->remote_uuid, data->cur_uuid))
return;
- if (!p->remote_uuid || bt_uuid_strcmp(p->remote_uuid, data->cur_uuid))
+ /*
+ * Add device to auto connect list in case the driver has the auto
+ * connect flag set.
+ * NOTE: This should work regardless if a service is created and
+ * probed since external drivers don't need to maintain any
+ * states they don't implement device_probe callback.
+ */
+ if (p->auto_connect)
+ device_set_auto_connect(data->dev, TRUE);
+
+ if (p->device_probe == NULL)
return;
service = service_create(data->dev, p);
diff --git a/src/gatt-database.c b/src/gatt-database.c
index 91aba2f..97cef77 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
DBG("Removed \"%s\"", p->name);
adapter_foreach(adapter_remove_profile, p);
+ btd_profile_unregister(p);
g_free((void *) p->name);
g_free((void *) p->remote_uuid);
{
struct btd_adapter *adapter = user_data;
+ btd_profile_register(data);
adapter_add_profile(adapter, data);
}