iface-modem: treat serial errors also as fatal when checking unlock status
This commit is contained in:
@@ -2098,9 +2098,13 @@ unlock_check_ready (MMIfaceModem *self,
|
|||||||
res,
|
res,
|
||||||
&error);
|
&error);
|
||||||
if (error) {
|
if (error) {
|
||||||
/* Treat several SIM related errors as critical and abort the checks
|
/* Treat several SIM related, serial and other core errors as critical
|
||||||
* TODO: do this only after the retries? */
|
* and abort the checks. */
|
||||||
if (g_error_matches (error,
|
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,
|
||||||
MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED) ||
|
MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED) ||
|
||||||
g_error_matches (error,
|
g_error_matches (error,
|
||||||
@@ -2115,10 +2119,14 @@ unlock_check_ready (MMIfaceModem *self,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mm_dbg ("Couldn't check if unlock required: '%s'",
|
||||||
|
error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
|
||||||
/* Retry up to 3 times */
|
/* Retry up to 3 times */
|
||||||
if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE &&
|
if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE &&
|
||||||
++ctx->pin_check_tries < 3) {
|
++ctx->pin_check_tries < 3) {
|
||||||
|
mm_dbg ("Retrying (%u) unlock required check", ctx->pin_check_tries);
|
||||||
if (ctx->pin_check_timeout_id)
|
if (ctx->pin_check_timeout_id)
|
||||||
g_source_remove (ctx->pin_check_timeout_id);
|
g_source_remove (ctx->pin_check_timeout_id);
|
||||||
ctx->pin_check_timeout_id = g_timeout_add_seconds (
|
ctx->pin_check_timeout_id = g_timeout_add_seconds (
|
||||||
|
Reference in New Issue
Block a user