mirror of git://git.sysmocom.de/ofono
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.
This commit is contained in:
parent
2ac70c7f27
commit
58c8a33adf
21
src/gprs.c
21
src/gprs.c
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue