aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-10-29 22:46:52 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-10-29 22:52:06 +0100
commit9c1843c38153ff022491d1a5a663d527f4d8ebc2 (patch)
tree4d390af6411272e42feeeb01d6ced4446fb62feb /src
parenta31d762250edba7bbad34adec051d9cff0279f66 (diff)
shared-qmi: ignore NoEffect errors on slot switching
When "UIM Switch Slot" returns a NoEffect error it's because we're already in the desired slot, so just treat it as a successful operation.
Diffstat (limited to 'src')
-rw-r--r--src/mm-shared-qmi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
index b0b061b2..d3ff0c22 100644
--- a/src/mm-shared-qmi.c
+++ b/src/mm-shared-qmi.c
@@ -3321,10 +3321,14 @@ next_sim_switch_ready (QmiClientUim *client,
output = qmi_client_uim_switch_slot_finish (client, res, &error);
if (!output || !qmi_message_uim_switch_slot_output_get_result (output, &error)) {
- mm_obj_dbg (self, "couldn't switch to SIM at slot %u: won't load additional info",
- ctx->current_slot_number);
- load_next_sim_info (task);
- return;
+ /* ignore NoEffect errors on slot switch, because that indicates we're
+ * already in the desired slot */
+ if (!g_error_matches (error, QMI_PROTOCOL_ERROR, QMI_PROTOCOL_ERROR_NO_EFFECT)) {
+ mm_obj_dbg (self, "couldn't switch to SIM at slot %u: won't load additional info",
+ ctx->current_slot_number);
+ load_next_sim_info (task);
+ return;
+ }
}
mm_obj_dbg (self, "switched to SIM at slot %u: initializing...",