bluez5: hfp-hf: If available use AT+CLCC only to update calls state

This commit is contained in:
Frédéric Danis 2025-06-11 12:10:25 +02:00
parent 2cb678edb3
commit 75b4c3379d

View file

@ -2214,6 +2214,11 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token)
if (spa_streq(rfcomm->hf_indicators[indicator], "battchg")) {
spa_bt_device_report_battery_level(rfcomm->device, value * 100 / 5);
} else if (spa_streq(rfcomm->hf_indicators[indicator], "callsetup")) {
if (rfcomm->hfp_hf_clcc) {
rfcomm_send_cmd(rfcomm, "AT+CLCC");
return true;
}
if (value == CIND_CALLSETUP_NONE) {
struct spa_bt_telephony_call *call, *tcall;
spa_list_for_each_safe(call, tcall, &rfcomm->telephony_ag->call_list, link) {
@ -2268,11 +2273,13 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token)
}
}
if (rfcomm->hfp_hf_clcc)
rfcomm_send_cmd(rfcomm, "AT+CLCC");
else
rfcomm->hfp_hf_in_progress = false;
} else if (spa_streq(rfcomm->hf_indicators[indicator], "call")) {
if (rfcomm->hfp_hf_clcc) {
rfcomm_send_cmd(rfcomm, "AT+CLCC");
return true;
}
if (value == 0) {
struct spa_bt_telephony_call *call, *tcall;
spa_list_for_each_safe(call, tcall, &rfcomm->telephony_ag->call_list, link) {
@ -2293,11 +2300,13 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token)
}
}
if (rfcomm->hfp_hf_clcc)
rfcomm_send_cmd(rfcomm, "AT+CLCC");
else
rfcomm->hfp_hf_in_progress = false;
} else if (spa_streq(rfcomm->hf_indicators[indicator], "callheld")) {
if (rfcomm->hfp_hf_clcc) {
rfcomm_send_cmd(rfcomm, "AT+CLCC");
return true;
}
if (value == 0) { /* Reject waiting call or no held calls */
struct spa_bt_telephony_call *call, *tcall;
bool found_waiting = false;
@ -2348,9 +2357,6 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token)
}
}
if (rfcomm->hfp_hf_clcc)
rfcomm_send_cmd(rfcomm, "AT+CLCC");
else
rfcomm->hfp_hf_in_progress = false;
}
}