OSDN Git Service

audioservice: fix a2dp connection race condition
authorEric Laurent <elaurent@google.com>
Thu, 14 Jun 2018 02:36:42 +0000 (19:36 -0700)
committerStanley Tng <stng@google.com>
Tue, 16 Oct 2018 22:29:25 +0000 (15:29 -0700)
commit07f582189a00308a41c09c9652af7c410cc0d18e
treeb5b5429aeb7495dc9b0b8fce44845e4fd833a8c1
parent58d5c1e938b42b9e82e77738a54941d5c7ecb8e2
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 3c4636c7127cd34728050d051ef3bd62829e877d)
Merged-In: Ib81b3805f945f7206b1a60de74e9bbeeef89bdd0
services/core/java/com/android/server/audio/AudioService.java