From bda3ade5a8805eb31391c2c855374094680f3187 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 29 Jul 2022 15:05:01 +0200 Subject: [PATCH] iface-modem: reordering of ready methods in sync() --- src/mm-iface-modem.c | 75 ++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 8a38a283..7e892d51 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -4502,42 +4502,6 @@ mm_iface_modem_sync_finish (MMIfaceModem *self, return g_task_propagate_boolean (G_TASK (res), error); } -static void -sync_sim_lock_ready (MMIfaceModem *self, - GAsyncResult *res, - GTask *task) -{ - SyncingContext *ctx; - g_autoptr (GError) error = NULL; - - ctx = g_task_get_task_data (task); - - if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_required_finish (self, res, &error)) - mm_obj_warn (self, "checking sim lock status failed: %s", error->message); - - /* Go on to next step */ - ctx->step++; - interface_syncing_step (task); -} - -static void -sync_detect_sim_swap_ready (MMIfaceModem *self, - GAsyncResult *res, - GTask *task) -{ - SyncingContext *ctx; - g_autoptr (GError) error = NULL; - - ctx = g_task_get_task_data (task); - - if (!mm_iface_modem_check_for_sim_swap_finish (self, res, &error)) - mm_obj_warn (self, "checking sim swap failed: %s", error->message); - - /* Go on to next step */ - ctx->step++; - interface_syncing_step (task); -} - static void sync_all_bearers_ready (MMBearerList *bearer_list, GAsyncResult *res, @@ -4572,8 +4536,9 @@ reload_bearers (GTask *task) MM_IFACE_MODEM_BEARER_LIST, &bearer_list, NULL); + /* If no bearer list (e.g. none created or modem disabled), + * go on to next step */ if (!bearer_list) { - /* Go on to next step */ ctx->step++; interface_syncing_step (task); return; @@ -4584,6 +4549,42 @@ reload_bearers (GTask *task) task); } +static void +sync_sim_lock_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + SyncingContext *ctx; + g_autoptr (GError) error = NULL; + + ctx = g_task_get_task_data (task); + + if (!MM_IFACE_MODEM_GET_INTERFACE (self)->load_unlock_required_finish (self, res, &error)) + mm_obj_warn (self, "checking sim lock status failed: %s", error->message); + + /* Go on to next step */ + ctx->step++; + interface_syncing_step (task); +} + +static void +sync_detect_sim_swap_ready (MMIfaceModem *self, + GAsyncResult *res, + GTask *task) +{ + SyncingContext *ctx; + g_autoptr (GError) error = NULL; + + ctx = g_task_get_task_data (task); + + if (!mm_iface_modem_check_for_sim_swap_finish (self, res, &error)) + mm_obj_warn (self, "checking sim swap failed: %s", error->message); + + /* Go on to next step */ + ctx->step++; + interface_syncing_step (task); +} + static void interface_syncing_step (GTask *task) {