From bca39aa1b0825c711a0618593a36153169e1d96e Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Mon, 6 Apr 2026 11:53:50 +0300 Subject: [PATCH] Removed unused service event and call status, renamed service event --- .../main/kotlin/com/tutpro/baresip/ConnectionService.kt | 5 ++++- app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/ConnectionService.kt b/app/src/main/kotlin/com/tutpro/baresip/ConnectionService.kt index a59ae824..2e85a508 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ConnectionService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ConnectionService.kt @@ -195,7 +195,10 @@ class ConnectionService : ConnectionService() { } val isSpeaker = it.route == CallAudioState.ROUTE_SPEAKER BaresipService.postServiceEvent( - ServiceEvent("speaker,${isSpeaker}", arrayListOf(uap, callp), System.nanoTime()) + ServiceEvent("speaker update,${isSpeaker}", + arrayListOf(uap, callp), + System.nanoTime() + ) ) } } diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt index 474c159a..58410030 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt @@ -2180,7 +2180,7 @@ private fun showCall(ctx: Context, viewModel: ViewModel, ua: UserAgent?, showCal } Log.d(TAG, "Showing call ${call.callp} from ${call.ua.account.aor} with status ${call.status.value}") when (call.status.value) { - "outgoing", "transferring", "answered", "disconnecting" -> { + "outgoing", "transferring", "answered" -> { call.callUriLabel.value = if (call.status.value == "answered") ctx.getString(R.string.incoming_call_from_dots) else @@ -2347,9 +2347,6 @@ fun handleServiceEvent(ctx: Context, viewModel: ViewModel, event: String, params "call update" -> { showCall(ctx, viewModel, ua) } - "update calls" -> { - viewModel.updateCalls(Call.calls().toList()) - } "call verify" -> { val callp = params[1] as Long val call = Call.ofCallp(callp) @@ -2475,7 +2472,7 @@ fun handleServiceEvent(ctx: Context, viewModel: ViewModel, event: String, params else viewModel.updateMicIcon(Icons.Filled.Mic) } - "speaker" -> { + "speaker update" -> { viewModel.updateSpeakerPhoneStatus(ev[1].toBoolean()) } else -> Log.e(TAG, "Unknown event '${ev[0]}'")