- 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

View File

@ -837,15 +837,11 @@ class BaresipService: Service() {
}
private fun stopRinging() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
if (rt.isPlaying) rt.stop()
} else {
if (rtTimer != null) {
rtTimer!!.cancel()
rtTimer = null
if (rt.isPlaying) rt.stop()
}
if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.P) && (rtTimer != null)) {
rtTimer!!.cancel()
rtTimer = null
}
rt.stop()
abandonAudioFocus()
}