close the call instantly if it ended and the user presses the red button

This commit is contained in:
tibbi 2020-05-01 18:33:50 +02:00
parent ae42a735e7
commit a9fff376ea

View File

@ -156,13 +156,18 @@ class CallActivity : SimpleActivity() {
}
private fun endCall() {
isCallEnded = true
CallManager.reject()
if (proximityWakeLock?.isHeld == true) {
proximityWakeLock!!.release()
}
audioManager.mode = AudioManager.MODE_NORMAL
if (isCallEnded) {
finish()
return
}
isCallEnded = true
if (callDuration > 0) {
runOnUiThread {
call_status_label.text = "${callDuration.getFormattedDuration()} (${getString(R.string.call_ended)})"