AudioFocusRequestCompat
public
class
AudioFocusRequestCompat
extends Object
java.lang.Object | |
↳ | androidx.media.AudioFocusRequestCompat |
Compatibility version of an AudioFocusRequest
.
Summary
Nested classes | |
---|---|
class |
AudioFocusRequestCompat.Builder
Builder class for |
Public methods | |
---|---|
boolean
|
equals(Object o)
|
AudioAttributesCompat
|
getAudioAttributesCompat()
Gets the |
Handler
|
getFocusChangeHandler()
Gets the |
int
|
getFocusGain()
Gets the type of audio focus request configured for this |
AudioManager.OnAudioFocusChangeListener
|
getOnAudioFocusChangeListener()
Gets the focus change listener set for this |
int
|
hashCode()
|
boolean
|
willPauseWhenDucked()
Gets whether the application that would use this |
Inherited methods | |
---|---|
Public methods
equals
public boolean equals (Object o)
Parameters | |
---|---|
o |
Object |
Returns | |
---|---|
boolean |
getAudioAttributesCompat
public AudioAttributesCompat getAudioAttributesCompat ()
Gets the AudioAttributesCompat
set for this AudioFocusRequestCompat
, or the
default attributes if none were set.
Returns | |
---|---|
AudioAttributesCompat |
non-null AudioAttributesCompat .
|
getFocusChangeHandler
public Handler getFocusChangeHandler ()
Gets the Handler
to be used for the focus change listener.
Returns | |
---|---|
Handler |
the same Handler set in. AudioFocusRequestCompat.Builder.setOnAudioFocusChangeListener(OnAudioFocusChangeListener, Handler) .
|
getFocusGain
public int getFocusGain ()
Gets the type of audio focus request configured for this AudioFocusRequestCompat
.
getOnAudioFocusChangeListener
public AudioManager.OnAudioFocusChangeListener getOnAudioFocusChangeListener ()
Gets the focus change listener set for this AudioFocusRequestCompat
.
Returns | |
---|---|
AudioManager.OnAudioFocusChangeListener |
The AudioManager.OnAudioFocusChangeListener that was set.
|
hashCode
public int hashCode ()
Returns | |
---|---|
int |
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 Build.VERSION_CODES.O
and later.
Returns | |
---|---|
boolean |
the duck/pause behavior. |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.