diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-04-09 08:24:00 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-04-10 08:24:52 +0000 |
commit | ff97a776315d9e61f793c7312edce1f7e833f04a (patch) | |
tree | 9449607518a5406d6c9b3b4f010a6e19f2292b88 | |
parent | 5313c25bd8ad4543f207da611551e42537ede208 (diff) |
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
-rw-r--r-- | src/mm-broadband-modem-mbim.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c index 3a55f058..8954889b 100644 --- a/src/mm-broadband-modem-mbim.c +++ b/src/mm-broadband-modem-mbim.c @@ -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 |