broadband-modem-mbim: request operator reload explicitly

If the modem switches from one roaming operator to a different roaming
operator, the actual operator MCCMNC/description will change even if
the registration state keeps on being the same (roaming). Detect that,
and trigger operator info reloading explicitly.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/154
This commit is contained in:
Aleksander Morgado
2020-04-10 08:24:52 +00:00
parent 5313c25bd8
commit ff97a77631
+10
View File
@@ -2960,6 +2960,7 @@ update_registration_info (MMBroadbandModemMbim *self,
gchar *operator_name_take)
{
MMModem3gppRegistrationState reg_state;
gboolean operator_updated = FALSE;
reg_state = mm_modem_3gpp_registration_state_from_mbim_register_state (state);
@@ -2969,6 +2970,7 @@ update_registration_info (MMBroadbandModemMbim *self,
g_str_equal (self->priv->current_operator_id, operator_id_take)) {
g_free (operator_id_take);
} else {
operator_updated = TRUE;
g_free (self->priv->current_operator_id);
self->priv->current_operator_id = operator_id_take;
}
@@ -2977,10 +2979,13 @@ update_registration_info (MMBroadbandModemMbim *self,
g_str_equal (self->priv->current_operator_name, operator_name_take)) {
g_free (operator_name_take);
} else {
operator_updated = TRUE;
g_free (self->priv->current_operator_name);
self->priv->current_operator_name = operator_name_take;
}
} else {
if (self->priv->current_operator_id || self->priv->current_operator_name)
operator_updated = TRUE;
g_clear_pointer (&self->priv->current_operator_id, g_free);
g_clear_pointer (&self->priv->current_operator_name, g_free);
g_free (operator_id_take);
@@ -2993,6 +2998,11 @@ update_registration_info (MMBroadbandModemMbim *self,
self->priv->available_data_classes = available_data_classes;
update_access_technologies (self);
/* request to reload operator info explicitly, so that the new
* operator name and code is propagated to the DBus interface */
if (operator_updated)
mm_iface_modem_3gpp_reload_current_registration_info (MM_IFACE_MODEM_3GPP (self), NULL, NULL);
}
static void