Signal-Android/app/src/main/java/org/thoughtcrime/securesms/stories/viewer/StoryMutePolicy.kt

21 wiersze
562 B
Kotlin

package org.thoughtcrime.securesms.stories.viewer
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
import org.thoughtcrime.securesms.util.AppForegroundObserver
/**
* Stories are to start muted, and once unmuted, remain as such until the
* user backgrounds the application.
*/
object StoryMutePolicy : AppForegroundObserver.Listener {
var isContentMuted: Boolean = true
fun initialize() {
ApplicationDependencies.getAppForegroundObserver().addListener(this)
}
override fun onBackground() {
isContentMuted = true
}
}