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

Commit e114bc97 authored by rakesh reddy's avatar rakesh reddy Committed by Ricardo Cerqueira
Browse files

Bluetooth: update SCO paramerter on Hfp service disconnect.

When hfp service disconnects as part of SSR, it should mark hfp state
as unavailable in Audio module

CRs-Fixed: 661652
Change-Id: Ib0bae2026a9c7f70ab384523d444668aceeb3f15
parent fb54c05b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2854,6 +2854,16 @@ public class AudioService extends IAudioService.Stub {
            case BluetoothProfile.HEADSET:
                synchronized (mScoClients) {
                    mBluetoothHeadset = null;
                    synchronized (mConnectedDevices) {
                        if (mForcedUseForComm == AudioSystem.FORCE_BT_SCO) {
                            Log.d(TAG, "Hfp service disconnects, update device to NONE");
                            mForcedUseForComm = AudioSystem.FORCE_NONE;
                            sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SENDMSG_QUEUE,
                                    AudioSystem.FOR_COMMUNICATION, mForcedUseForComm, null, 0);
                            sendMsg(mAudioHandler, MSG_SET_FORCE_USE, SENDMSG_QUEUE,
                                    AudioSystem.FOR_RECORD, mForcedUseForComm, null, 0);
                        }
                    }
                }
                break;