AudioFocusRequestCompat
public class AudioFocusRequestCompat
Compatibility version of an AudioFocusRequest.
Summary
Nested types |
|---|
public final class AudioFocusRequestCompat.BuilderBuilder class for |
Public methods |
|
|---|---|
boolean |
|
@NonNull AudioAttributesCompat |
Gets the |
@NonNull Handler |
Gets the |
int |
Gets the type of audio focus request configured for this |
@NonNull AudioManager.OnAudioFocusChangeListener |
Gets the focus change listener set for this |
int |
hashCode() |
boolean |
Gets whether the application that would use this |
Public methods
getAudioAttributesCompat
public @NonNull AudioAttributesCompat getAudioAttributesCompat()
Gets the AudioAttributesCompat set for this AudioFocusRequestCompat, or the default attributes if none were set.
| Returns | |
|---|---|
@NonNull AudioAttributesCompat |
non-null |
getFocusChangeHandler
public @NonNull Handler getFocusChangeHandler()
Gets the Handler to be used for the focus change listener.
| Returns | |
|---|---|
@NonNull Handler |
the same |
getFocusGain
public int getFocusGain()
Gets the type of audio focus request configured for this AudioFocusRequestCompat.
| Returns | |
|---|---|
int |
one of |
getOnAudioFocusChangeListener
public @NonNull AudioManager.OnAudioFocusChangeListener getOnAudioFocusChangeListener()
Gets the focus change listener set for this AudioFocusRequestCompat.
| Returns | |
|---|---|
@NonNull AudioManager.OnAudioFocusChangeListener |
The |
willPauseWhenDucked
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. |