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

Commit 81fc6325 authored by Jaewan Kim's avatar Jaewan Kim Committed by Android (Google) Code Review
Browse files

Merge "MediaSession2 API set for audio focus handling"

parents b228cc67 b4689ed9
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.media;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.media.MediaSession2.PlaylistParams;

import java.util.List;
@@ -48,6 +50,18 @@ public interface MediaPlayerInterface {
    void rewind();

    PlaybackState2 getPlaybackState();

    /**
     * Sets the {@link AudioAttributes} to be used during the playback of the media.
     *
     * @param attributes non-null <code>AudioAttributes</code>.
     */
    void setAudioAttributes(@NonNull AudioAttributes attributes);

    /**
     * Returns AudioAttributes that media player has.
     */
    @Nullable
    AudioAttributes getAudioAttributes();

    void setPlaylist(List<MediaItem2> item, PlaylistParams param);
+0 −9
Original line number Diff line number Diff line
@@ -1078,15 +1078,6 @@ public class MediaSession2 implements AutoCloseable {
        return mProvider.getConnectedControllers_impl();
    }

    /**
     * Sets the {@link AudioAttributes} to be used during the playback of the video.
     *
     * @param attributes non-null <code>AudioAttributes</code>.
     */
    public void setAudioAttributes(@NonNull AudioAttributes attributes) {
        mProvider.setAudioAttributes_impl(attributes);
    }

    /**
     * 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
+0 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ public interface MediaSession2Provider extends TransportControlProvider {
    SessionToken2 getToken_impl();
    List<ControllerInfo> getConnectedControllers_impl();
    void setCustomLayout_impl(ControllerInfo controller, List<CommandButton> layout);
    void setAudioAttributes_impl(AudioAttributes attributes);
    void setAudioFocusRequest_impl(int focusGain);

    void setAllowedCommands_impl(ControllerInfo controller, CommandGroup commands);