From 1eeec40ee85552cee957f35db9cc85aae6116e48 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 21 May 2020 15:03:17 +0200 Subject: iface-modem-voice: fix assert() when setting up call polling If an incoming call is detected during the CLCC polling, the polling timeout will already be set, so don't assert when checking the polling id afterwards, just make sure we don't reset the timeout. https://lists.freedesktop.org/archives/modemmanager-devel/2020-May/007866.html --- src/mm-iface-modem-voice.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c index ba6b52c5..a91ca881 100644 --- a/src/mm-iface-modem-voice.c +++ b/src/mm-iface-modem-voice.c @@ -2419,11 +2419,13 @@ load_call_list_ready (MMIfaceModemVoice *self, mm_3gpp_call_info_list_free (call_info_list); } - /* setup the polling again */ - g_assert (!ctx->polling_id); - ctx->polling_id = g_timeout_add_seconds (CALL_LIST_POLLING_TIMEOUT_SECS, - (GSourceFunc) call_list_poll, - self); + /* setup the polling again, but only if it hasn't been done already while + * we reported calls (e.g. a new incoming call may have been detected that + * also triggers the poll setup) */ + if (!ctx->polling_id) + ctx->polling_id = g_timeout_add_seconds (CALL_LIST_POLLING_TIMEOUT_SECS, + (GSourceFunc) call_list_poll, + self); } static void -- cgit v1.2.3-70-g09d2