broadband-modem-qmi: make 'internal' errors on pin check retriable

When we get an internal error while checking the lock status, tell the upper
layers that we can retry the check. It's been observed that this internal error
may be issued not only when e.g. there is no SIM, but also when the SIM is not
yet fully ready.
This commit is contained in:
Aleksander Morgado
2013-09-19 09:33:08 -05:00
committed by Dan Williams
parent 13c7319bff
commit 6b4602a335
+17 -7
View File
@@ -1442,21 +1442,31 @@ dms_uim_get_pin_status_ready (QmiClientDms *client,
g_prefix_error (&error, "QMI operation failed: ");
g_simple_async_result_take_error (simple, error);
} else if (!qmi_message_dms_uim_get_pin_status_output_get_result (output, &error)) {
/* When no SIM inserted, an internal error when checking PIN status
* needs to be fatal so that we mark the modem unusable. */
/* Fatal, so that we mark the modem unusable.*/
if (g_error_matches (error,
QMI_PROTOCOL_ERROR,
QMI_PROTOCOL_ERROR_INTERNAL) ||
g_error_matches (error,
QMI_PROTOCOL_ERROR,
QMI_PROTOCOL_ERROR_UIM_UNINITIALIZED)) {
/* This error won't force a pin check retry */
g_simple_async_result_set_error (simple,
MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE,
"Couldn't get PIN status: %s",
"SIM failure: %s",
error->message);
g_error_free (error);
} else {
}
/* Internal errors are retry-able before being fatal */
else if (g_error_matches (error,
QMI_PROTOCOL_ERROR,
QMI_PROTOCOL_ERROR_INTERNAL)) {
g_simple_async_result_set_error (simple,
MM_CORE_ERROR,
MM_CORE_ERROR_RETRY,
"Couldn't get PIN status (retry): %s",
error->message);
g_error_free (error);
}
/* Other errors, just propagate them */
else {
g_prefix_error (&error, "Couldn't get PIN status: ");
g_simple_async_result_take_error (simple, error);
}