core/device: Use service auto_connect flag
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 7 Feb 2014 14:28:36 +0000 (16:28 +0200)
committerMikko Ylinen <mikko.ylinen@intel.com>
Tue, 23 Sep 2014 18:29:21 +0000 (21:29 +0300)
This make use of service auto_connect flag to determine if the service
should be included in the list to be connected.

src/device.c

index 2c2223d..738128f 100644 (file)
@@ -1299,7 +1299,6 @@ static int service_prio_cmp(gconstpointer a, gconstpointer b)
 static GSList *create_pending_list(struct btd_device *dev, const char *uuid)
 {
        struct btd_service *service;
-       struct btd_profile *p;
        GSList *l;
 
        if (uuid) {
@@ -1312,9 +1311,8 @@ static GSList *create_pending_list(struct btd_device *dev, const char *uuid)
 
        for (l = dev->services; l != NULL; l = g_slist_next(l)) {
                service = l->data;
-               p = btd_service_get_profile(service);
 
-               if (!p->auto_connect)
+               if (!btd_service_get_auto_connect(service))
                        continue;
 
                if (g_slist_find(dev->pending, service))