- Made stoping of ringing simpler and more reliable.

This commit is contained in:
Juha Heinanen
2019-10-02 18:36:55 +03:00
parent 3c6ba7c95d
commit 04cf77a60f
@@ -837,15 +837,11 @@ class BaresipService: Service() {
} }
private fun stopRinging() { private fun stopRinging() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.P) && (rtTimer != null)) {
if (rt.isPlaying) rt.stop()
} else {
if (rtTimer != null) {
rtTimer!!.cancel() rtTimer!!.cancel()
rtTimer = null rtTimer = null
if (rt.isPlaying) rt.stop()
}
} }
rt.stop()
abandonAudioFocus() abandonAudioFocus()
} }