From febab17f07f54f8ababed9b5e187e189ccd15841 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 1 May 2025 15:09:46 -0500 Subject: broadband-modem: reload registration info after manual registration This refreshes operator information after manual registration. QMI and MBIM implementations return operator info along with registration info so they handle this easily, while with AT-based devices we must run additional commands to retrieve that after the manual registration has finished. Suggested by: Kirill Buksha Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/971 Signed-off-by: Dan Williams --- src/mm-broadband-modem.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 70562774..31012d26 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -5587,6 +5587,21 @@ modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self, return g_task_propagate_boolean (G_TASK (res), error); } +static void +run_registration_checks_reload_current_registration_info_ready (MMIfaceModem3gpp *modem, + GAsyncResult *res, + GTask *task) +{ + GError *error = NULL; + + mm_iface_modem_3gpp_reload_current_registration_info_finish (modem, res, &error); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, TRUE); + g_object_unref (task); +} + static void run_registration_checks_context_step (GTask *task); static void @@ -5828,13 +5843,17 @@ run_registration_checks_context_step (GTask *task) error = g_steal_pointer (&ctx->error_cs); else g_assert_not_reached (); - } - if (error) g_task_return_error (task, error); - else - g_task_return_boolean (task, TRUE); - g_object_unref (task); + g_object_unref (task); + return; + } + + /* When everything is done, recheck operator info as it may have changed */ + mm_iface_modem_3gpp_reload_current_registration_info ( + MM_IFACE_MODEM_3GPP (self), + (GAsyncReadyCallback)run_registration_checks_reload_current_registration_info_ready, + task); } static void -- cgit v1.2.3-70-g09d2