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

Commit b65bcb95 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Listen to BT audio off outside of calls" am: ca75f42f am: baf292b2

am: dd4f1af6

Change-Id: I3af56ad9adb645df95e500299869cbb2d73ac6ed
parents 76adf6df dd4f1af6
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: