Skip to content
Commit 07f58218 authored by Eric Laurent's avatar Eric Laurent Committed by Stanley Tng
Browse files

audioservice: fix a2dp connection race condition

In case of fast (< 1 second) A2DP disconnect/connect sequence, there
is a potential race condition where the delayed disconnection message
(due to becoming noisy intent) is received after the not delayed
connection message.

- Make sure all messages related to device connection/disconnection
(including MSG_A2DP_DEVICE_CONFIG_CHANGE and MSG_BTA2DP_DOCK_TIMEOUT)
are handled by queueMsgUnderWakeLock().
- Make sure messages are processed in the same order as API calls.
- Add check for null address in makeA2dpDeviceUnavailableNow().

Bug: 109903807
Bug: 78837311
Test: repro steps in bugs. A2DP connection and playback

Change-Id: Ib81b3805f945f7206b1a60de74e9bbeeef89bdd0
(cherry picked from commit 3c4636c7)
Merged-In: Ib81b3805f945f7206b1a60de74e9bbeeef89bdd0
parent 58d5c1e9
Loading
Loading
Loading
Loading
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