PlaybackErrorEvent.Builder

public static final class PlaybackErrorEvent.Builder
extends Object

java.lang.Object
   ↳ android.media.metrics.PlaybackErrorEvent.Builder


A builder for PlaybackErrorEvent

Summary

Public constructors

Builder()

Creates a new Builder.

Public methods

PlaybackErrorEvent build()

Builds the instance.

PlaybackErrorEvent.Builder setErrorCode(int value)

Sets error code.

PlaybackErrorEvent.Builder setException(Exception value)

Sets the Exception object.

PlaybackErrorEvent.Builder setMetricsBundle(Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

PlaybackErrorEvent.Builder setSubErrorCode(int value)

Sets sub error code.

PlaybackErrorEvent.Builder setTimeSinceCreatedMillis(long value)

Set the timestamp since creation in milliseconds.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder ()

Creates a new Builder.

Public methods

build

Added in API level 31
public PlaybackErrorEvent build ()

Builds the instance.

Returns
PlaybackErrorEvent This value cannot be null.

setErrorCode

Added in API level 31
public PlaybackErrorEvent.Builder setErrorCode (int value)

Sets error code.

Parameters
value int: Value is PlaybackErrorEvent.ERROR_UNKNOWN, PlaybackErrorEvent.ERROR_OTHER, PlaybackErrorEvent.ERROR_RUNTIME, PlaybackErrorEvent.ERROR_IO_NETWORK_UNAVAILABLE, PlaybackErrorEvent.ERROR_IO_NETWORK_CONNECTION_FAILED, PlaybackErrorEvent.ERROR_IO_BAD_HTTP_STATUS, PlaybackErrorEvent.ERROR_IO_DNS_FAILED, PlaybackErrorEvent.ERROR_IO_CONNECTION_TIMEOUT, PlaybackErrorEvent.ERROR_IO_CONNECTION_CLOSED, PlaybackErrorEvent.ERROR_IO_OTHER, PlaybackErrorEvent.ERROR_PARSING_MANIFEST_MALFORMED, PlaybackErrorEvent.ERROR_PARSING_CONTAINER_MALFORMED, PlaybackErrorEvent.ERROR_PARSING_OTHER, PlaybackErrorEvent.ERROR_DECODER_INIT_FAILED, PlaybackErrorEvent.ERROR_DECODING_FAILED, PlaybackErrorEvent.ERROR_DECODING_FORMAT_EXCEEDS_CAPABILITIES, PlaybackErrorEvent.ERROR_DECODING_OTHER, PlaybackErrorEvent.ERROR_AUDIO_TRACK_INIT_FAILED, PlaybackErrorEvent.ERROR_AUDIO_TRACK_WRITE_FAILED, PlaybackErrorEvent.ERROR_AUDIO_TRACK_OTHER, PlaybackErrorEvent.ERROR_PLAYER_REMOTE, PlaybackErrorEvent.ERROR_PLAYER_BEHIND_LIVE_WINDOW, PlaybackErrorEvent.ERROR_PLAYER_OTHER, PlaybackErrorEvent.ERROR_DRM_SCHEME_UNSUPPORTED, PlaybackErrorEvent.ERROR_DRM_PROVISIONING_FAILED, PlaybackErrorEvent.ERROR_DRM_LICENSE_ACQUISITION_FAILED, PlaybackErrorEvent.ERROR_DRM_DISALLOWED_OPERATION, PlaybackErrorEvent.ERROR_DRM_SYSTEM_ERROR, PlaybackErrorEvent.ERROR_DRM_CONTENT_ERROR, PlaybackErrorEvent.ERROR_DRM_DEVICE_REVOKED, PlaybackErrorEvent.ERROR_DRM_OTHER, PlaybackErrorEvent.ERROR_IO_FILE_NOT_FOUND, PlaybackErrorEvent.ERROR_IO_NO_PERMISSION, PlaybackErrorEvent.ERROR_PARSING_MANIFEST_UNSUPPORTED, PlaybackErrorEvent.ERROR_PARSING_CONTAINER_UNSUPPORTED, or PlaybackErrorEvent.ERROR_DECODING_FORMAT_UNSUPPORTED

Returns
PlaybackErrorEvent.Builder This value cannot be null.

setException

Added in API level 31
public PlaybackErrorEvent.Builder setException (Exception value)

Sets the Exception object.

Parameters
value Exception: This value cannot be null.

Returns
PlaybackErrorEvent.Builder This value cannot be null.

setMetricsBundle

Added in API level 31
public PlaybackErrorEvent.Builder setMetricsBundle (Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

It is intended to be used for backwards compatibility by the metrics infrastructure.

Parameters
metricsBundle Bundle: This value cannot be null.

Returns
PlaybackErrorEvent.Builder This value cannot be null.

setSubErrorCode

Added in API level 31
public PlaybackErrorEvent.Builder setSubErrorCode (int value)

Sets sub error code.

Parameters
value int: Value is between Integer.MIN_VALUE and Integer.MAX_VALUE inclusive

Returns
PlaybackErrorEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

Added in API level 31
public PlaybackErrorEvent.Builder setTimeSinceCreatedMillis (long value)

Set the timestamp since creation in milliseconds.

Parameters
value long: the timestamp since the creation in milliseconds. -1 indicates the value is unknown. Value is -1 or greater

Returns
PlaybackErrorEvent.Builder This value cannot be null.