Skip to content
Snippets Groups Projects
Commit 0480ff3d authored by Ugo Yu's avatar Ugo Yu Committed by Cherrypicker Worker
Browse files

Handle AVDT_SCB_HDL_TC_CLOSE in avdt_scb idle state

Fix an issue of if the remote device disconnect AVDTP before it
is configured, the avdt_scb state machine ingores the close event
and cause the bta_av state machine stuck at INCOMING state.

The issue is:
1. remote initiates AVDTP connection, bta_av_ssm switches to INCOMING state
2. bta_av_accept_signalling_timer_cback() timer is fired, in case the remote device (AVDTP initiator) does not send discovery.
3. remote send discovery and found out we don't have A2DP sink, then disconnect.
4. avdt_scb ignores the L2C disconnection in IDLE state, makes the bta_av_ssm stays at INCOMING state.
5. bta_av_accept_signalling_timer_cback() timed out, and notice that bta_av_ssm is still in INCOMING state, it assumes that the remote did not finish discovery, so it starts a new discovery procedure.

This change makes the avdt_scb handle L2C close in idle state so the bta_av_ssm does not stuck at INCOMING state if the L2C link is disconnected before the AVDTP is configured.
Cherry picked from wear OS

Bug: 263323082
Bug: 239833275
Test: Manual
Change-Id: I629f44f477ffe111112db70738fb4241e179684d
(cherry picked from commit e440c1acacf0b53a0460475b0ecca5a74d552aec)
(cherry picked from commit a66bb86d)
Merged-In: I629f44f477ffe111112db70738fb4241e179684d
parent e5e357d1
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,7 @@ const uint8_t avdt_scb_st_idle[][AVDT_SCB_NUM_COLS] = {
/* TC_DATA_EVT */
{AVDT_SCB_DROP_PKT, AVDT_SCB_IGNORE, AVDT_SCB_IDLE_ST},
/* CC_CLOSE_EVT */
{AVDT_SCB_CLR_VARS, AVDT_SCB_IGNORE, AVDT_SCB_IDLE_ST}};
{AVDT_SCB_HDL_TC_CLOSE, AVDT_SCB_CLR_VARS, AVDT_SCB_IDLE_ST}};
/* state table for configured state */
const uint8_t avdt_scb_st_conf[][AVDT_SCB_NUM_COLS] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment