From f30452e5bb796f869eff945402ecf1d4fedb8077 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 24 Oct 2008 18:01:59 +0300 Subject: Clear pending ring if calling is stopped before SCO is up --- audio/headset.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'audio/headset.c') diff --git a/audio/headset.c b/audio/headset.c index 648185b5..cb11e40a 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -2462,14 +2462,23 @@ int telephony_incoming_call_ind(const char *number, int type) int telephony_calling_stopped_ind(void) { + struct audio_device *dev; + if (!active_devices) return -ENODEV; - if (!ag.ring_timer) + /* In case SCO isn't fully up yet */ + dev = active_devices->data; + + if (!dev->headset->pending_ring && !ag.ring_timer) return -EINVAL; - g_source_remove(ag.ring_timer); - ag.ring_timer = 0; + dev->headset->pending_ring = FALSE; + + if (ag.ring_timer) { + g_source_remove(ag.ring_timer); + ag.ring_timer = 0; + } return 0; } -- cgit