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

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

am 77cb1cb4: Only apply foreground flag for audio state connected

* commit '77cb1cb4':
  Only apply foreground flag for audio state connected
parents 368415cf 77cb1cb4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2242,11 +2242,11 @@ 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);

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