From 672d5239319a67d711a4367b4250eb316e0a34f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Wed, 24 Apr 2024 16:44:00 +0200 Subject: [PATCH 1/4] mm-origin: Don't crash when Modem has no location services When no locationservice is available the API can return `NULL` without setting an error. Closes: https://gitlab.gnome.org/GNOME/calls/-/issues/641 (cherry picked from commit 34b68ec082f86d6099c5db71fcf5593a51a70cfe) Part-of: --- plugins/provider/mm/calls-mm-origin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/provider/mm/calls-mm-origin.c b/plugins/provider/mm/calls-mm-origin.c index 9623ea8c..453444ad 100644 --- a/plugins/provider/mm/calls-mm-origin.c +++ b/plugins/provider/mm/calls-mm-origin.c @@ -652,7 +652,8 @@ on_modem_location_get_3gpp_finish (GObject *source_object, GAsyncResult *res, gp location_3gpp = mm_modem_location_get_3gpp_finish (location, res, &err); if (!location_3gpp) { - g_warning ("Failed to get 3gpp location service: %s", err->message); + if (err) + g_warning ("Failed to get 3gpp location service: %s", err->message); return; } -- GitLab From 8e6f5a1e8e3f613319d35c612888d2629efabd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sun, 16 Jun 2024 15:00:35 +0200 Subject: [PATCH 2/4] mm-origin: Handle missing SIM case more gracefully This avoids warnings like gnome-calls[57992]: mm_sim_get_imsi: assertion 'MM_IS_SIM (self)' failed gnome-calls[57992]: mm_sim_dup_emergency_numbers: assertion 'MM_IS_SIM (self)' failed in the logs (cherry picked from commit 93e0c72d9f667745464b73b1a9907123e9552129) Part-of: --- plugins/provider/mm/calls-mm-origin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/provider/mm/calls-mm-origin.c b/plugins/provider/mm/calls-mm-origin.c index 453444ad..06cd306a 100644 --- a/plugins/provider/mm/calls-mm-origin.c +++ b/plugins/provider/mm/calls-mm-origin.c @@ -882,13 +882,18 @@ get_sim_ready_cb (MMModem *modem, GAsyncResult *res, gpointer user_data) { + g_autoptr (GError) err = NULL; g_autoptr (CallsMMOrigin) self = NULL; const char *code; g_assert (CALLS_IS_MM_ORIGIN (user_data)); self = CALLS_MM_ORIGIN (user_data); - self->sim = mm_modem_get_sim_finish (modem, res, NULL); + self->sim = mm_modem_get_sim_finish (modem, res, &err); + if (!self->sim) { + g_warning ("Couldn't get sim: %s", err->message); + return; + } code = get_country_iso_for_mcc (mm_sim_get_imsi (self->sim)); if (code && g_strcmp0 (self->country_code, code)) { -- GitLab From 43ce0e9ba0e7f5ad75fb593f62b5d8a4dd005a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 22 Jun 2024 10:17:33 +0200 Subject: [PATCH 3/4] sip: Don't crash when handles never got set up Still need to figure out how we can end up there, see #580 (cherry picked from commit 13ebabfadbdd2a5fa9c26743223df00b1ca24f8d) Part-of: --- plugins/provider/sip/calls-sip-origin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/provider/sip/calls-sip-origin.c b/plugins/provider/sip/calls-sip-origin.c index 28de518f..e7712649 100644 --- a/plugins/provider/sip/calls-sip-origin.c +++ b/plugins/provider/sip/calls-sip-origin.c @@ -218,7 +218,8 @@ remove_calls (CallsSipOrigin *self, g_hash_table_remove_all (self->call_handles); - g_clear_pointer (&self->oper->call_handle, nua_handle_unref); + if (self->oper) + g_clear_pointer (&self->oper->call_handle, nua_handle_unref); } -- GitLab From dcb70a9b77428ee7bde4c769dc04ec66cf80ab37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 15 Jun 2024 18:16:33 +0200 Subject: [PATCH 4/4] calls-ringer: Don't restart when feedback got ended explicitly If a user e.g. lowers the gobal feedback level we don't want to retrigger the events. Without this calls assumes events ended naturally and restarts the ringing without any events. As that is never ended even subsequent calls don't receive any ringing. (cherry picked from commit b5af7f5e7de0d68df62403c7097302bdaee8aaea) Part-of: --- src/calls-ringer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calls-ringer.c b/src/calls-ringer.c index 61fdc6ff..12ba93e0 100644 --- a/src/calls-ringer.c +++ b/src/calls-ringer.c @@ -194,7 +194,8 @@ on_feedback_ended (LfbEvent *event, /* When no feedback is available on the system (e.g. no vibration motor or LEDs) * it will get ended immediately on triggering. Changing the target state will * break loop that would otherwise occur. */ - if (lfb_event_get_end_reason (event) == LFB_EVENT_END_REASON_NOT_FOUND) + if (lfb_event_get_end_reason (event) == LFB_EVENT_END_REASON_NOT_FOUND || + lfb_event_get_end_reason (event) == LFB_EVENT_END_REASON_EXPLICIT) self->target_state = CALLS_RING_STATE_INACTIVE; set_ring_state (self, CALLS_RING_STATE_INACTIVE); -- GitLab