Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +0 −11 Original line number Original line Diff line number Diff line Loading @@ -551,14 +551,7 @@ public class A2dpService extends ProfileService { updateAndBroadcastActiveDevice(device); updateAndBroadcastActiveDevice(device); // Make sure the Audio Manager knows the previous Active device is disconnected, // Make sure the Audio Manager knows the previous Active device is disconnected, // and the new Active device is connected. // 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 (previousActiveDevice != null) { if (!mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC)) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, AudioManager.FLAG_BLUETOOTH_ABS_VOLUME); wasMuted = true; } mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP, true, -1); BluetoothProfile.A2DP, true, -1); Loading Loading @@ -594,10 +587,6 @@ public class A2dpService extends ProfileService { // change, so the Audio Service can reset accordingly the audio // change, so the Audio Service can reset accordingly the audio // feeding parameters in the Audio HAL to the Bluetooth stack. // feeding parameters in the Audio HAL to the Bluetooth stack. mAudioManager.handleBluetoothA2dpDeviceConfigChange(newActiveDevice); mAudioManager.handleBluetoothA2dpDeviceConfigChange(newActiveDevice); if (wasMuted) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_UNMUTE, AudioManager.FLAG_BLUETOOTH_ABS_VOLUME); } } } return true; return true; } } Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +0 −11 Original line number Original line Diff line number Diff line Loading @@ -551,14 +551,7 @@ public class A2dpService extends ProfileService { updateAndBroadcastActiveDevice(device); updateAndBroadcastActiveDevice(device); // Make sure the Audio Manager knows the previous Active device is disconnected, // Make sure the Audio Manager knows the previous Active device is disconnected, // and the new Active device is connected. // 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 (previousActiveDevice != null) { if (!mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC)) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_MUTE, AudioManager.FLAG_BLUETOOTH_ABS_VOLUME); wasMuted = true; } mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP, true, -1); BluetoothProfile.A2DP, true, -1); Loading Loading @@ -594,10 +587,6 @@ public class A2dpService extends ProfileService { // change, so the Audio Service can reset accordingly the audio // change, so the Audio Service can reset accordingly the audio // feeding parameters in the Audio HAL to the Bluetooth stack. // feeding parameters in the Audio HAL to the Bluetooth stack. mAudioManager.handleBluetoothA2dpDeviceConfigChange(newActiveDevice); mAudioManager.handleBluetoothA2dpDeviceConfigChange(newActiveDevice); if (wasMuted) { mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_UNMUTE, AudioManager.FLAG_BLUETOOTH_ABS_VOLUME); } } } return true; return true; } } Loading