diff options
author | Eric Laurent <elaurent@google.com> | 2015-09-24 18:41:48 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-09-24 18:41:48 -0700 |
commit | 48221250ba8445b82dc9beaaf0853a37afffcdf6 (patch) | |
tree | 67514bbc2df75849aa9a3eb3dbf91d8776ed6ab9 /services | |
parent | e1de9f674575df3b17e475c4f32dd93d33e596e3 (diff) | |
download | frameworks_base-48221250ba8445b82dc9beaaf0853a37afffcdf6.zip frameworks_base-48221250ba8445b82dc9beaaf0853a37afffcdf6.tar.gz frameworks_base-48221250ba8445b82dc9beaaf0853a37afffcdf6.tar.bz2 |
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
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/audio/AudioService.java | 7 |
1 files changed, 6 insertions, 1 deletions
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) { |