From 71048173767883f6c9d4468f98378c654419f780 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 7 May 2012 15:22:59 +0200 Subject: [PATCH] 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 --- plugins/ofono.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/ofono.c b/plugins/ofono.c index ac874ea..0dfadb8 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; -- 2.7.4