mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 04:08:44 +03:00
Call: fix outgoing ring issue
This commit is contained in:
parent
4518962658
commit
26d2694301
1 changed files with 2 additions and 7 deletions
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue