base-call: allow skipping the timeout in incoming calls
E.g. if the modem supports reporting incoming call updates explicitly.
This commit is contained in:
@@ -40,6 +40,7 @@ enum {
|
|||||||
PROP_PATH,
|
PROP_PATH,
|
||||||
PROP_CONNECTION,
|
PROP_CONNECTION,
|
||||||
PROP_MODEM,
|
PROP_MODEM,
|
||||||
|
PROP_SKIP_INCOMING_TIMEOUT,
|
||||||
PROP_SUPPORTS_DIALING_TO_RINGING,
|
PROP_SUPPORTS_DIALING_TO_RINGING,
|
||||||
PROP_SUPPORTS_RINGING_TO_ACTIVE,
|
PROP_SUPPORTS_RINGING_TO_ACTIVE,
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
@@ -55,6 +56,7 @@ struct _MMBaseCallPrivate {
|
|||||||
/* The path where the call object is exported */
|
/* The path where the call object is exported */
|
||||||
gchar *path;
|
gchar *path;
|
||||||
/* Features */
|
/* Features */
|
||||||
|
gboolean skip_incoming_timeout;
|
||||||
gboolean supports_dialing_to_ringing;
|
gboolean supports_dialing_to_ringing;
|
||||||
gboolean supports_ringing_to_active;
|
gboolean supports_ringing_to_active;
|
||||||
|
|
||||||
@@ -164,6 +166,9 @@ incoming_timeout_cb (MMBaseCall *self)
|
|||||||
void
|
void
|
||||||
mm_base_call_incoming_refresh (MMBaseCall *self)
|
mm_base_call_incoming_refresh (MMBaseCall *self)
|
||||||
{
|
{
|
||||||
|
if (self->priv->skip_incoming_timeout)
|
||||||
|
return;
|
||||||
|
|
||||||
if (self->priv->incoming_timeout)
|
if (self->priv->incoming_timeout)
|
||||||
g_source_remove (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);
|
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);
|
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PROP_SKIP_INCOMING_TIMEOUT:
|
||||||
|
self->priv->skip_incoming_timeout = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
case PROP_SUPPORTS_DIALING_TO_RINGING:
|
case PROP_SUPPORTS_DIALING_TO_RINGING:
|
||||||
self->priv->supports_dialing_to_ringing = g_value_get_boolean (value);
|
self->priv->supports_dialing_to_ringing = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
@@ -1192,6 +1200,9 @@ get_property (GObject *object,
|
|||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_value_set_object (value, self->priv->modem);
|
g_value_set_object (value, self->priv->modem);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SKIP_INCOMING_TIMEOUT:
|
||||||
|
g_value_set_boolean (value, self->priv->skip_incoming_timeout);
|
||||||
|
break;
|
||||||
case PROP_SUPPORTS_DIALING_TO_RINGING:
|
case PROP_SUPPORTS_DIALING_TO_RINGING:
|
||||||
g_value_set_boolean (value, self->priv->supports_dialing_to_ringing);
|
g_value_set_boolean (value, self->priv->supports_dialing_to_ringing);
|
||||||
break;
|
break;
|
||||||
@@ -1296,6 +1307,14 @@ mm_base_call_class_init (MMBaseCallClass *klass)
|
|||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
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] =
|
properties[PROP_SUPPORTS_DIALING_TO_RINGING] =
|
||||||
g_param_spec_boolean (MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING,
|
g_param_spec_boolean (MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING,
|
||||||
"Dialing to ringing",
|
"Dialing to ringing",
|
||||||
|
@@ -39,6 +39,7 @@ typedef struct _MMBaseCallPrivate MMBaseCallPrivate;
|
|||||||
#define MM_BASE_CALL_PATH "call-path"
|
#define MM_BASE_CALL_PATH "call-path"
|
||||||
#define MM_BASE_CALL_CONNECTION "call-connection"
|
#define MM_BASE_CALL_CONNECTION "call-connection"
|
||||||
#define MM_BASE_CALL_MODEM "call-modem"
|
#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_DIALING_TO_RINGING "call-supports-dialing-to-ringing"
|
||||||
#define MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE "call-supports-ringing-to-active"
|
#define MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE "call-supports-ringing-to-active"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user