diff options
author | Denis Kenzior <denkenz@gmail.com> | 2011-05-11 12:09:56 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-05-11 12:11:23 -0500 |
commit | 4714d8199aacf0ba6be777a70e01b3016ba2aa5f (patch) | |
tree | 1dd051cea73e656b954f88ea9d8f6927fda60cc7 /src/gprs.c | |
parent | 623183d99650530eedf45c28033420fed072f087 (diff) | |
download | ofono-4714d8199aacf0ba6be777a70e01b3016ba2aa5f.tar.bz2 |
gprs: Mark context inactive on removal
Diffstat (limited to 'src/gprs.c')
-rw-r--r-- | src/gprs.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -2133,12 +2133,38 @@ void ofono_gprs_set_cid_range(struct ofono_gprs *gprs, static void gprs_context_unregister(struct ofono_atom *atom) { struct ofono_gprs_context *gc = __ofono_atom_get_data(atom); + DBusConnection *conn = ofono_dbus_get_connection(); + GSList *l; + struct pri_context *ctx; + dbus_bool_t value; DBG("%p, %p", gc, gc->gprs); if (gc->gprs == NULL) goto done; + for (l = gc->gprs->contexts; l; l = l->next) { + ctx = l->data; + + if (ctx->context_driver != gc) + continue; + + if (ctx->pending != NULL) + __ofono_dbus_pending_reply(&ctx->pending, + __ofono_error_failed(ctx->pending)); + + if (ctx->active == FALSE) + break; + + pri_reset_context_settings(ctx); + release_context(ctx); + + value = FALSE; + ofono_dbus_signal_property_changed(conn, ctx->path, + OFONO_CONNECTION_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, &value); + } + gc->gprs->context_drivers = g_slist_remove(gc->gprs->context_drivers, gc); gc->gprs = NULL; |