Loading src/com/android/bluetooth/a2dp/A2dpService.java +11 −0 Original line number Diff line number Diff line Loading @@ -507,7 +507,14 @@ public class A2dpService extends ProfileService { } // Make sure the Audio Manager knows the previous Active device is disconnected, // and the new Active device is connected. // Also, mute and unmute the output during the switch to avoid audio glitches. boolean wasMuted = false; if (previousActiveDevice != null) { if (!mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC)) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, 0); wasMuted = true; } mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP, true, -1); Loading @@ -529,6 +536,10 @@ public class A2dpService extends ProfileService { // change, so the Audio Service can reset accordingly the audio // feeding parameters in the Audio HAL to the Bluetooth stack. mAudioManager.handleBluetoothA2dpDeviceConfigChange(mActiveDevice); if (wasMuted) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_UNMUTE, 0); } } } return true; Loading Loading
src/com/android/bluetooth/a2dp/A2dpService.java +11 −0 Original line number Diff line number Diff line Loading @@ -507,7 +507,14 @@ public class A2dpService extends ProfileService { } // Make sure the Audio Manager knows the previous Active device is disconnected, // and the new Active device is connected. // Also, mute and unmute the output during the switch to avoid audio glitches. boolean wasMuted = false; if (previousActiveDevice != null) { if (!mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC)) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, 0); wasMuted = true; } mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP, true, -1); Loading @@ -529,6 +536,10 @@ public class A2dpService extends ProfileService { // change, so the Audio Service can reset accordingly the audio // feeding parameters in the Audio HAL to the Bluetooth stack. mAudioManager.handleBluetoothA2dpDeviceConfigChange(mActiveDevice); if (wasMuted) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_UNMUTE, 0); } } } return true; Loading