diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-02-08 15:32:04 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-02-08 15:32:04 -0600 |
commit | d11505f7510c31746c9bf642dbbf548991a6a40f (patch) | |
tree | 4747d4c504b02ac49c46a61e9eec76bef671404b | |
parent | c98b951fe627e39c4c3ec699e4453d7803e51e11 (diff) | |
download | ofono-d11505f7510c31746c9bf642dbbf548991a6a40f.tar.bz2 |
Fix: Add recheck flag to gprs
When a powered is toggled quickly, we ignore the second request. This
flag tells us that we should recheck what the attach status should be
once the current operation finishes
-rw-r--r-- | src/gprs.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -44,6 +44,7 @@ #define DATA_CONTEXT_INTERFACE "org.ofono.PrimaryDataContext" #define GPRS_FLAG_ATTACHING 0x1 +#define GPRS_FLAG_RECHECK 0x2 #define SETTINGS_STORE "gprs" #define SETTINGS_GROUP "Settings" @@ -976,6 +977,11 @@ static void registration_status_cb(const struct ofono_error *error, ofono_gprs_status_notify(gprs, status, lac, ci, tech); gprs->flags &= ~GPRS_FLAG_ATTACHING; + + if (gprs->flags & GPRS_FLAG_RECHECK) { + gprs->flags &= ~GPRS_FLAG_RECHECK; + gprs_netreg_update(gprs); + } } static void gprs_attach_callback(const struct ofono_error *error, void *data) @@ -994,6 +1000,11 @@ static void gprs_attach_callback(const struct ofono_error *error, void *data) } gprs->flags &= ~GPRS_FLAG_ATTACHING; + + if (gprs->flags & GPRS_FLAG_RECHECK) { + gprs->flags &= ~GPRS_FLAG_RECHECK; + gprs_netreg_update(gprs); + } } static void gprs_netreg_update(struct ofono_gprs *gprs) @@ -1010,8 +1021,10 @@ static void gprs_netreg_update(struct ofono_gprs *gprs) if (gprs->driver_attached == attach) return; - if (gprs->flags & GPRS_FLAG_ATTACHING) + if (gprs->flags & GPRS_FLAG_ATTACHING) { + gprs->flags |= GPRS_FLAG_RECHECK; return; + } gprs->flags |= GPRS_FLAG_ATTACHING; |