diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-12-08 17:19:40 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-12-08 17:19:40 -0600 |
commit | 58c8a33adfac432867230aa6ff0cb6f9e2afa680 (patch) | |
tree | a9c10b8c32836492a6e35816fc868d9cd8c6d636 | |
parent | 2ac70c7f278814991374ed87549a6cc3136989ff (diff) | |
download | ofono-58c8a33adfac432867230aa6ff0cb6f9e2afa680.tar.bz2 |
Fix: Reset active contexts if gprs is detached
When we lose network registration or are forcefully detached from the
network we must reset all active contexts to inactive.
-rw-r--r-- | src/gprs.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -901,6 +901,27 @@ static void gprs_attached_update(struct ofono_gprs *gprs) gprs->attached = attached; + if (gprs->attached == FALSE) { + GSList *l; + struct pri_context *ctx; + + for (l = gprs->contexts; l; l = l->next) { + ctx = l->data; + + if (ctx->active == FALSE) + continue; + + ctx->active = FALSE; + pri_reset_context_settings(ctx); + + value = FALSE; + ofono_dbus_signal_property_changed(conn, ctx->path, + DATA_CONTEXT_INTERFACE, + "Active", DBUS_TYPE_BOOLEAN, + &value); + } + } + path = __ofono_atom_get_path(gprs->atom); value = attached; ofono_dbus_signal_property_changed(conn, path, |