mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-23 22:17:22 +02:00
close the call instantly if it ended and the user presses the red button
This commit is contained in:
parent
ae42a735e7
commit
a9fff376ea
@ -156,13 +156,18 @@ class CallActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun endCall() {
|
private fun endCall() {
|
||||||
isCallEnded = true
|
|
||||||
CallManager.reject()
|
CallManager.reject()
|
||||||
if (proximityWakeLock?.isHeld == true) {
|
if (proximityWakeLock?.isHeld == true) {
|
||||||
proximityWakeLock!!.release()
|
proximityWakeLock!!.release()
|
||||||
}
|
}
|
||||||
|
|
||||||
audioManager.mode = AudioManager.MODE_NORMAL
|
audioManager.mode = AudioManager.MODE_NORMAL
|
||||||
|
if (isCallEnded) {
|
||||||
|
finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
isCallEnded = true
|
||||||
if (callDuration > 0) {
|
if (callDuration > 0) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
call_status_label.text = "${callDuration.getFormattedDuration()} (${getString(R.string.call_ended)})"
|
call_status_label.text = "${callDuration.getFormattedDuration()} (${getString(R.string.call_ended)})"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user