diff options
| author | 2010-04-20 07:01:00 -0700 | |
|---|---|---|
| committer | 2010-04-20 07:01:00 -0700 | |
| commit | 3b5912602bec6ccbe8eef8a576730b1565f0067c (patch) | |
| tree | 7d6c55c3d494252408cbe25c16bfc989296734ab | |
| parent | 0a4ab1b9b4c7b891c1ecb67eed99e9c9b30c93aa (diff) | |
Fix issue 2604270  Device auto connects to Car Dock (Media profile) after undocking.
There was a regression introduced by change 4c637b9e34f4c8db69a64ad21a4e2bcfa7485b5f
fixing issue 2578813. As the A2DP device disconnection is notified to the audio policy manager
after a delay, there is a period during which the A2DP device is actually not connected but the
A2DP output is considered present by audio framework. If a playback is started during this period,
The A2DP output requests the activation of the A2DP sink which in turn triggers a reconnection
of the A2DP sink.
The fix consists in suspending the A2DP output immediately when receiving the A2DP disconnection
intent so that any activity on A2DP output is ignored until the output is actually closed by the
audio policy manager.
Change-Id: I16eaace45e12bfc970f50836b46a73b756b493f0
| -rw-r--r-- | media/java/android/media/AudioService.java | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index a38be4854670..44596bfc2c24 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1728,6 +1728,9 @@ public class AudioService extends IAudioService.Stub {      }      private void makeA2dpDeviceUnavailableLater(String address) { +        // prevent any activity on the A2DP audio output to avoid unwanted +        // reconnection of the sink. +        AudioSystem.setParameters("A2dpSuspended=true");          // the device will be made unavailable later, so consider it disconnected right away          mConnectedDevices.remove(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP);          // send the delayed message to make the device unavailable later |