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

Commit 5ef5d125 authored by Zach Johnson's avatar Zach Johnson
Browse files

Add FLAG_RECEIVER_FOREGROUND to audio state broadcasts

This is important so audio can be rejected in a timely manner
when necessary.

Change-Id: I4a7789d262ac74c5014b34eb959d502a68217362
parent f45a0c2a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2242,6 +2242,7 @@ final class HeadsetClientStateMachine extends StateMachine {

    private void broadcastAudioState(BluetoothDevice device, int newState, int prevState) {
        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_STATE, newState);