From 92035fdf1c39c9e1bf8b7d419d913e85bc8e1a44 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Apr 2013 12:19:46 -0500 Subject: iface-modem: skip modem_after_sim_unlock() for CDMA-only devices We don't support SIM/RUIM on CDMA devices (yet), so for now it makes no sense to run the after-sim-unlock step on CDMA-only devices where a SIM won't be present. Unfortunately we don't know at this point whether there is a SIM or not, so if the modem is a multi-mode device (implying it has a SIM slot) and its plugin implements the modem_after_sim_unlock() hook, the hook will still be executed and might cause an unecessary delay when a SIM is not inserted. --- src/mm-iface-modem.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 66ecdf9a..703de027 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -2705,10 +2705,12 @@ update_lock_info_context_step (UpdateLockInfoContext *ctx) case UPDATE_LOCK_INFO_CONTEXT_STEP_AFTER_UNLOCK: /* If we get that no lock is required, run the after SIM unlock step - * in order to wait for the SIM to get ready */ - if (ctx->lock == MM_MODEM_LOCK_NONE || - ctx->lock == MM_MODEM_LOCK_SIM_PIN2 || - ctx->lock == MM_MODEM_LOCK_SIM_PUK2) { + * in order to wait for the SIM to get ready. Skip waiting on + * CDMA-only modems where we don't support a SIM. */ + if (!mm_iface_modem_is_cdma_only (ctx->self) && + (ctx->lock == MM_MODEM_LOCK_NONE || + ctx->lock == MM_MODEM_LOCK_SIM_PIN2 || + ctx->lock == MM_MODEM_LOCK_SIM_PUK2)) { if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_after_sim_unlock != NULL && MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_after_sim_unlock_finish != NULL) { mm_dbg ("SIM is ready, running after SIM unlock step..."); -- cgit v1.2.3-70-g09d2