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

Commit f5cb6ea9 authored by Dan Yu's avatar Dan Yu Committed by android-build-merger
Browse files

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

am: 68c6e454

* commit '68c6e454':
  docs: Fixing errors in AudioFocus sample code
parents 5a9f615d 68c6e454
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