service: A preferred service in state ready is good enough
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 17 Oct 2012 10:34:21 +0000 (13:34 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 18 Oct 2012 10:26:40 +0000 (13:26 +0300)
Simplify the preferred service selection such that a connected
service is good enough, especially since a connecting service
will also terminate the search for the current preferred one.

src/service.c

index 5dee4cd..712aa9a 100644 (file)
@@ -3408,12 +3408,8 @@ static connman_bool_t auto_connect_service(GSequenceIter* iter,
                        return FALSE;
                }
 
-               if (is_connected(service) == TRUE) {
-                       if (preferred == TRUE && service->state !=
-                                       CONNMAN_SERVICE_STATE_ONLINE)
-                               goto next_service;
+               if (is_connected(service) == TRUE)
                        return TRUE;
-               }
 
                if (is_ignore(service) == FALSE && service->state ==
                                CONNMAN_SERVICE_STATE_IDLE)