hfp_ag: setup audio connection w/o in-band ringing if HF accepts call

This commit is contained in:
Matthias Ringwald 2021-03-31 18:03:50 +02:00
parent 2d66e7972b
commit b956fff3a7

View File

@ -1811,11 +1811,7 @@ static void hfp_ag_run_for_context(hfp_connection_t *hfp_connection){
cmd_sent = call_setup_state_machine(hfp_connection);
}
if (!cmd_sent){
cmd_sent = hfp_ag_run_for_audio_connection(hfp_connection);
}
// trigger codec exchange
// trigger codec exchange (must be before hfp_ag_run_for_audio_connection)
if (!cmd_sent && (hfp_connection->command == HFP_CMD_NONE) && hfp_connection->trigger_codec_exchange){
log_info("trigger codec, command %u, codec state %u", hfp_connection->command, hfp_connection->codecs_state);
switch (hfp_connection->codecs_state){
@ -1831,6 +1827,11 @@ static void hfp_ag_run_for_context(hfp_connection_t *hfp_connection){
}
}
if (!cmd_sent){
cmd_sent = hfp_ag_run_for_audio_connection(hfp_connection);
}
// disconnect
if (!cmd_sent && (hfp_connection->command == HFP_CMD_NONE) && (hfp_connection->state == HFP_W2_DISCONNECT_RFCOMM)){
hfp_connection->state = HFP_W4_RFCOMM_DISCONNECTED;