# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# TrackChangeEvent.Builder

`public static final class TrackChangeEvent.Builder`
`extends Object` ``

java.lang.Object
↳ | android.media.metrics.TrackChangeEvent.Builder

A builder for `TrackChangeEvent`

## Summary

### Public constructors
`Builder(int type)` Creates a new Builder.

### Public methods
`TrackChangeEvent` | `build()` Builds the instance.
`TrackChangeEvent.Builder` | `setAudioSampleRate(int value)` Sets sample rate.
`TrackChangeEvent.Builder` | `setBitrate(int value)` Sets bitrate in bits per second.
`TrackChangeEvent.Builder` | `setChannelCount(int value)` Sets channel count.
`TrackChangeEvent.Builder` | `setCodecName(String value)` Sets codec name.
`TrackChangeEvent.Builder` | `setContainerMimeType(String value)` Sets container MIME type.
`TrackChangeEvent.Builder` | `setHeight(int value)` Sets video height.
`TrackChangeEvent.Builder` | `setLanguage(String value)` Sets language code.
`TrackChangeEvent.Builder` | `setLanguageRegion(String value)` Sets language region code.
`TrackChangeEvent.Builder` | `setMetricsBundle(Bundle metricsBundle)` Sets metrics-related information that is not supported by dedicated methods.
`TrackChangeEvent.Builder` | `setSampleMimeType(String value)` Sets the MIME type of the video/audio/text samples.
`TrackChangeEvent.Builder` | `setTimeSinceCreatedMillis(long value)` Sets timestamp since the creation in milliseconds.
`TrackChangeEvent.Builder` | `setTrackChangeReason(int value)` Sets track change reason.
`TrackChangeEvent.Builder` | `setTrackState(int value)` Sets track state.
`TrackChangeEvent.Builder` | `setVideoFrameRate(float value)` Sets video frame rate.
`TrackChangeEvent.Builder` | `setWidth(int value)` Sets video width.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder (int type)

Creates a new Builder.

Parameters
`type` | `int`: the track type. It must be one of `TrackChangeEvent.TRACK_TYPE_AUDIO`, `TrackChangeEvent.TRACK_TYPE_VIDEO`, `TrackChangeEvent.TRACK_TYPE_TEXT`. Value is `TrackChangeEvent.TRACK_TYPE_AUDIO`, `TrackChangeEvent.TRACK_TYPE_VIDEO`, or `TrackChangeEvent.TRACK_TYPE_TEXT`

## Public methods

### build

    public TrackChangeEvent build ()

Builds the instance. This builder should not be touched after calling this!

Returns
`TrackChangeEvent` | This value cannot be `null`.

### setAudioSampleRate

    public TrackChangeEvent.Builder setAudioSampleRate (int value)

Sets sample rate.

Parameters
`value` | `int`: the sample rate. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setBitrate

    public TrackChangeEvent.Builder setBitrate (int value)

Sets bitrate in bits per second.

Parameters
`value` | `int`: the bitrate in bits per second. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setChannelCount

    public TrackChangeEvent.Builder setChannelCount (int value)

Sets channel count.

Parameters
`value` | `int`: the channel count. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setCodecName

    public TrackChangeEvent.Builder setCodecName (String value)

Sets codec name.

Parameters
`value` | `String`: This value cannot be `null`.

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setContainerMimeType

    public TrackChangeEvent.Builder setContainerMimeType (String value)

Sets container MIME type.

Parameters
`value` | `String`: This value cannot be `null`.

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setHeight

    public TrackChangeEvent.Builder setHeight (int value)

Sets video height.

Parameters
`value` | `int`: the video height. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setLanguage

    public TrackChangeEvent.Builder setLanguage (String value)

Sets language code.

Parameters
`value` | `String`: a two-letter ISO 639-1 language code. This value cannot be `null`.

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setLanguageRegion

    public TrackChangeEvent.Builder setLanguageRegion (String value)

Sets language region code.

Parameters
`value` | `String`: an IETF BCP 47 optional language region subtag based on a two-letter country code. This value cannot be `null`.

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setMetricsBundle

    public TrackChangeEvent.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
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setSampleMimeType

    public TrackChangeEvent.Builder setSampleMimeType (String value)

Sets the MIME type of the video/audio/text samples.

Parameters
`value` | `String`: This value cannot be `null`.

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setTimeSinceCreatedMillis

    public TrackChangeEvent.Builder setTimeSinceCreatedMillis (long value)

Sets timestamp since the 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
`TrackChangeEvent.Builder` | This value cannot be `null`.

See also:

- `TrackChangeEvent.getTimeSinceCreatedMillis()`

### setTrackChangeReason

    public TrackChangeEvent.Builder setTrackChangeReason (int value)

Sets track change reason.

Parameters
`value` | `int`: Value is `TrackChangeEvent.TRACK_CHANGE_REASON_UNKNOWN`, `TrackChangeEvent.TRACK_CHANGE_REASON_OTHER`, `TrackChangeEvent.TRACK_CHANGE_REASON_INITIAL`, `TrackChangeEvent.TRACK_CHANGE_REASON_MANUAL`, or `TrackChangeEvent.TRACK_CHANGE_REASON_ADAPTIVE`

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setTrackState

    public TrackChangeEvent.Builder setTrackState (int value)

Sets track state.

Parameters
`value` | `int`: Value is `TrackChangeEvent.TRACK_STATE_OFF`, or `TrackChangeEvent.TRACK_STATE_ON`

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setVideoFrameRate

    public TrackChangeEvent.Builder setVideoFrameRate (float value)

Sets video frame rate.

Parameters
`value` | `float`: the video frame rate. -1 indicates the value is unknown. Value is between -1 and Float.MAX_VALUE inclusive

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

### setWidth

    public TrackChangeEvent.Builder setWidth (int value)

Sets video width.

Parameters
`value` | `int`: the video width. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive

Returns
`TrackChangeEvent.Builder` | This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*