summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2016-10-25 09:33:05 (GMT)
committerSaurav Babu <saurav.babu@samsung.com>2016-11-17 11:08:48 (GMT)
commitd91254275f7dc9a8aa1cf4155ab90d4e8428f40f (patch)
treece98d779b9646ae50ddd12f75dcd5cdbfad3def7
parent4c363bb41b30f5f50f7c03e8187a214e587dd72d (diff)
downloadconnman-d91254275f7dc9a8aa1cf4155ab90d4e8428f40f.zip
connman-d91254275f7dc9a8aa1cf4155ab90d4e8428f40f.tar.gz
connman-d91254275f7dc9a8aa1cf4155ab90d4e8428f40f.tar.bz2
Block AutoConnect when hidden connection is in progressrefs/changes/44/93044/4
Change-Id: Ic57315b49190a8c8f55ff3bc8f5aa006d2a2d915 Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
-rwxr-xr-xsrc/service.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index d891b59..34a37a7 100755
--- a/src/service.c
+++ b/src/service.c
@@ -4621,8 +4621,12 @@ static DBusMessage *connect_service(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
struct connman_service *service = user_data;
+#if defined TIZEN_EXT
+ int err = 0;
+#else
int index, err = 0;
GList *list;
+#endif
DBG("service %p", service);
@@ -4662,6 +4666,7 @@ static DBusMessage *connect_service(DBusConnection *conn,
}
}
+#if !defined TIZEN_EXT
index = __connman_service_get_index(service);
for (list = service_list; list; list = list->next) {
@@ -4687,6 +4692,7 @@ static DBusMessage *connect_service(DBusConnection *conn,
}
if (err == -EINPROGRESS)
return __connman_error_operation_timeout(msg);
+#endif
service->ignore = false;
@@ -7032,6 +7038,33 @@ static int service_connect(struct connman_service *service)
if (service->hidden)
return -EPERM;
+#if defined TIZEN_EXT
+ GList *list;
+ int index;
+
+ index = __connman_service_get_index(service);
+
+ for (list = service_list; list; list = list->next) {
+ struct connman_service *temp = list->data;
+
+ if (service->type == CONNMAN_SERVICE_TYPE_CELLULAR)
+ break;
+
+ if (!is_connecting(temp) && !is_connected(temp))
+ break;
+
+ if (service == temp)
+ continue;
+
+ if (service->type != temp->type)
+ continue;
+
+ if (__connman_service_get_index(temp) == index &&
+ __connman_service_disconnect(temp) == -EINPROGRESS)
+ return -EINPROGRESS;
+ }
+#endif
+
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM: