AudioFocusRequestCompat

Added in 1.1.0
Deprecated in 1.8.0

class AudioFocusRequestCompat


Compatibility version of an AudioFocusRequest.

Summary

Nested types

This class is deprecated.

androidx.media is deprecated.

Public functions

Boolean
equals(o: Any!)

This function is deprecated. Deprecated in Java

AudioAttributesCompat

This function is deprecated. Deprecated in Java

Handler

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

AudioManager.OnAudioFocusChangeListener

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Public functions

equals

fun equals(o: Any!): Boolean

getAudioAttributesCompat

Added in 1.1.0
Deprecated in 1.8.0
fun getAudioAttributesCompat(): AudioAttributesCompat

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

getFocusChangeHandler

Added in 1.1.0
Deprecated in 1.8.0
fun getFocusChangeHandler(): Handler

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

Returns
Handler

the same Handler set in. setOnAudioFocusChangeListener.

getFocusGain

Added in 1.1.0
Deprecated in 1.8.0
fun getFocusGain(): Int

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

Value is one of the following:

  • AudioManagerCompat.AUDIOFOCUS_GAIN
  • AudioManagerCompat.AUDIOFOCUS_GAIN_TRANSIENT
  • AudioManagerCompat.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
  • AudioManagerCompat.AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE

getOnAudioFocusChangeListener

Added in 1.1.0
Deprecated in 1.8.0
fun getOnAudioFocusChangeListener(): AudioManager.OnAudioFocusChangeListener

Gets the focus change listener set for this AudioFocusRequestCompat.

hashCode

fun hashCode(): Int

willPauseWhenDucked

Added in 1.1.0
Deprecated in 1.8.0
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 O and later.

Returns
Boolean

the duck/pause behavior.