@UnstableApi
public final class SessionError


Provides information about a session error.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation SessionError.Code

Info and error result codes.

Constants

static final int

Error code representing that an argument is illegal.

static final int

Error code representing that the command cannot be completed because the current state is not valid for the command.

static final int

Error code representing that a file or network related error happened.

static final int

Error code representing that the command is not supported.

static final int

Error code representing that the command is not allowed.

static final int

Error code representing that the authentication has expired.

static final int

Error code representing that too many concurrent streams are detected.

static final int

Error code representing that the requested content is already playing.

static final int

Error code representing that the session and controller were disconnected.

static final int

Error code representing that navigation failed because the the playlist was exhausted.

static final int

Error code representing that the content is blocked due to being regionally unavailable.

static final int

Error code representing that the content is blocked due to parental controls.

static final int

Error code representing that a premium account is required.

static final int

Error code representing that the session needs user's manual intervention.

static final int

Error code representing that the application cannot skip any more because the skip limit is reached.

static final int

Error code representing that the command is ended with an unknown error.

static final int

Info code representing that the command was cancelled.

Public constructors

SessionError(@SessionError.Code int code, String message)

Creates an instance with an empty extras bundle.

SessionError(@SessionError.Code int code, String message, Bundle extras)

Creates an instance.

Public methods

boolean

Checks the given error for equality while ignoring extras.

static SessionError

Restores a SessionError from a Bundle.

static String

Returns the name of a given error code.

int
Bundle

Returns a Bundle representing the information stored in this object.

Constants

ERROR_BAD_VALUE

public static final int ERROR_BAD_VALUE = -3

Error code representing that an argument is illegal.

ERROR_INVALID_STATE

public static final int ERROR_INVALID_STATE = -2

Error code representing that the command cannot be completed because the current state is not valid for the command.

ERROR_IO

public static final int ERROR_IO = -5

Error code representing that a file or network related error happened.

ERROR_NOT_SUPPORTED

public static final int ERROR_NOT_SUPPORTED = -6

Error code representing that the command is not supported.

ERROR_PERMISSION_DENIED

public static final int ERROR_PERMISSION_DENIED = -4

Error code representing that the command is not allowed.

ERROR_SESSION_AUTHENTICATION_EXPIRED

public static final int ERROR_SESSION_AUTHENTICATION_EXPIRED = -102

Error code representing that the authentication has expired.

ERROR_SESSION_CONCURRENT_STREAM_LIMIT

public static final int ERROR_SESSION_CONCURRENT_STREAM_LIMIT = -104

Error code representing that too many concurrent streams are detected.

ERROR_SESSION_CONTENT_ALREADY_PLAYING

public static final int ERROR_SESSION_CONTENT_ALREADY_PLAYING = -110

Error code representing that the requested content is already playing.

ERROR_SESSION_DISCONNECTED

public static final int ERROR_SESSION_DISCONNECTED = -100

Error code representing that the session and controller were disconnected.

ERROR_SESSION_END_OF_PLAYLIST

public static final int ERROR_SESSION_END_OF_PLAYLIST = -109

Error code representing that navigation failed because the the playlist was exhausted.

ERROR_SESSION_NOT_AVAILABLE_IN_REGION

public static final int ERROR_SESSION_NOT_AVAILABLE_IN_REGION = -106

Error code representing that the content is blocked due to being regionally unavailable.

ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED

public static final int ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED = -105

Error code representing that the content is blocked due to parental controls.

ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED

public static final int ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103

Error code representing that a premium account is required.

ERROR_SESSION_SETUP_REQUIRED

public static final int ERROR_SESSION_SETUP_REQUIRED = -108

Error code representing that the session needs user's manual intervention.

ERROR_SESSION_SKIP_LIMIT_REACHED

public static final int ERROR_SESSION_SKIP_LIMIT_REACHED = -107

Error code representing that the application cannot skip any more because the skip limit is reached.

ERROR_UNKNOWN

public static final int ERROR_UNKNOWN = -1

Error code representing that the command is ended with an unknown error.

INFO_CANCELLED

public static final int INFO_CANCELLED = 1

Info code representing that the command was cancelled.

Public fields

code

@SessionError.Code
public int code

extras

public Bundle extras

message

public String message

Public constructors

SessionError

public SessionError(@SessionError.Code int code, String message)

Creates an instance with an empty extras bundle.

Parameters
@SessionError.Code int code

The error result code.

String message

The error message.

Throws
java.lang.IllegalArgumentException

if the result code is not an error result code.

SessionError

public SessionError(@SessionError.Code int code, String message, Bundle extras)

Creates an instance.

Parameters
@SessionError.Code int code

The error result code.

String message

The error message.

Bundle extras

The error extras.

Throws
java.lang.IllegalArgumentException

if the result code is not an error result code.

Public methods

equals

public boolean equals(@Nullable Object o)

Checks the given error for equality while ignoring extras.

fromBundle

public static SessionError fromBundle(Bundle bundle)

Restores a SessionError from a Bundle.

getErrorCodeName

public static String getErrorCodeName(@SessionError.Code int errorCode)

Returns the name of a given error code.

hashCode

public int hashCode()

toBundle

public Bundle toBundle()

Returns a Bundle representing the information stored in this object.