The Android Developer Challenge is back! Submit your idea before December 2.

AudioFocusRequestCompat

open class AudioFocusRequestCompat
kotlin.Any
   ↳ androidx.media.AudioFocusRequestCompat

Compatibility version of an AudioFocusRequest.

Summary

Nested classes

Builder class for AudioFocusRequestCompat objects.

Public methods

open Boolean
equals(other: Any?)

open AudioAttributesCompat

Gets the AudioAttributesCompat set for this AudioFocusRequestCompat, or the default attributes if none were set.

open Handler

Gets the Handler to be used for the focus change listener.

open Int

Gets the type of audio focus request configured for this AudioFocusRequestCompat.

open OnAudioFocusChangeListener

Gets the focus change listener set for this AudioFocusRequestCompat.

open Int

open Boolean

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

Public methods

equals

open fun equals(other: Any?): Boolean

getAudioAttributesCompat

@NonNull open fun getAudioAttributesCompat(): AudioAttributesCompat

Gets the AudioAttributesCompat set for this AudioFocusRequestCompat, or the default attributes if none were set.

Return
AudioAttributesCompat: non-null AudioAttributesCompat.

getFocusChangeHandler

@NonNull open fun getFocusChangeHandler(): Handler

Gets the Handler to be used for the focus change listener.

Return
Handler: the same Handler set in. .

getFocusGain

open fun getFocusGain(): Int

Gets the type of audio focus request configured for this AudioFocusRequestCompat.

Return
Int: one of AudioManagerCompat#AUDIOFOCUS_GAIN, , , and .

getOnAudioFocusChangeListener

@NonNull open fun getOnAudioFocusChangeListener(): OnAudioFocusChangeListener

Gets the focus change listener set for this AudioFocusRequestCompat.

Return
OnAudioFocusChangeListener: The AudioManager.OnAudioFocusChangeListener that was set.

hashCode

open fun hashCode(): Int

willPauseWhenDucked

open fun willPauseWhenDucked(): Boolean

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

Return
Boolean: the duck/pause behavior.