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

Commit 68c6e454 authored by Dan Yu's avatar Dan Yu Committed by Android (Google) Code Review
Browse files

Merge "docs: Fixing errors in AudioFocus sample code" into mnc-docs

parents f58e870e 7fc51569
Loading
Loading
Loading
Loading
+27 −26
Original line number Diff line number Diff line
@@ -139,9 +139,10 @@ loss is transient and resume it when we have regained the focus. If the loss is
unregisters our media button event receiver and stops monitoring audio focus changes.<p>

<pre>
OnAudioFocusChangeListener afChangeListener = new OnAudioFocusChangeListener() {
AudioManager.OnAudioFocusChangeListener afChangeListener =
    new AudioManager.OnAudioFocusChangeListener() {
        public void onAudioFocusChange(int focusChange) {
        if (focusChange == AUDIOFOCUS_LOSS_TRANSIENT
            if (focusChange == AUDIOFOCUS_LOSS_TRANSIENT) {
                // Pause playback
            } else if (focusChange == AudioManager.AUDIOFOCUS_GAIN) {
                // Resume playback