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

Commit ca75f42f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Listen to BT audio off outside of calls"

parents b463f281 32242497
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -74,10 +74,6 @@ public class BluetoothStateReceiver extends BroadcastReceiver {
    }
    }


    private void handleAudioStateChanged(Intent intent) {
    private void handleAudioStateChanged(Intent intent) {
        if (!mIsInCall) {
            Log.i(LOG_TAG, "Ignoring BT audio state change since we're not in a call");
            return;
        }
        int bluetoothHeadsetAudioState =
        int bluetoothHeadsetAudioState =
                intent.getIntExtra(BluetoothHeadset.EXTRA_STATE,
                intent.getIntExtra(BluetoothHeadset.EXTRA_STATE,
                        BluetoothHeadset.STATE_AUDIO_DISCONNECTED);
                        BluetoothHeadset.STATE_AUDIO_DISCONNECTED);
@@ -97,6 +93,10 @@ public class BluetoothStateReceiver extends BroadcastReceiver {
        args.arg2 = device.getAddress();
        args.arg2 = device.getAddress();
        switch (bluetoothHeadsetAudioState) {
        switch (bluetoothHeadsetAudioState) {
            case BluetoothHeadset.STATE_AUDIO_CONNECTED:
            case BluetoothHeadset.STATE_AUDIO_CONNECTED:
                if (!mIsInCall) {
                    Log.i(LOG_TAG, "Ignoring BT audio on since we're not in a call");
                    return;
                }
                mBluetoothRouteManager.sendMessage(BT_AUDIO_IS_ON, args);
                mBluetoothRouteManager.sendMessage(BT_AUDIO_IS_ON, args);
                break;
                break;
            case BluetoothHeadset.STATE_AUDIO_DISCONNECTED:
            case BluetoothHeadset.STATE_AUDIO_DISCONNECTED: