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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user