AudioFocusRequestCompat

Added in 1.1.0
Deprecated in 1.8.0

public class AudioFocusRequestCompat


Compatibility version of an AudioFocusRequest.

Summary

Nested types

This class is deprecated.

androidx.media is deprecated.

Public methods

boolean

This method is deprecated. Deprecated in Java

@NonNull AudioAttributesCompat

This method is deprecated. Deprecated in Java

@NonNull Handler

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

@NonNull AudioManager.OnAudioFocusChangeListener

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

Public methods

equals

public boolean equals(Object o)

getAudioAttributesCompat

Added in 1.1.0
Deprecated in 1.8.0
public @NonNull AudioAttributesCompat getAudioAttributesCompat()

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
public @NonNull Handler getFocusChangeHandler()

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

Returns
@NonNull Handler

the same Handler set in. setOnAudioFocusChangeListener.

getFocusGain

Added in 1.1.0
Deprecated in 1.8.0
public int getFocusGain()

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
public @NonNull AudioManager.OnAudioFocusChangeListener getOnAudioFocusChangeListener()

Gets the focus change listener set for this AudioFocusRequestCompat.

hashCode

public int hashCode()

willPauseWhenDucked

Added in 1.1.0
Deprecated in 1.8.0
public boolean willPauseWhenDucked()

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.