A2dpService: Remove mute unmute toggle during SHO.
Unmuting of stream happens before the new index gets set.
As adjustStreamVolume with unmute flag is called before
new index gets set.
To avoid this remove mute unmute toggle during SHO.
CRs-Fixed: 2503819
Change-Id: I72204cd298db61f68db6fafa81c122dbee821c76
diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java
index 5c4c23c..6751a14 100644
--- a/src/com/android/bluetooth/a2dp/A2dpService.java
+++ b/src/com/android/bluetooth/a2dp/A2dpService.java
@@ -891,16 +891,6 @@
}
// 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 && !tws_switch) {
- if (mAudioManager != null && !mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC)) {
- mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC,
- AudioManager.ADJUST_MUTE,
- mAudioManager.FLAG_BLUETOOTH_ABS_VOLUME);
- wasMuted = true;
- }
- }
if (!isBAActive && mAudioManager != null) {
// Make sure the Audio Manager knows the previous
@@ -929,13 +919,6 @@
} else {
Log.e(TAG,"adapterService is null");
}
-
-
- if (wasMuted && mAudioManager != null) {
- mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC,
- AudioManager.ADJUST_UNMUTE,
- mAudioManager.FLAG_BLUETOOTH_ABS_VOLUME);
- }
}
if (mAvrcp_ext != null && !tws_switch) {
mAvrcp_ext.setAbsVolumeFlag(device);