iface-modem: ignore sim swap check if not implemented

Explicitly return TRUE to indicate success because otherwise the
caller will expect a valid GError set.
This commit is contained in:
Aleksander Morgado
2023-06-14 13:48:06 +00:00
parent a6a87e4a06
commit af89e63c35
+12 -11
View File
@@ -197,20 +197,21 @@ mm_iface_modem_check_for_sim_swap (MMIfaceModem *self,
}
}
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, "start checking for SIM swap in slot %u", slot_index);
MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap (
self,
iccid,
imsi,
(GAsyncReadyCallback)explicit_check_for_sim_swap_ready,
task);
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");
g_task_return_boolean (task, TRUE);
g_object_unref (task);
return;
}
g_task_return_boolean (task, FALSE);
g_object_unref (task);
mm_obj_info (self, "start checking for SIM swap in slot %u", slot_index);
MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap (
self,
iccid,
imsi,
(GAsyncReadyCallback)explicit_check_for_sim_swap_ready,
task);
}
/*****************************************************************************/