OSDN Git Service

Don't open SCO for 2nd MO call if a call is active
authorMallikarjuna GB <gbmalli@codeaurora.org>
Fri, 19 Sep 2014 14:57:17 +0000 (20:27 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 4 Jun 2015 20:28:07 +0000 (13:28 -0700)
When user dials a 2nd call, do not open SCO if 1st call was
active on DUT earpiece or speaker.

Change-Id: I974f5bcf917e6972705e60cf1da195eae23f885a

btif/src/btif_hf.c

index 4ac4735..3779dff 100644 (file)
@@ -1309,13 +1309,15 @@ static bt_status_t phone_state_change(int num_active, int num_held, bthf_call_st
                 }
                 break;
             case BTHF_CALL_STATE_DIALING:
-                ag_res.audio_handle = btif_hf_cb[idx].handle;
+                if (!(num_active + num_held))
+                    ag_res.audio_handle = btif_hf_cb[idx].handle;
                 res = BTA_AG_OUT_CALL_ORIG_RES;
                 break;
             case BTHF_CALL_STATE_ALERTING:
                 /* if we went from idle->alert, force SCO setup here. dialing usually triggers it */
-                if (btif_hf_cb[idx].call_setup_state == BTHF_CALL_STATE_IDLE)
-                ag_res.audio_handle = btif_hf_cb[idx].handle;
+                if ((btif_hf_cb[idx].call_setup_state == BTHF_CALL_STATE_IDLE) &&
+                        !(num_active + num_held))
+                    ag_res.audio_handle = btif_hf_cb[idx].handle;
                 res = BTA_AG_OUT_CALL_ALERT_RES;
                 break;
             default: