aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-08-02 23:03:50 +0200
committerAleksander Morgado <aleksandermj@google.com>2022-08-04 13:08:55 +0000
commit3893396e200a6bfae508f2a837313ebe3bddd801 (patch)
treedfd8be07814b9d3a1905b1d8efb9828473111aa8
parent86f6d3351351f7143a7f1c5fb90ddb465089ac69 (diff)
broadband-modem: SIM swap check should consider errors loading as no SIM
A failure loading IMSI or ICCID (unless for the UNSUPPORTED case) could be an indication that there is no SIM. Ideally, the logic checking if a SIM swap happened should have checked first if there is a SIM card in the slot, and only if there is one go on to try to load IMSI or ICCID.
-rw-r--r--src/mm-broadband-modem.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index e6df8754..ae5e1ae9 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -4187,8 +4187,6 @@ complete_sim_swap_check (GTask *task,
const gchar *cached;
const gchar *str;
- g_assert (current);
-
self = MM_BROADBAND_MODEM (g_task_get_source_object (task));
ctx = g_task_get_task_data (task);
@@ -4205,7 +4203,7 @@ complete_sim_swap_check (GTask *task,
if (g_strcmp0 (current, cached) != 0) {
mm_obj_info (self, "SIM %s has changed: %s -> %s",
- str, cached ? cached : "<none>", current);
+ str, cached ? cached : "<none>", current ? current : "<none>");
mm_iface_modem_process_sim_event (MM_IFACE_MODEM (self));
ctx->step = SIM_SWAP_CHECK_STEP_LAST;
} else {
@@ -4263,8 +4261,7 @@ load_sim_step_ready (MMBaseSim *sim,
}
mm_obj_warn (self, "could not load SIM %s: %s", str, error->message);
- ctx->step++;
- sim_swap_check_step (task);
+ complete_sim_swap_check (task, NULL);
return;
}