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

Commit 1dd060f8 authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioService BtHelper: fix isBluetoothScoOn()

BtHelper.isBluetoothScoOn() should not return true if
the BT headset profile is not connected.

Bug: 154464603
Test: regression tests for calls over Bluetooth
Change-Id: I7c075977be79810cc57f06426fb9eec01c72606c
parent 2404bc61
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -358,14 +358,11 @@ public class BtHelper {
     * @return false if SCO isn't connected
     */
    /*package*/ synchronized boolean isBluetoothScoOn() {
        if ((mBluetoothHeadset != null)
                && (mBluetoothHeadset.getAudioState(mBluetoothHeadsetDevice)
                != BluetoothHeadset.STATE_AUDIO_CONNECTED)) {
            Log.w(TAG, "isBluetoothScoOn(true) returning false because "
                    + mBluetoothHeadsetDevice + " is not in audio connected mode");
        if (mBluetoothHeadset == null) {
            return false;
        }
        return true;
        return mBluetoothHeadset.getAudioState(mBluetoothHeadsetDevice)
                == BluetoothHeadset.STATE_AUDIO_CONNECTED;
    }

    /**