From af5c242e9234a7061ec0d6624e3712153c7c2c6b Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 11 Sep 2020 10:21:03 +0200 Subject: [PATCH] iface-modem: don't reconfigure sim hot swap context on SIM PIN unlock If we had already successfully run the sim hot swap context setup during the initial initialization, make sure we don't re-run on SIM PIN unlock, because we may be re-creating signal handlers and such. --- src/mm-iface-modem.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index c7d92557..d35108ab 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -5334,8 +5334,14 @@ interface_initialization_step (GTask *task) ctx->step++; /* fall-through */ - case INITIALIZATION_STEP_SIM_HOT_SWAP: - if (MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap && + case INITIALIZATION_STEP_SIM_HOT_SWAP: { + gboolean sim_hot_swap_configured = FALSE; + + g_object_get (self, + MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, &sim_hot_swap_configured, + NULL); + if (!sim_hot_swap_configured && + MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap && MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap_finish) { MM_IFACE_MODEM_GET_INTERFACE (self)->setup_sim_hot_swap ( MM_IFACE_MODEM (self), @@ -5344,7 +5350,7 @@ interface_initialization_step (GTask *task) return; } ctx->step++; - /* fall-through */ + } /* fall-through */ case INITIALIZATION_STEP_SIM_SLOTS: /* If the modem doesn't need any SIM (not implemented by plugin, or not