From a7454306c2a0aaa054a109a4c3c15f4a62e39121 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 4 Jan 2023 12:10:34 +0100 Subject: [PATCH] ringer: Remove explicit DBus timeout handling As libfeedback uses GDbusProxy under the hood which defaults to timing out after 25 seconds there is no need to handle timeouts explicitly. Furthermore 1 second seems to not always be enough time to get a response which leads to endless ringing. Fixes #543 --- src/calls-ringer.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/calls-ringer.c b/src/calls-ringer.c index 879524d..c018410 100644 --- a/src/calls-ringer.c +++ b/src/calls-ringer.c @@ -38,10 +38,6 @@ #include -/* cancel lfb operations after reaching the timeout */ -#define LFB_TIMEOUT_MS 1000 - - enum { PROP_0, PROP_RING_STATE, @@ -63,7 +59,6 @@ struct _CallsRinger { CallsRingState target_state; gboolean freeze_state_notify; - guint request_timeout_id; }; @@ -93,8 +88,6 @@ set_ring_state (CallsRinger *self, g_assert (CALLS_IS_RINGER (self)); g_assert (state >= CALLS_RING_STATE_INACTIVE && state <= CALLS_RING_STATE_ERROR); - g_clear_handle_id (&self->request_timeout_id, g_source_remove); - if (self->state == state) return; @@ -208,23 +201,6 @@ on_feedback_ended (LfbEvent *event, } -static gboolean -request_timed_out (CallsRinger *self) -{ - if (!CALLS_IS_RINGER (self)) - return G_SOURCE_REMOVE; - - g_debug ("Request '%s' timed out, cancelling..", - ring_state_to_string (self->target_state)); - - g_cancellable_cancel (self->cancel); - - set_ring_state (self, CALLS_RING_STATE_ERROR); - - return G_SOURCE_REMOVE; -} - - static LfbEvent * get_event_for_state (CallsRinger *self, CallsRingState state) @@ -277,8 +253,6 @@ target_state_step (CallsRinger *self) self); } - self->request_timeout_id = - g_timeout_add (LFB_TIMEOUT_MS, G_SOURCE_FUNC (request_timed_out), self); } @@ -486,8 +460,6 @@ dispose (GObject *object) g_signal_handlers_disconnect_by_data (calls_manager_get_default (), self); - g_clear_handle_id (&self->request_timeout_id, g_source_remove); - g_cancellable_cancel (self->cancel); g_clear_object (&self->cancel);