From bc72cca91b070f61c0cecb0090937eb758e91b24 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 26 Oct 2009 16:55:03 -0500 Subject: Fix: notify_attached was only used when detached The standard only specifies that the context might have been detached by the network / mobile equipment. Not attached. --- src/gprs.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gprs.c b/src/gprs.c index 8443f1bf..3aa4721e 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -894,14 +894,18 @@ static GDBusSignalTable manager_signals[] = { { } }; -void ofono_gprs_attach_notify(struct ofono_gprs *gprs, int attached) +void ofono_gprs_detached_notify(struct ofono_gprs *gprs) { - if (gprs->driver_attached != attached && - !(gprs->flags & GPRS_FLAG_ATTACHING)) { - gprs->driver_attached = attached; + if (gprs->driver_attached == FALSE) + return; - gprs_netreg_update(gprs); - } + gprs->driver_attached = FALSE; + + gprs_attached_update(gprs); + + /* TODO: The network forced a detach, we should wait for some time + * and try to re-attach + */ } static void set_registration_status(struct ofono_gprs *gprs, int status) -- cgit v1.2.3