summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorHenri Bragge <henri.bragge@ixonos.com>2011-03-02 16:42:04 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-02 16:42:04 +0100
commitcf2d450a89a756d123f7430e866a21b5d3e706cd (patch)
tree051c2fd96d3baf20e993950aa361d6dd592399a2 /plugins
parent5a61086d5f73f15199f123d4090c0c24b91eed23 (diff)
downloadconnman-cf2d450a89a756d123f7430e866a21b5d3e706cd.tar.gz
connman-cf2d450a89a756d123f7430e866a21b5d3e706cd.tar.bz2
connman-cf2d450a89a756d123f7430e866a21b5d3e706cd.zip
ofono: Do not connect autonomously activated contexts
When activated context is found, do not connect to it unless requested to do so.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ofono.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 3b76dcba..02c6d9eb 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -620,7 +620,8 @@ static int add_network(struct connman_device *device,
if (connman_device_add_network(device, network) != 0)
goto error;
- if (active)
+ /* Connect only if requested to do so */
+ if (active && connman_network_get_connecting(network) == TRUE)
set_connected(info, active);
return 0;
@@ -1735,7 +1736,13 @@ static gboolean context_changed(DBusConnection *connection,
dbus_message_iter_get_basic(&value, &active);
- set_connected(info, active);
+ if (active == FALSE)
+ set_connected(info, active);
+
+ /* Connect only if requested to do so */
+ if (active == TRUE &&
+ connman_network_get_connecting(info->network) == TRUE)
+ set_connected(info, active);
}
return TRUE;