diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-05-21 15:03:17 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-05-21 15:03:17 +0200 |
commit | 1eeec40ee85552cee957f35db9cc85aae6116e48 (patch) | |
tree | d453a2dabb0d097d5b0f2d39fed12423613604eb | |
parent | 98fa83a693c24002dc0087c4304ea1143b498d1f (diff) |
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
-rw-r--r-- | src/mm-iface-modem-voice.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 |