aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-voice.c
diff options
context:
space:
mode:
authorDylan Van Assche <me@dylanvanassche.be>2021-08-15 16:53:18 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-09-08 10:02:51 +0200
commit15d66197b369384c72675b71ce83758289a87dc4 (patch)
treea69cb18ffa7dc7dacd9fb5370512b73b1cba0f95 /src/mm-iface-modem-voice.c
parent92ad38432c2a14d1ac310b58fde7d9336a45aff9 (diff)
mm-broadband-modem-qmi: add AT URCs fall back for calls
Enable AT URCs for calls on top of QMI Voice indications for AT+QMI devices only. Some AT+QMI devices send unreliable QMI indications when the host is resuming. In such cases, AT URCs can be used as a fall back to make calls reliable. While AT+QMI devices relied before on AT commands to load call list information and handle AT URCs for async updates, this is now handled through QMI by forcefully reloading the call list instead of processing the AT URCs. This approach is disabled by default through the MM_IFACE_MODEM_VOICE_INDICATION_CALL_LIST_RELOAD_ENABLED property. This property is set to true in case of QMI modems.
Diffstat (limited to 'src/mm-iface-modem-voice.c')
-rw-r--r--src/mm-iface-modem-voice.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c
index 03aaeb0a..3b918259 100644
--- a/src/mm-iface-modem-voice.c
+++ b/src/mm-iface-modem-voice.c
@@ -2503,6 +2503,54 @@ setup_call_list_polling (MMCallList *call_list,
}
/*****************************************************************************/
+/* Call list reload */
+
+gboolean
+mm_iface_modem_voice_reload_all_calls_finish (MMIfaceModemVoice *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return g_task_propagate_boolean (G_TASK (res), error);
+}
+
+static void
+reload_all_calls_ready (MMIfaceModemVoice *self,
+ GAsyncResult *res,
+ GTask *task)
+{
+ GList *call_info_list = NULL;
+ GError *error = NULL;
+
+ g_assert (MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->load_call_list_finish);
+ if (!MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->load_call_list_finish (self, res, &call_info_list, &error)) {
+ mm_obj_warn (self, "couldn't reload call list: %s", error->message);
+
+ g_task_return_error (task, error);
+ } else {
+ /* Always report the list even if NULL (it would mean no ongoing calls) */
+ mm_iface_modem_voice_report_all_calls (self, call_info_list);
+ mm_3gpp_call_info_list_free (call_info_list);
+
+ g_task_return_boolean (task, TRUE);
+ }
+
+ g_object_unref (task);
+}
+
+void
+mm_iface_modem_voice_reload_all_calls (MMIfaceModemVoice *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GTask *task;
+
+ task = g_task_new (self, NULL, callback, user_data);
+ MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->load_call_list (self,
+ reload_all_calls_ready,
+ task);
+}
+
+/*****************************************************************************/
static void
update_call_list (MmGdbusModemVoice *skeleton,
@@ -3134,6 +3182,14 @@ iface_modem_voice_init (gpointer g_iface)
FALSE,
G_PARAM_READWRITE));
+ g_object_interface_install_property
+ (g_iface,
+ g_param_spec_boolean (MM_IFACE_MODEM_VOICE_INDICATION_CALL_LIST_RELOAD_ENABLED,
+ "Reload call list on call update",
+ "Ignore call updates and forcefully reload all calls.",
+ FALSE,
+ G_PARAM_READWRITE));
+
initialized = TRUE;
}