broadband-modem-qmi: treat as fatal internal protocol errors when checking PIN status
This commit is contained in:
@@ -690,8 +690,21 @@ 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)) {
|
||||
g_prefix_error (&error, "Couldn't get PIN status: ");
|
||||
g_simple_async_result_take_error (simple, error);
|
||||
/* When no SIM inserted, an internal error when checking PIN status
|
||||
* needs to be fatal so that we mark the modem unusable. */
|
||||
if (g_error_matches (error,
|
||||
QMI_PROTOCOL_ERROR,
|
||||
QMI_PROTOCOL_ERROR_INTERNAL)) {
|
||||
g_simple_async_result_set_error (simple,
|
||||
MM_MOBILE_EQUIPMENT_ERROR,
|
||||
MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE,
|
||||
"Couldn't get PIN status: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
} else {
|
||||
g_prefix_error (&error, "Couldn't get PIN status: ");
|
||||
g_simple_async_result_take_error (simple, error);
|
||||
}
|
||||
} else {
|
||||
MMModemLock lock = MM_MODEM_LOCK_UNKNOWN;
|
||||
QmiDmsUimPinStatus current_status;
|
||||
|
||||
Reference in New Issue
Block a user