diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2023-06-14 13:50:30 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2023-06-14 13:54:32 +0000 |
commit | 4db5635f4414547909c585f1802a1105dd07dacc (patch) | |
tree | e5d7bc089d99f33f8c67548b63698d768120749e | |
parent | af89e63c35f38f1fc920614e132c14203ccc9f24 (diff) |
iface-modem: sim swap check always refers to the active SIM
Since 503e886c02 the events on inactive SIMs don't trigger a full
modem reprobe, and the slot index check is fully unused.
-rw-r--r-- | src/mm-iface-modem.c | 34 | ||||
-rw-r--r-- | src/mm-iface-modem.h | 1 | ||||
-rw-r--r-- | src/mm-shared-qmi.c | 4 |
3 files changed, 3 insertions, 36 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index b3d46ee0..ed326adb 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -157,7 +157,6 @@ explicit_check_for_sim_swap_ready (MMIfaceModem *self, void mm_iface_modem_check_for_sim_swap (MMIfaceModem *self, - guint slot_index, const gchar *iccid, const gchar *imsi, GAsyncReadyCallback callback, @@ -167,36 +166,6 @@ mm_iface_modem_check_for_sim_swap (MMIfaceModem *self, task = g_task_new (self, NULL, callback, user_data); - /* Slot index 0 is used when slot is not known, assumingly on a modem with just one SIM slot */ - if (slot_index != 0) { - MmGdbusModem *skeleton; - guint primary_slot; - - g_object_get (self, - MM_IFACE_MODEM_DBUS_SKELETON, &skeleton, - NULL); - - if (!skeleton) { - g_task_return_new_error (task, - MM_CORE_ERROR, - MM_CORE_ERROR_FAILED, - "Couldn't get interface skeleton"); - g_object_unref (task); - return; - } - - primary_slot = mm_gdbus_modem_get_primary_sim_slot (MM_GDBUS_MODEM (skeleton)); - g_object_unref (skeleton); - - /* Check that it's really the primary slot whose iccid or imsi has changed */ - if (primary_slot && primary_slot != slot_index) { - mm_obj_info (self, "checking for SIM swap ignored: status changed in slot %u, but primary is %u", slot_index, primary_slot); - g_task_return_boolean (task, TRUE); - g_object_unref (task); - return; - } - } - if (!MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap || !MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap_finish) { mm_obj_info (self, "checking for SIM swap ignored: not implemented"); @@ -205,7 +174,7 @@ mm_iface_modem_check_for_sim_swap (MMIfaceModem *self, return; } - mm_obj_info (self, "start checking for SIM swap in slot %u", slot_index); + mm_obj_info (self, "started checking for SIM swap..."); MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap ( self, iccid, @@ -4641,7 +4610,6 @@ interface_syncing_step (GTask *task) */ mm_iface_modem_check_for_sim_swap ( self, - 0, NULL, NULL, (GAsyncReadyCallback)sync_detect_sim_swap_ready, diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h index 11b2a03c..f6e81f22 100644 --- a/src/mm-iface-modem.h +++ b/src/mm-iface-modem.h @@ -599,7 +599,6 @@ void mm_iface_modem_bind_simple_status (MMIfaceModem *self, /* Check if the SIM or eSIM profile has changed */ void mm_iface_modem_check_for_sim_swap (MMIfaceModem *self, - guint slot_index, const gchar *iccid, const gchar *imsi, GAsyncReadyCallback callback, diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c index 31e372ad..8b5fcee5 100644 --- a/src/mm-shared-qmi.c +++ b/src/mm-shared-qmi.c @@ -3649,7 +3649,7 @@ uim_start_refresh_timeout (MMSharedQmi *self) mm_obj_dbg (self, "refresh start timed out; trigger SIM change check"); - mm_iface_modem_check_for_sim_swap (MM_IFACE_MODEM (self), 0, NULL, NULL, NULL, NULL); + mm_iface_modem_check_for_sim_swap (MM_IFACE_MODEM (self), NULL, NULL, NULL, NULL); return G_SOURCE_REMOVE; } @@ -3715,7 +3715,7 @@ uim_refresh_indication_cb (QmiClientUim *client, g_source_remove (priv->uim_refresh_start_timeout_id); priv->uim_refresh_start_timeout_id = 0; } - mm_iface_modem_check_for_sim_swap (MM_IFACE_MODEM (self), 0, NULL, NULL, NULL, NULL); + mm_iface_modem_check_for_sim_swap (MM_IFACE_MODEM (self), NULL, NULL, NULL, NULL); } } } |