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.
This commit is contained in:
Dan Williams
2013-04-18 12:19:46 -05:00
parent 7d668eb407
commit 92035fdf1c

View File

@@ -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 ||
* 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) {
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...");