Call: fix outgoing ring issue

This commit is contained in:
ganfra 2021-08-26 11:44:29 +02:00
parent 4518962658
commit 26d2694301

View file

@ -98,13 +98,10 @@ class CallRingPlayerOutgoing(
private var player: MediaPlayer? = null
fun start() {
val audioManager: AudioManager? = applicationContext.getSystemService()
applicationContext.getSystemService<AudioManager>()?.mode = AudioManager.MODE_IN_COMMUNICATION
player?.release()
player = createPlayer()
// Check if sound is enabled
val ringerMode = audioManager?.ringerMode
if (player != null && ringerMode == AudioManager.RINGER_MODE_NORMAL) {
if (player != null) {
try {
if (player?.isPlaying == false) {
player?.start()
@ -116,8 +113,6 @@ class CallRingPlayerOutgoing(
Timber.e(failure, "## VOIP Failed to start ringing outgoing")
player = null
}
} else {
Timber.v("## VOIP Can't play $player ode $ringerMode")
}
}