aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-04-18 15:15:38 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-04-18 18:47:25 +0200
commit4f3932cb2b07a0c4b60a754afcdacf935a1a9b61 (patch)
tree875d85d417139a5dbc92fb359228339ba389aae1
parent27e19362778312e958a7caf68091cf8e46077d5b (diff)
iface-modem: ignore SIM errors in 3GPP2-capable devices
We already fully skipped SIM unlock check in 3GPP2-only devices; now we also ignore SIM errors if the device is a 3GPP+3GPP2 device.
-rw-r--r--src/mm-iface-modem.c65
1 files changed, 38 insertions, 27 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index cc12ef34..1fb5daf3 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -2598,40 +2598,51 @@ load_unlock_required_ready (MMIfaceModem *self,
if (error->domain == MM_SERIAL_ERROR ||
g_error_matches (error,
MM_CORE_ERROR,
- MM_CORE_ERROR_CANCELLED) ||
- g_error_matches (error,
- MM_MOBILE_EQUIPMENT_ERROR,
- MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED) ||
- g_error_matches (error,
- MM_MOBILE_EQUIPMENT_ERROR,
- MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE) ||
- g_error_matches (error,
- MM_MOBILE_EQUIPMENT_ERROR,
- MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG)) {
+ MM_CORE_ERROR_CANCELLED)) {
ctx->saved_error = error;
ctx->step = UPDATE_LOCK_INFO_CONTEXT_STEP_LAST;
update_lock_info_context_step (ctx);
return;
- }
+ } else if (g_error_matches (error,
+ MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED) ||
+ g_error_matches (error,
+ MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE) ||
+ g_error_matches (error,
+ MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG)) {
+ if (mm_iface_modem_is_cdma (self)) {
+ /* For mixed 3GPP+3GPP2 devices, skip SIM errors */
+ mm_dbg ("Skipping SIM error in 3GPP2-capable device, assuming no lock is needed");
+ g_error_free (error);
+ ctx->lock = MM_MODEM_LOCK_NONE;
+ } else {
+ /* SIM errors are only critical in 3GPP-only devices */
+ ctx->saved_error = error;
+ ctx->step = UPDATE_LOCK_INFO_CONTEXT_STEP_LAST;
+ update_lock_info_context_step (ctx);
+ return;
+ }
+ } else {
+ mm_dbg ("Couldn't check if unlock required: '%s'", error->message);
+ g_error_free (error);
- mm_dbg ("Couldn't check if unlock required: '%s'", error->message);
- g_error_free (error);
+ /* Retry up to 6 times */
+ if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE &&
+ ++ctx->pin_check_tries < 6) {
+ mm_dbg ("Retrying (%u) unlock required check", ctx->pin_check_tries);
+ if (ctx->pin_check_timeout_id)
+ g_source_remove (ctx->pin_check_timeout_id);
+ ctx->pin_check_timeout_id = g_timeout_add_seconds (2,
+ (GSourceFunc)load_unlock_required_again,
+ ctx);
+ return;
+ }
- /* Retry up to 6 times */
- if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE &&
- ++ctx->pin_check_tries < 6) {
- mm_dbg ("Retrying (%u) unlock required check", ctx->pin_check_tries);
- if (ctx->pin_check_timeout_id)
- g_source_remove (ctx->pin_check_timeout_id);
- ctx->pin_check_timeout_id = g_timeout_add_seconds (
- 2,
- (GSourceFunc)load_unlock_required_again,
- ctx);
- return;
+ /* If reached max retries and still reporting error, set UNKNOWN */
+ ctx->lock = MM_MODEM_LOCK_UNKNOWN;
}
-
- /* If reached max retries and still reporting error, set UNKNOWN */
- ctx->lock = MM_MODEM_LOCK_UNKNOWN;
}
/* Go on to next step */