SessionCommandGroup2

class SessionCommandGroup2
kotlin.Any
   ↳ androidx.media.SessionCommandGroup2

A set of SessionCommand2 which represents a command group.

Summary

Public constructors

Default Constructor.

Creates a new SessionCommandGroup2 with commands copied from another object.

Public methods
Unit

Adds a command to this command group.

Unit
addCommand(commandCode: Int)

Adds a predefined command with given commandCode to this command group.

Unit

Removes a command from this group which matches given command.

Unit
removeCommand(commandCode: Int)

Removes a command from this group which matches given commandCode.

Boolean

Checks whether this command group has a command that matches given command.

Boolean
hasCommand(commandCode: Int)

Checks whether this command group has a command that matches given commandCode.

MutableSet<SessionCommand2!>

Gets all commands of this command group.

Unit

Adds all predefined commands to this command group.

Public constructors

<init>

SessionCommandGroup2()

Default Constructor.

<init>

SessionCommandGroup2(other: SessionCommandGroup2?)

Creates a new SessionCommandGroup2 with commands copied from another object.

Parameters
other SessionCommandGroup2?: The SessionCommandGroup2 instance to copy.

Public methods

addCommand

fun addCommand(command: SessionCommand2): Unit

Adds a command to this command group.

Parameters
command SessionCommand2: A command to add. Shouldn't be null.

addCommand

fun addCommand(commandCode: Int): Unit

Adds a predefined command with given commandCode to this command group.

Parameters
commandCode Int: A command code to add. Shouldn't be SessionCommand2#COMMAND_CODE_CUSTOM.

removeCommand

fun removeCommand(command: SessionCommand2): Unit

Removes a command from this group which matches given command.

Parameters
command SessionCommand2: A command to find. Shouldn't be null.

removeCommand

fun removeCommand(commandCode: Int): Unit

Removes a command from this group which matches given commandCode.

Parameters
commandCode Int: A command code to find. Shouldn't be SessionCommand2#COMMAND_CODE_CUSTOM.

hasCommand

fun hasCommand(command: SessionCommand2): Boolean

Checks whether this command group has a command that matches given command.

Parameters
command SessionCommand2: A command to find. Shouldn't be null.

hasCommand

fun hasCommand(commandCode: Int): Boolean

Checks whether this command group has a command that matches given commandCode.

Parameters
commandCode Int: A command code to find. Shouldn't be SessionCommand2#COMMAND_CODE_CUSTOM.

getCommands

fun getCommands(): MutableSet<SessionCommand2!>

Gets all commands of this command group.

addAllPredefinedCommands

fun addAllPredefinedCommands(): Unit

Adds all predefined commands to this command group.