1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-16 05:15:36 +00:00

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
This commit is contained in:
Evangelos Ribeiro Tzaras 2023-01-04 12:10:34 +01:00
parent c5025d4cc5
commit a7454306c2

View file

@ -38,10 +38,6 @@
#include <libfeedback.h>
/* 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);