diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2016-01-30 16:25:20 -0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2016-01-30 16:29:29 -0800 |
commit | 8c905383b7f8f59e7b78c054ace828096a7fe6ba (patch) | |
tree | 72408a68ec45a4d729dba21a1df950f6b914c1b0 | |
parent | 3911ea5a0f6b26e12a3586c75d72bb2c5820e3c1 (diff) | |
download | ModemManager-8c905383b7f8f59e7b78c054ace828096a7fe6ba.tar.gz |
broadband-modem-qmi: locked states also indicate readiness of the SIM card
When the card application is flagged as needing PIN or PUK, then the card can be
considered as being ready.
-rw-r--r-- | src/mm-broadband-modem-qmi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index 999ead1c1..3946745a1 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -1622,8 +1622,13 @@ uim_get_card_status_ready (QmiClientUim *client, card = &g_array_index (cards, QmiMessageUimGetCardStatusOutputCardStatusCardsElement, card_i); app = &g_array_index (card->applications, QmiMessageUimGetCardStatusOutputCardStatusCardsElementApplicationsElement, application_j); - /* If card not ready yet, return RETRY error */ - if (app->state != QMI_UIM_CARD_APPLICATION_STATE_READY) { + /* If card not ready yet, return RETRY error. + * If the application state reports needing PIN/PUk, consider that ready as + * well, and let the logic fall down to check PIN1/PIN2. */ + if (app->state != QMI_UIM_CARD_APPLICATION_STATE_READY && + app->state != QMI_UIM_CARD_APPLICATION_STATE_PIN1_OR_UPIN_PIN_REQUIRED && + app->state != QMI_UIM_CARD_APPLICATION_STATE_PUK1_OR_UPIN_PUK_REQUIRED && + app->state != QMI_UIM_CARD_APPLICATION_STATE_PIN1_BLOCKED) { g_debug ("Neither SIM nor USIM are ready"); g_simple_async_result_set_error (ctx->result, MM_CORE_ERROR, |