public final class

MediaSession.ConnectionResult

extends java.lang.Object

 java.lang.Object

↳androidx.media3.session.MediaSession.ConnectionResult

Overview

A result for MediaSession.Callback to denote the set of available commands and the custom layout for a controller.

Summary

Fields
public final Player.CommandsavailablePlayerCommands

Available player commands.

public final SessionCommandsavailableSessionCommands

Available session commands.

public final <any>customLayout

The custom layout or null if the custom layout of the session should be used.

public static final Player.CommandsDEFAULT_PLAYER_COMMANDS

public static final SessionCommandsDEFAULT_SESSION_AND_LIBRARY_COMMANDS

public static final SessionCommandsDEFAULT_SESSION_COMMANDS

public final booleanisAccepted

Whether the connection request is accepted or not.

public final PendingIntentsessionActivity

The session activity.

public final BundlesessionExtras

The session extras.

Methods
public static MediaSession.ConnectionResultaccept(SessionCommands availableSessionCommands, Player.Commands availablePlayerCommands)

Creates a connection result with the given session and player commands.

public static MediaSession.ConnectionResultreject()

Creates a MediaSession.ConnectionResult to reject a connection.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final SessionCommands DEFAULT_SESSION_COMMANDS

public static final SessionCommands DEFAULT_SESSION_AND_LIBRARY_COMMANDS

public static final Player.Commands DEFAULT_PLAYER_COMMANDS

public final boolean isAccepted

Whether the connection request is accepted or not.

public final SessionCommands availableSessionCommands

Available session commands.

public final Player.Commands availablePlayerCommands

Available player commands.

public final <any> customLayout

The custom layout or null if the custom layout of the session should be used.

public final Bundle sessionExtras

The session extras.

public final PendingIntent sessionActivity

The session activity.

Methods

public static MediaSession.ConnectionResult accept(SessionCommands availableSessionCommands, Player.Commands availablePlayerCommands)

Creates a connection result with the given session and player commands.

Commands are specific to the controller receiving this connection result.

The controller receives the custom layout of the session.

See MediaSession.ConnectionResult.AcceptedResultBuilder for a more flexible way to accept a connection.

public static MediaSession.ConnectionResult reject()

Creates a MediaSession.ConnectionResult to reject a connection.