SessionError
public final class SessionError
Provides information about a session error.
Summary
Nested types |
|---|
@UnstableApiInfo and error result codes. |
Constants |
|
|---|---|
static final int |
ERROR_BAD_VALUE = -3Error code representing that an argument is illegal. |
static final int |
ERROR_INVALID_STATE = -2Error code representing that the command cannot be completed because the current state is not valid for the command. |
static final int |
ERROR_IO = -5Error code representing that a file or network related error happened. |
static final int |
ERROR_NOT_SUPPORTED = -6Error 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_SESSION_DISCONNECTED = -100Error code representing that the session and controller were disconnected. |
static final int |
Error code representing that navigation failed because 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_SESSION_SETUP_REQUIRED = -108Error 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_UNKNOWN = -1Error code representing that the command is ended with an unknown error. |
static final int |
INFO_CANCELLED = 1Info code representing that the command was cancelled. |
Public constructors |
|---|
@UnstableApiCreates an instance with |
@UnstableApiCreates an instance. |
Public methods |
|
|---|---|
boolean |
Checks the given error for equality while ignoring |
static SessionError |
@UnstableApiRestores a |
static String |
@UnstableApiReturns the name of a given error code. |
int |
|
Bundle |
Returns a |
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
@UnstableApi
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
@UnstableApi
public static final int ERROR_SESSION_END_OF_PLAYLIST = -109
Error code representing that navigation failed because 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
Public constructors
SessionError
@UnstableApi
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
@UnstableApi
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
@UnstableApi
public boolean equals(@Nullable Object o)
Checks the given error for equality while ignoring extras.
fromBundle
@UnstableApi
public static SessionError fromBundle(Bundle bundle)
Restores a SessionError from a Bundle.
getErrorCodeName
@UnstableApi
public static String getErrorCodeName(@SessionError.Code int errorCode)
Returns the name of a given error code.
toBundle
@UnstableApi
public Bundle toBundle()
Returns a Bundle representing the information stored in this object.