aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-06-15 22:59:51 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-07-11 23:00:50 +0200
commitcd2e851b8cfe45cd20da48bd596a4d142c4c55c5 (patch)
tree83e11bed9ade73adcd232c30691fd762e65f0af8
parent3873fda83f130b7bc76059dea8ffd6e4e34d1669 (diff)
base-call: allow skipping the timeout in incoming calls
E.g. if the modem supports reporting incoming call updates explicitly.
-rw-r--r--src/mm-base-call.c19
-rw-r--r--src/mm-base-call.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mm-base-call.c b/src/mm-base-call.c
index cab4bdc0..a90002db 100644
--- a/src/mm-base-call.c
+++ b/src/mm-base-call.c
@@ -40,6 +40,7 @@ enum {
PROP_PATH,
PROP_CONNECTION,
PROP_MODEM,
+ PROP_SKIP_INCOMING_TIMEOUT,
PROP_SUPPORTS_DIALING_TO_RINGING,
PROP_SUPPORTS_RINGING_TO_ACTIVE,
PROP_LAST
@@ -55,6 +56,7 @@ struct _MMBaseCallPrivate {
/* The path where the call object is exported */
gchar *path;
/* Features */
+ gboolean skip_incoming_timeout;
gboolean supports_dialing_to_ringing;
gboolean supports_ringing_to_active;
@@ -164,6 +166,9 @@ incoming_timeout_cb (MMBaseCall *self)
void
mm_base_call_incoming_refresh (MMBaseCall *self)
{
+ if (self->priv->skip_incoming_timeout)
+ return;
+
if (self->priv->incoming_timeout)
g_source_remove (self->priv->incoming_timeout);
self->priv->incoming_timeout = g_timeout_add_seconds (INCOMING_TIMEOUT_SECS, (GSourceFunc)incoming_timeout_cb, self);
@@ -1162,6 +1167,9 @@ set_property (GObject *object,
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
}
break;
+ case PROP_SKIP_INCOMING_TIMEOUT:
+ self->priv->skip_incoming_timeout = g_value_get_boolean (value);
+ break;
case PROP_SUPPORTS_DIALING_TO_RINGING:
self->priv->supports_dialing_to_ringing = g_value_get_boolean (value);
break;
@@ -1192,6 +1200,9 @@ get_property (GObject *object,
case PROP_MODEM:
g_value_set_object (value, self->priv->modem);
break;
+ case PROP_SKIP_INCOMING_TIMEOUT:
+ g_value_set_boolean (value, self->priv->skip_incoming_timeout);
+ break;
case PROP_SUPPORTS_DIALING_TO_RINGING:
g_value_set_boolean (value, self->priv->supports_dialing_to_ringing);
break;
@@ -1296,6 +1307,14 @@ mm_base_call_class_init (MMBaseCallClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
+ properties[PROP_SKIP_INCOMING_TIMEOUT] =
+ g_param_spec_boolean (MM_BASE_CALL_SKIP_INCOMING_TIMEOUT,
+ "Skip incoming timeout",
+ "There is no need to setup a timeout for incoming calls",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property (object_class, PROP_SKIP_INCOMING_TIMEOUT, properties[PROP_SKIP_INCOMING_TIMEOUT]);
+
properties[PROP_SUPPORTS_DIALING_TO_RINGING] =
g_param_spec_boolean (MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING,
"Dialing to ringing",
diff --git a/src/mm-base-call.h b/src/mm-base-call.h
index 3e89467d..7f02f39e 100644
--- a/src/mm-base-call.h
+++ b/src/mm-base-call.h
@@ -39,6 +39,7 @@ typedef struct _MMBaseCallPrivate MMBaseCallPrivate;
#define MM_BASE_CALL_PATH "call-path"
#define MM_BASE_CALL_CONNECTION "call-connection"
#define MM_BASE_CALL_MODEM "call-modem"
+#define MM_BASE_CALL_SKIP_INCOMING_TIMEOUT "call-skip-incoming-timeout"
#define MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING "call-supports-dialing-to-ringing"
#define MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE "call-supports-ringing-to-active"