Ignore gprs status when not attached/attaching
authorDenis Kenzior <denkenz@gmail.com>
Mon, 26 Oct 2009 21:57:21 +0000 (16:57 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Mon, 26 Oct 2009 21:57:21 +0000 (16:57 -0500)
src/gprs.c

index f08c1d0..c321aac 100644 (file)
@@ -985,6 +985,11 @@ static void set_registration_technology(struct ofono_gprs *gprs,
 void ofono_gprs_status_notify(struct ofono_gprs *gprs,
                                int status, int lac, int ci, int tech)
 {
+       /* If we are not attached and haven't tried to attach, ignore */
+       if (gprs->driver_attached == FALSE &&
+                       (gprs->flags & GPRS_FLAG_ATTACHING) == 0)
+               return;
+
        if (gprs->status != status)
                set_registration_status(gprs, status);