From 2c7335b86564651a67aaed1cfee7d428da95d51c Mon Sep 17 00:00:00 2001 From: Naveen Date: Sat, 22 Oct 2022 02:29:22 +0530 Subject: [PATCH] Remove disconnected calls manually A single disconnected but not removed call can cause false in-call state with in the app causing CallActivity to finish instantly even when there are no real active calls. --- .../kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index f86f09ab..f04fc064 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -109,6 +109,9 @@ class CallManager { listener.onStateChanged() } } + + // remove all disconnected calls manually in case they are still here + calls.removeAll { it.getStateCompat() == Call.STATE_DISCONNECTED } } fun getPrimaryCall(): Call? {