From 48221250ba8445b82dc9beaaf0853a37afffcdf6 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 24 Sep 2015 18:41:48 -0700 Subject: AudioService: cleanup sco audio mode upon disconnection. Clean up SCO forced usage and A2DP suspend state upon SCO device or profile disconnection. This is in case the Bluetooth Headset service does not do it. Bug: 24316765. Change-Id: Ifc0305607c186be49b2eb42b7868647292e56137 --- services/core/java/com/android/server/audio/AudioService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 7565e9d..2c6bafc 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -2527,11 +2527,14 @@ public class AudioService extends IAudioService.Stub { } /** @see AudioManager#setBluetoothScoOn(boolean) */ - public void setBluetoothScoOn(boolean on){ + public void setBluetoothScoOn(boolean on) { if (!checkAudioSettingsPermission("setBluetoothScoOn()")) { return; } + setBluetoothScoOnInt(on); + } + public void setBluetoothScoOnInt(boolean on) { if (on) { mForcedUseForComm = AudioSystem.FORCE_BT_SCO; } else if (mForcedUseForComm == AudioSystem.FORCE_BT_SCO) { @@ -2892,6 +2895,8 @@ public class AudioService extends IAudioService.Stub { mScoAudioState = SCO_STATE_INACTIVE; broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_DISCONNECTED); } + AudioSystem.setParameters("A2dpSuspended=false"); + setBluetoothScoOnInt(false); } private void broadcastScoConnectionState(int state) { -- cgit v1.1