diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-11-16 11:45:03 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-11-16 11:47:42 -0600 |
commit | 1c3d41fafc1e1001d5227b00e17d8dc3e46273eb (patch) | |
tree | 2340957e3a352f3474f7a8f0e573725fa0f2be23 | |
parent | 77b3048325d5c3af127a5346d9b16d07ef1ee642 (diff) | |
download | ofono-1c3d41fafc1e1001d5227b00e17d8dc3e46273eb.tar.bz2 |
Fix: Don't drop dialing calls when call=0 signaled
-rw-r--r-- | drivers/hfpmodem/voicecall.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c index 323893b4..3591b74b 100644 --- a/drivers/hfpmodem/voicecall.c +++ b/drivers/hfpmodem/voicecall.c @@ -626,36 +626,25 @@ static void ciev_call_notify(struct ofono_voicecall *vc, switch (value) { case 0: - { - GSList *waiting; - GSList *incoming; - /* If call goes to 0, then we have no held or active calls * in the system. The waiting calls are promoted to incoming - * calls + * calls, dialing calls are kept. This also handles the + * situation when dialing and waiting calls exist */ - waiting = g_slist_find_custom(vd->calls, - GINT_TO_POINTER(CALL_STATUS_WAITING), - at_util_call_compare_by_status); + release_with_status(vc, CALL_STATUS_HELD); + release_with_status(vc, CALL_STATUS_ACTIVE); - if (waiting) { - incoming = waiting; - call = waiting->data; - call->status = CALL_STATUS_INCOMING; - ofono_voicecall_notify(vc, call); - } else - incoming = g_slist_find_custom(vd->calls, - GINT_TO_POINTER(CALL_STATUS_INCOMING), - at_util_call_compare_by_status); - - if (incoming) - vd->calls = g_slist_remove_link(vd->calls, incoming); + /* Promote waiting to incoming if it is the last call */ + if (vd->calls && vd->calls->next == NULL) { + call = vd->calls->data; - release_all_calls(vc); - vd->calls = incoming; + if (call->status == CALL_STATUS_WAITING) { + call->status = CALL_STATUS_INCOMING; + ofono_voicecall_notify(vc, call); + } + } break; - } case 1: { |