AudioBecomingNoisyManager
@UnstableApi
public final class AudioBecomingNoisyManager
Utility class to detect when audio is becoming noisy.
The class must be used from a single thread. This can be the main thread as all blocking operations are internally handled on the background Looper thread provided in the constructor.
Summary
Nested types |
|---|
public interface AudioBecomingNoisyManager.ListenerListener for becoming noisy events. |
Public constructors |
|---|
AudioBecomingNoisyManager(Creates the audio becoming noisy manager. |
Public methods |
|
|---|---|
void |
setEnabled(boolean enabled)Enables the |
Public constructors
AudioBecomingNoisyManager
public AudioBecomingNoisyManager(
Context context,
Looper backgroundLooper,
Looper eventLooper,
AudioBecomingNoisyManager.Listener listener,
Clock clock
)
Creates the audio becoming noisy manager.
Public methods
setEnabled
public void setEnabled(boolean enabled)
Enables the AudioBecomingNoisyManager which calls onAudioBecomingNoisy upon receiving an intent of ACTION_AUDIO_BECOMING_NOISY.
| Parameters | |
|---|---|
boolean enabled |
True if the listener should be notified when audio is becoming noisy. |