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

Commit ea5ebaa5 authored by Noah Wang's avatar Noah Wang
Browse files

Prevent gaining audio focus when opening magnification screen.

bug: 30521125
Change-Id: I22fe63ed2b0529c2a08b7be03c12753f3f060c1a
parent 665c1ced
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Point;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
@@ -76,6 +77,9 @@ public class ToggleScreenMagnificationPreferenceFragment extends
                }
            });

            // Make sure the VideoView does not request audio focus.
            videoView.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE);

            // Resolve and set the video content
            Bundle args = getArguments();
            if ((args != null) && args.containsKey(
@@ -85,6 +89,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
                        getPrefContext().getPackageName(),
                        args.getInt(AccessibilitySettings.EXTRA_VIDEO_RAW_RESOURCE_ID))));
            }

            // Make sure video controls (e.g. for pausing) are not displayed.
            videoView.setMediaController(null);