diff options
author | Dan Williams <dcbw@redhat.com> | 2013-02-06 16:18:51 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-02-06 16:18:51 -0600 |
commit | a4ad95e3dae0b3cbbb612cb0febcfb3132ebe333 (patch) | |
tree | b27341eb5a27ec06acf769393b8570f4d5bfe4bf | |
parent | 18436a8f77306bf3d5379881bcbd066018014858 (diff) |
broadband-modem-longcheer: fix handling of preferred modes
Treat NONE the same as ANY and handle specific preferred modes too.
-rw-r--r-- | plugins/longcheer/mm-broadband-modem-longcheer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/longcheer/mm-broadband-modem-longcheer.c b/plugins/longcheer/mm-broadband-modem-longcheer.c index 9734eb8f..ac05505c 100644 --- a/plugins/longcheer/mm-broadband-modem-longcheer.c +++ b/plugins/longcheer/mm-broadband-modem-longcheer.c @@ -152,10 +152,14 @@ set_allowed_modes (MMIfaceModem *self, mododr = 3; else if (allowed == MM_MODEM_MODE_3G) mododr = 1; - else if (allowed == MM_MODEM_MODE_ANY && - preferred == MM_MODEM_MODE_NONE) - /* Not sure about this, it may be '3G preferred' */ - mododr = 2; + else if (allowed == MM_MODEM_MODE_ANY || (allowed == (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G))) { + if (preferred == MM_MODEM_MODE_2G) + mododr = 4; + else if (preferred == MM_MODEM_MODE_3G || + preferred == MM_MODEM_MODE_NONE || + preferred == MM_MODEM_MODE_ANY) + mododr = 2; + } if (mododr == 0) { gchar *allowed_str; |