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

Commit 7fc51569 authored by Daniel Yu's avatar Daniel Yu
Browse files

docs: Fixing errors in AudioFocus sample code

Fixing some minor syntax errors in code snippet.
Verified code syntax in Android Studio.

Bug: 25461807
Change-Id: Ic5759044616dedef093401660d1fdb0b153f5903
parent dc63f763
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