Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5cde0fb authored by Mallikarjuna GB's avatar Mallikarjuna GB Committed by Andre Eisenbach
Browse files

Handle multi party call states

UseCase:
1. Set up Bluetooth connection between phone and remote device.
2. Disconnect BT link by turning off remote device.
3. Start Mo call from phone.
4. Receive MT call from far end.
5. Turn on remote device.
6. BT connection gets established successfully, but audio
doesn't get transferred to headset.

Failure:
Call audio not routed to BT HS. SCO not established.

Root cause:
When a HS connects while in an active call and 2nd call
(incoming/outgoing/alerting) setup ongoing, incorrect post SLC
call setup updates might cause HS to get confused as phone had
already updated correct call states in CIND response during SLC.
This may cause HS to behave abnormally like delayed response to
BCS as seen with jabra wave +.

Fix:
Avoid sending incorrect call updates post SLC since we already
have sent correct updates during SLC as reponse to CIND.

Change-Id: I53e57baf7cca782af6f374a043667971c66a956d
parent fa5aa578
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1552,6 +1552,18 @@ void bta_ag_hfp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result)
            }
            break;

        case BTA_AG_MULTI_CALL_RES:
            /* open SCO at SLC for this three way call */
            APPL_TRACE_DEBUG("Headset Connected in three way call");
            if (!(p_scb->features & BTA_AG_FEAT_NOSCO))
            {
                if (p_result->data.audio_handle == bta_ag_scb_to_idx(p_scb))
                    bta_ag_sco_open(p_scb, (tBTA_AG_DATA *) p_result);
                else if (p_result->data.audio_handle == BTA_AG_HANDLE_NONE)
                    bta_ag_sco_close(p_scb, (tBTA_AG_DATA *) p_result);
            }
            break;

        case BTA_AG_OUT_CALL_CONN_RES:
            /* send indicators */
            bta_ag_send_call_inds(p_scb, p_result->result);
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ typedef UINT8 tBTA_AG_STATUS;
#define BTA_AG_END_CALL_RES         18  /* End call */
#define BTA_AG_IN_CALL_HELD_RES     19  /* Incoming call held */
#define BTA_AG_UNAT_RES             20  /* Response to unknown AT command event */
#define BTA_AG_MULTI_CALL_RES       21  /* SLC at three way call */

typedef UINT8 tBTA_AG_RES;

+8 −1
Original line number Diff line number Diff line
@@ -1232,6 +1232,13 @@ static bt_status_t phone_state_change(int num_active, int num_held, bthf_call_st

        memset(&ag_res, 0, sizeof(tBTA_AG_RES_DATA));
        ag_res.audio_handle = btif_hf_cb[idx].handle;
        /* Addition call setup with the Active call
        ** CIND response should have been updated.
        ** just open SCO conenction.
        */
        if (call_setup_state != BTHF_CALL_STATE_IDLE)
           res = BTA_AG_MULTI_CALL_RES;
        else
           res = BTA_AG_OUT_CALL_CONN_RES;
        BTA_AgResult(BTA_AG_HANDLE_ALL, res, &ag_res);
        activeCallUpdated = TRUE;