broadband-modem: improve logging during SIM swap check

Log the contents loaded during the operation and treat them as
personal info so that they are hidden if needed.
This commit is contained in:
Aleksander Morgado
2022-08-12 14:02:08 +00:00
parent 20390488dd
commit c7fcc2dc2f

View File

@@ -4200,12 +4200,15 @@ complete_sim_swap_check (GTask *task,
g_assert_not_reached(); g_assert_not_reached();
if (g_strcmp0 (current, cached) != 0) { if (g_strcmp0 (current, cached) != 0) {
mm_obj_msg (self, "SIM %s has changed: %s -> %s", mm_obj_msg (self, "SIM %s has changed: '%s' -> '%s'",
str, cached ? cached : "<none>", current ? current : "<none>"); str,
mm_log_str_personal_info (cached ? cached : ""),
mm_log_str_personal_info (current ? current : ""));
mm_iface_modem_process_sim_event (MM_IFACE_MODEM (self)); mm_iface_modem_process_sim_event (MM_IFACE_MODEM (self));
ctx->step = SIM_SWAP_CHECK_STEP_LAST; ctx->step = SIM_SWAP_CHECK_STEP_LAST;
} else { } else {
mm_obj_dbg (self, "SIM %s has not changed", str); mm_obj_info (self, "SIM %s has not changed: %s",
str, mm_log_str_personal_info (current));
ctx->step++; ctx->step++;
} }
@@ -4354,7 +4357,7 @@ modem_check_for_sim_swap (MMIfaceModem *self,
GTask *task; GTask *task;
SimSwapContext *ctx; SimSwapContext *ctx;
mm_obj_dbg (self, "checking if SIM was swapped..."); mm_obj_info (self, "checking if SIM was swapped...");
task = g_task_new (self, NULL, callback, user_data); task = g_task_new (self, NULL, callback, user_data);
ctx = g_slice_new0 (SimSwapContext); ctx = g_slice_new0 (SimSwapContext);