public class

MediaSession.SessionResult

extends java.lang.Object

implements androidx.media2.RemoteResult, VersionedParcelable

 java.lang.Object

↳androidx.media2.MediaSession.SessionResult

Overview

Result class to be used with for asynchronous calls.

Summary

Constructors
publicSessionResult(int resultCode, Bundle customCommandResult)

Constructor to be used by MediaSession.SessionCallback.

Methods
public longgetCompletionTime()

Gets the completion time of the command.

public BundlegetCustomCommandResult()

Gets the result of MediaSession.sendCustomCommand(MediaSession.ControllerInfo, SessionCommand, Bundle).

public MediaItemgetMediaItem()

public intgetResultCode()

Gets the result code.

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

Constructors

public SessionResult(int resultCode, Bundle customCommandResult)

Constructor to be used by MediaSession.SessionCallback.

Parameters:

resultCode: result code
customCommandResult: custom command result.

Methods

public int getResultCode()

Gets the result code.

Returns:

result code

See also: RESULT_CODE_SUCCESS, RESULT_CODE_UNKNOWN_ERROR, RESULT_CODE_INVALID_STATE, RESULT_CODE_BAD_VALUE, RESULT_CODE_PERMISSION_DENIED, RESULT_CODE_IO_ERROR, RESULT_CODE_SKIPPED, RESULT_CODE_DISCONNECTED, RESULT_CODE_NOT_SUPPORTED, RESULT_CODE_AUTHENTICATION_EXPIRED, RESULT_CODE_PREMIUM_ACCOUNT_REQUIRED, RESULT_CODE_CONCURRENT_STREAM_LIMIT, RESULT_CODE_PARENTAL_CONTROL_RESTRICTED, RESULT_CODE_NOT_AVAILABLE_IN_REGION, RESULT_CODE_SKIP_LIMIT_REACHED, RESULT_CODE_SETUP_REQUIRED

public Bundle getCustomCommandResult()

Gets the result of MediaSession.sendCustomCommand(MediaSession.ControllerInfo, SessionCommand, Bundle). This is only valid when it's returned by the MediaSession.sendCustomCommand(MediaSession.ControllerInfo, SessionCommand, Bundle) and will be null otherwise.

Returns:

result of send custom command

See also: MediaSession.sendCustomCommand(MediaSession.ControllerInfo, SessionCommand, Bundle)

public long getCompletionTime()

Gets the completion time of the command. Being more specific, it's the same as when the command is completed.

Returns:

completion time of the command

public MediaItem getMediaItem()