Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36839eb5 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

AudioService: Go back to virtual SCO calls on multi-function units

Direct raw audio channels to these HFP devices is resulting in
dead audio on hangouts, on all devices. Until that is figured
out and/or fixed, go back to establishing a virtual call to open
up the audio channels

Change-Id: I794e75eed96ac09cfbb1c9d28c90d3161cfb7149
parent 44a50754
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2188,6 +2188,19 @@ public class AudioService extends IAudioService.Stub {
                                mScoAudioMode =
                                        (targetSdkVersion < Build.VERSION_CODES.JELLY_BEAN_MR2) ?
                                                SCO_MODE_VIRTUAL_CALL : SCO_MODE_RAW;
                                /*
                                 * Raw mode causes some issues on HFP head units,
                                 * apparently when doing PBAP, so disregard it on
                                 * those for now and keep using VIRTUAL_CALL
                                 */
                                if (mBluetoothHeadsetDevice != null) {
                                    BluetoothClass btClass = mBluetoothHeadsetDevice.getBluetoothClass();
                                    if (btClass.getDeviceClass() ==
                                        BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE  &&
                                        btClass.hasService(BluetoothClass.Service.OBJECT_TRANSFER)) {
                                            mScoAudioMode = SCO_MODE_VIRTUAL_CALL;
                                    }
                                }
                                if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {
                                    boolean status;
                                    if (mScoAudioMode == SCO_MODE_RAW) {