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

Commit f50bfad3 authored by Mallikarjuna GB's avatar Mallikarjuna GB Committed by Steve Kondik
Browse files

Bluetooth: use virtual sco calls for VOIP

 - use virtualvoicesco connection set-up for VOIP calls
 - cannot simply revert c18c9138
and 25fc29b3 changes because
of aidl modifications involved.

Change-Id: Ib49cb01151a9cea2e94bc7a51ad1f58e877271aa
CRs-Fixed: 598072
parent 7d4d2279
Loading
Loading
Loading
Loading
+3 −19
Original line number Original line Diff line number Diff line
@@ -2233,12 +2233,8 @@ public class AudioService extends IAudioService.Stub {
                                }
                                }
                                if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {
                                if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {
                                    boolean status;
                                    boolean status;
                                    if (mScoAudioMode == SCO_MODE_RAW) {
                                        status = mBluetoothHeadset.connectAudio();
                                    } else {
                                    status = mBluetoothHeadset.startScoUsingVirtualVoiceCall(
                                    status = mBluetoothHeadset.startScoUsingVirtualVoiceCall(
                                                                            mBluetoothHeadsetDevice);
                                                                            mBluetoothHeadsetDevice);
                                    }
                                    if (status) {
                                    if (status) {
                                        mScoAudioState = SCO_STATE_ACTIVE_INTERNAL;
                                        mScoAudioState = SCO_STATE_ACTIVE_INTERNAL;
                                    } else {
                                    } else {
@@ -2262,12 +2258,8 @@ public class AudioService extends IAudioService.Stub {
                    if (mScoAudioState == SCO_STATE_ACTIVE_INTERNAL) {
                    if (mScoAudioState == SCO_STATE_ACTIVE_INTERNAL) {
                        if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {
                        if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {
                            boolean status;
                            boolean status;
                            if (mScoAudioMode == SCO_MODE_RAW) {
                                status = mBluetoothHeadset.disconnectAudio();
                            } else {
                                status = mBluetoothHeadset.stopScoUsingVirtualVoiceCall(
                                status = mBluetoothHeadset.stopScoUsingVirtualVoiceCall(
                                                                        mBluetoothHeadsetDevice);
                                                                        mBluetoothHeadsetDevice);
                            }
                            if (!status) {
                            if (!status) {
                                mScoAudioState = SCO_STATE_INACTIVE;
                                mScoAudioState = SCO_STATE_INACTIVE;
                                broadcastScoConnectionState(
                                broadcastScoConnectionState(
@@ -2443,20 +2435,12 @@ public class AudioService extends IAudioService.Stub {
                            switch (mScoAudioState) {
                            switch (mScoAudioState) {
                            case SCO_STATE_ACTIVATE_REQ:
                            case SCO_STATE_ACTIVATE_REQ:
                                mScoAudioState = SCO_STATE_ACTIVE_INTERNAL;
                                mScoAudioState = SCO_STATE_ACTIVE_INTERNAL;
                                if (mScoAudioMode == SCO_MODE_RAW) {
                                    status = mBluetoothHeadset.connectAudio();
                                } else {
                                status = mBluetoothHeadset.startScoUsingVirtualVoiceCall(
                                status = mBluetoothHeadset.startScoUsingVirtualVoiceCall(
                                                                        mBluetoothHeadsetDevice);
                                                                        mBluetoothHeadsetDevice);
                                }
                                break;
                                break;
                            case SCO_STATE_DEACTIVATE_REQ:
                            case SCO_STATE_DEACTIVATE_REQ:
                                if (mScoAudioMode == SCO_MODE_RAW) {
                                    status = mBluetoothHeadset.disconnectAudio();
                                } else {
                                 status = mBluetoothHeadset.stopScoUsingVirtualVoiceCall(
                                 status = mBluetoothHeadset.stopScoUsingVirtualVoiceCall(
                                                                        mBluetoothHeadsetDevice);
                                                                        mBluetoothHeadsetDevice);
                                }
                                break;
                                break;
                            case SCO_STATE_DEACTIVATE_EXT_REQ:
                            case SCO_STATE_DEACTIVATE_EXT_REQ:
                                status = mBluetoothHeadset.stopVoiceRecognition(
                                status = mBluetoothHeadset.stopVoiceRecognition(