Fixed bug in checking if call already exists

This commit is contained in:
Juha Heinanen
2026-04-02 19:04:08 +03:00
parent eb52a1a8d3
commit 91f28f03df
5 changed files with 27 additions and 17 deletions
@@ -801,7 +801,7 @@ class BaresipService: Service() {
"incoming call" -> {
val peerUri = ev[1]
val bevent = ev[2].toLong()
val toastMsg = if (Call.isAnyCallActive(applicationContext))
val toastMsg = if (Utils.isAnyCallActive(applicationContext))
String.format(getString(R.string.call_auto_rejected),
Utils.friendlyUri(this, peerUri, ua.account))
else if (ua.account.blockUnknown && Contact.contactName(peerUri) == peerUri)
@@ -1541,8 +1541,7 @@ class BaresipService: Service() {
@SuppressLint("WakelockTimeout")
private fun updatePartialWakeLock() {
val isAnyUaActive = uasStatus.value.values.any { it != R.drawable.circle_white }
val isAnyCallActive = calls.isNotEmpty()
val needsToStayAwake = isAnyUaActive || isAnyCallActive
val needsToStayAwake = isAnyUaActive || calls.isNotEmpty()
try {
if (needsToStayAwake) {
if (!partialWakeLock.isHeld) {