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

Commit 12a1f627 authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

MediaSession2: Unhide setAudioFocusRequest

Bug: 64098437
Test: make update-api
Change-Id: I9244719e1a771ab7b420a95af6ba43faef7b352c
parent 5ef42473
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24814,6 +24814,7 @@ package android.media {
    method public void sendCustomCommand(android.media.MediaSession2.Command, android.os.Bundle);
    method public void sendCustomCommand(android.media.MediaSession2.ControllerInfo, android.media.MediaSession2.Command, android.os.Bundle, android.os.ResultReceiver);
    method public void setAllowedCommands(android.media.MediaSession2.ControllerInfo, android.media.MediaSession2.CommandGroup);
    method public void setAudioFocusRequest(android.media.AudioFocusRequest);
    method public void setCustomLayout(android.media.MediaSession2.ControllerInfo, java.util.List<android.media.MediaSession2.CommandButton>);
    method public void setPlayer(android.media.MediaPlayerBase);
    method public void setPlayer(android.media.MediaPlayerBase, android.media.VolumeProvider2);
+5 −16
Original line number Diff line number Diff line
@@ -1185,24 +1185,13 @@ public class MediaSession2 implements AutoCloseable, MediaPlaylistController {
    }

    /**
     * Sets which type of audio focus will be requested during the playback, or configures playback
     * to not request audio focus. Valid values for focus requests are
     * {@link AudioManager#AUDIOFOCUS_GAIN}, {@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT},
     * {@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK}, and
     * {@link AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE}. Or use
     * {@link AudioManager#AUDIOFOCUS_NONE} to express that audio focus should not be
     * requested when playback starts. You can for instance use this when playing a silent animation
     * through this class, and you don't want to affect other audio applications playing in the
     * background.
     * Set the {@link AudioFocusRequest} to obtain the audio focus
     *
     * @param focusGain the type of audio focus gain that will be requested, or
     *                  {@link AudioManager#AUDIOFOCUS_NONE} to disable the use audio focus during
     *                  playback.
     * @hide
     * @param afr the full request parameters
     */
    // TODO(jaewan): Revisit
    public void setAudioFocusRequest(int focusGain) {
        mProvider.setAudioFocusRequest_impl(focusGain);
    public void setAudioFocusRequest(AudioFocusRequest afr) {
        // TODO: implement this
        // mProvider.setAudioFocusRequest_impl(focusGain);
    }

    /**