Skip to content

Commit 8fc03e5

Browse files
lylezhu2012Hardevsinh-Palaniya
authored andcommitted
Bluetooth: Classic: HF: Fix invalid query current calls list issue
The current calls list should not be queried if the SLC is not connected. Or the error `-ENOTCONN` will be returned by function `hf_query_current_calls()`. Check the connection status of HF before submitting a delay-able worker. Only the SLC is established, submit the delay-able worker. Signed-off-by: Lyle Zhu <[email protected]>
1 parent fb12616 commit 8fc03e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/bluetooth/host/classic/hfp_hf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,9 @@ static void ag_indicator_handle_call_held(struct bt_hfp_hf *hf, uint32_t value)
12811281
{
12821282
struct bt_hfp_hf_call *call;
12831283

1284-
k_work_reschedule(&hf->deferred_work, K_MSEC(HF_ENHANCED_CALL_STATUS_TIMEOUT));
1284+
if (atomic_test_bit(hf->flags, BT_HFP_HF_FLAG_CONNECTED)) {
1285+
k_work_reschedule(&hf->deferred_work, K_MSEC(HF_ENHANCED_CALL_STATUS_TIMEOUT));
1286+
}
12851287

12861288
LOG_DBG("call setup %d", value);
12871289

0 commit comments

Comments
 (0)