summaryrefslogtreecommitdiff
path: root/plugins/ofono.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-05-07 15:22:59 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-08 12:19:13 +0300
commit71048173767883f6c9d4468f98378c654419f780 (patch)
tree12da0758d288c2c9b38e864ca5651c07400b3ccd /plugins/ofono.c
parent60344509b64f477df0449e5cf942aecf1067fee4 (diff)
downloadconnman-71048173767883f6c9d4468f98378c654419f780.tar.gz
connman-71048173767883f6c9d4468f98378c654419f780.tar.bz2
connman-71048173767883f6c9d4468f98378c654419f780.zip
ofono: Check for CM attached before registering network
We need to check the ConnectionManager attached signal before we are allowed to connect to the gprs context: connmand[592]: plugins/ofono.c:cm_update_attached() /zte_0 Attached 0 [...] connmand[592]: plugins/ofono.c:context_set_active() /zte_0 active 1 connmand[592]: plugins/ofono.c:set_property() /zte_0 path /zte_0/context1 org.ofono.ConnectionContext.Active [...] connmand[592]: plugins/ofono.c:cm_update_attached() /zte_0 Attached 1 Fixes BMC#25112
Diffstat (limited to 'plugins/ofono.c')
-rw-r--r--plugins/ofono.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index ac874eaa..0dfadb86 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1131,7 +1131,7 @@ static int add_cm_context(struct modem_data *modem, const char *context_path,
g_hash_table_replace(context_hash, g_strdup(context_path), modem);
- if (modem->valid_apn == TRUE &&
+ if (modem->valid_apn == TRUE && modem->attached == TRUE &&
has_interface(modem->interfaces,
OFONO_API_NETREG) == TRUE) {
add_network(modem);
@@ -1218,6 +1218,9 @@ static gboolean context_changed(DBusConnection *connection,
if (modem->network != NULL)
return TRUE;
+ if (modem->attached == FALSE)
+ return TRUE;
+
if (has_interface(modem->interfaces,
OFONO_API_NETREG) == FALSE) {
return TRUE;