Merge "MediaSession2 API set for audio focus handling"
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user