AudioFocusRequestCompat


@UnstableApi
public final class AudioFocusRequestCompat


Compatibility version of an AudioFocusRequest with fallbacks for older Android versions.

Summary

Nested types

Builder class for AudioFocusRequestCompat objects.

Public methods

AudioFocusRequestCompat.Builder

Returns new Builder with all values of this instance pre-populated.

boolean
AudioAttributes

Returns the AudioAttributes set for this AudioFocusRequestCompat, or the default attributes if none were set.

Handler

Returns the Handler to be used for the AudioManager.OnAudioFocusChangeListener.

int

Returns the type of AudioManagerCompat.AudioFocusGain configured for this AudioFocusRequestCompat.

AudioManager.OnAudioFocusChangeListener

Returns the AudioManager.OnAudioFocusChangeListener set for this AudioFocusRequestCompat.

int
boolean

Returns whether the application that would use this AudioFocusRequestCompat would pause when it is requested to duck.

Public fields

audioAttributes

public final AudioAttributes audioAttributes

focusChangeHandler

public final Handler focusChangeHandler

focusGain

@AudioManagerCompat.AudioFocusGain
public final int focusGain

onAudioFocusChangeListener

public final AudioManager.OnAudioFocusChangeListener onAudioFocusChangeListener

Public methods

buildUpon

public AudioFocusRequestCompat.Builder buildUpon()

Returns new Builder with all values of this instance pre-populated.

equals

public boolean equals(@Nullable Object o)

getAudioAttributes

public AudioAttributes getAudioAttributes()

Returns the AudioAttributes set for this AudioFocusRequestCompat, or the default attributes if none were set.

getFocusChangeHandler

public Handler getFocusChangeHandler()

Returns the Handler to be used for the AudioManager.OnAudioFocusChangeListener.

getFocusGain

@AudioManagerCompat.AudioFocusGain
public int getFocusGain()

Returns the type of AudioManagerCompat.AudioFocusGain configured for this AudioFocusRequestCompat.

hashCode

public int hashCode()

willPauseWhenDucked

public boolean willPauseWhenDucked()

Returns whether the application that would use this AudioFocusRequestCompat would pause when it is requested to duck. This value is only applicable on O and later.