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

Commit 264d46d6 authored by Zach Johnson's avatar Zach Johnson Committed by Android Git Automerger
Browse files

am 5040e76e: Only apply foreground flag for audio state connected

* commit '5040e76e':
  Only apply foreground flag for audio state connected
parents 8fe21aec 5040e76e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2242,11 +2242,11 @@ final class HeadsetClientStateMachine extends StateMachine {


    private void broadcastAudioState(BluetoothDevice device, int newState, int prevState) {
    private void broadcastAudioState(BluetoothDevice device, int newState, int prevState) {
        Intent intent = new Intent(BluetoothHeadsetClient.ACTION_AUDIO_STATE_CHANGED);
        Intent intent = new Intent(BluetoothHeadsetClient.ACTION_AUDIO_STATE_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState);
        intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState);
        intent.putExtra(BluetoothProfile.EXTRA_STATE, newState);
        intent.putExtra(BluetoothProfile.EXTRA_STATE, newState);


        if (newState == BluetoothHeadsetClient.STATE_AUDIO_CONNECTED) {
        if (newState == BluetoothHeadsetClient.STATE_AUDIO_CONNECTED) {
            intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
            intent.putExtra(BluetoothHeadsetClient.EXTRA_AUDIO_WBS, mAudioWbs);
            intent.putExtra(BluetoothHeadsetClient.EXTRA_AUDIO_WBS, mAudioWbs);
        }
        }