From 660048853bfde3c23881723704e6341838477071 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Tue, 5 Oct 2021 16:16:11 +0300 Subject: [PATCH] Always try to stop ringtone when stopRinging is called --- .../main/kotlin/com/tutpro/baresip/BaresipService.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index b56bcf04..3badfc8b 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -1107,14 +1107,13 @@ class BaresipService: Service() { } private fun stopRinging() { - if (am.mode == AudioManager.MODE_RINGTONE) { + if (am.mode == AudioManager.MODE_RINGTONE) abandonAudioFocus() - if ((VERSION.SDK_INT < 28) && (rtTimer != null)) { - rtTimer!!.cancel() - rtTimer = null - } - rt.stop() + if ((VERSION.SDK_INT < 28) && (rtTimer != null)) { + rtTimer!!.cancel() + rtTimer = null } + rt.stop() } private fun setCallVolume() {