chirpsdk / io.chirp.chirpsdk.helpers / SettingsContentObserver

SettingsContentObserver

class SettingsContentObserver

SettingsContentObserver user to observe Android AudioFocus and Volume changes in the system

Parameters

context - : Context

contentObserverHandler - : Handler - used for ContentObserver

audioFocusHandler - : Handler - used for AudioFocus

Constructors

<init>

SettingsContentObserver(context: <ERROR CLASS>, contentObserverHandler: <ERROR CLASS>, audioFocusHandler: <ERROR CLASS>)

SettingsContentObserver user to observe Android AudioFocus and Volume changes in the system

Properties

audioFocusType

var audioFocusType: <ERROR CLASS>

Valid AudioFocus types:

Functions

gainAudioFocus

fun gainAudioFocus(duration: Float): Boolean

Gain audio focus for a specific duration. Used to decrease the volume of the other audio played in the background while sending the payload.

getSystemVolume

fun getSystemVolume(): Float

Returns System volume

setSystemVolume

fun setSystemVolume(newVolume: Float): Unit

Set System volume