aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2011-07-25 00:05:06 -0500
committerDan Williams <dcbw@redhat.com>2011-07-25 00:12:13 -0500
commit0cc813312f9bf446614d6aed6a85b1ee0b006451 (patch)
treee547c683a2b330501813a26b1fe8cf79cab66ae4 /src
parent4267a15b4b318644531489fab91534acf7954d13 (diff)
gsm: don't clear operator name or number when at least one of PS or CS is registered
The operator name/number isn't really tied to CS or PS registration, since we retrieve it using AT+COPS. But when one of CS or PS became unregistered the operator name and number would get cleared out. We only want to clear it out when *both* CS and PS are unregistered. Fixes an issue with the location API where location would not be reported when one of CS or PS became unregistered, because the location bits want an operator name before they return the location.
Diffstat (limited to 'src')
-rw-r--r--src/mm-generic-gsm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c
index 541c2dda..dc2d4ddc 100644
--- a/src/mm-generic-gsm.c
+++ b/src/mm-generic-gsm.c
@@ -2442,6 +2442,19 @@ reg_info_updated (MMGenericGsm *self,
changed = TRUE;
}
+ /* Don't clear oper code or oper num if at least one of CS or PS state
+ * is home or roaming.
+ */
+ if ( priv->reg_status[0] == MM_MODEM_GSM_NETWORK_REG_STATUS_HOME
+ || priv->reg_status[0] == MM_MODEM_GSM_NETWORK_REG_STATUS_ROAMING
+ || priv->reg_status[1] == MM_MODEM_GSM_NETWORK_REG_STATUS_HOME
+ || priv->reg_status[1] == MM_MODEM_GSM_NETWORK_REG_STATUS_ROAMING) {
+ if (update_code && oper_code == NULL)
+ update_code = FALSE;
+ if (update_name && oper_name == NULL)
+ update_name = FALSE;
+ }
+
if (update_code) {
if (g_strcmp0 (oper_code, priv->oper_code) != 0) {
g_free (priv->oper_code);