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

Commit db619253 authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

A2DP Sink focus handling

No need to continue setting the setWillPauseWhenDucked flag.  The audio
policy should handle it.

Test: runtest bluetooth -c com.android.bluetooth.a2dpsink.A2dpSinkStreamHandlerTest
Bug: 122710846

Change-Id: I26496f0ba8c13626f8f4d3baa20a31e466e93085
parent 7a54a3d3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -258,12 +258,10 @@ public class A2dpSinkStreamHandler extends Handler {
                new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_MEDIA)
                        .setContentType(AudioAttributes.CONTENT_TYPE_UNKNOWN)
                        .build();
        // Bluetooth ducking is handled at the native layer so tell the Audio Manger to notify the
        // focus change listener via .setWillPauseWhenDucked().
        // Bluetooth ducking is handled at the native layer at the request of AudioManager.
        AudioFocusRequest focusRequest =
                new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN).setAudioAttributes(
                        streamAttributes)
                        .setWillPauseWhenDucked(true)
                        .setOnAudioFocusChangeListener(mAudioFocusListener, this)
                        .build();
        int focusRequestStatus = mAudioManager.requestAudioFocus(focusRequest);