diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-11-16 11:23:48 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-11-16 11:23:48 -0600 |
commit | 77b3048325d5c3af127a5346d9b16d07ef1ee642 (patch) | |
tree | 6eb6b651a6f3dc93781784db08b6c7efc074d4fe | |
parent | 534d7f89d276f2f683e9abad9c5a424fa30c5142 (diff) | |
download | ofono-77b3048325d5c3af127a5346d9b16d07ef1ee642.tar.bz2 |
Fix: Don't double-swap calls when 3-way dialing
-rw-r--r-- | drivers/hfpmodem/voicecall.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c index 2caf8ab2..323893b4 100644 --- a/drivers/hfpmodem/voicecall.c +++ b/drivers/hfpmodem/voicecall.c @@ -60,6 +60,7 @@ struct voicecall_data { int cind_val[HFP_INDICATOR_LAST]; unsigned int id_list; unsigned int local_release; + ofono_bool_t ignore_callheld_1; }; struct release_id_req { @@ -321,6 +322,8 @@ static void atd_cb(gboolean ok, GAtResult *result, gpointer user_data) call->status = CALL_STATUS_HELD; ofono_voicecall_notify(vc, call); + + vd->ignore_callheld_1 = TRUE; } call = create_call(vd, 0, 0, CALL_STATUS_DIALING, NULL, type, validity); @@ -847,6 +850,15 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc, struct ofono_call *call; unsigned int callheld = vd->cind_val[HFP_INDICATOR_CALLHELD]; + /* When ATD is sent when another call is active, we will receive + * callheld=1, then callsetup=2. We have already placed active + * calls on hold in atd_cb, so ignore the callheld in this case + */ + if (vd->ignore_callheld_1 == TRUE && value == 1) { + vd->ignore_callheld_1 = FALSE; + goto out; + } + switch (value) { case 0: /* We have to poll here, we have no idea whether the call was @@ -906,6 +918,7 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc, release_with_status(vc, CALL_STATUS_ACTIVE); } +out: vd->cind_val[HFP_INDICATOR_CALLHELD] = value; } |