Added already active call test

This commit is contained in:
Juha Heinanen
2026-01-14 04:42:38 +02:00
parent b3cb2ff413
commit 8ee2a4b3e5

View File

@ -238,7 +238,7 @@ private fun MainScreen(
if (uas.value.isNotEmpty()) { if (uas.value.isNotEmpty()) {
if (viewModel.selectedAor.value == "") { if (viewModel.selectedAor.value == "") {
if (Call.inCall()) if (Call.inCall())
spinToAor(viewModel, Call.calls()[0].ua.account.aor) spinToAor(viewModel, Call.calls().last().ua.account.aor)
else else
spinToAor(viewModel, uas.value.first().account.aor) spinToAor(viewModel, uas.value.first().account.aor)
} }
@ -2002,6 +2002,8 @@ private fun makeCall(ctx: Context, viewModel: ViewModel, uriText: String, confer
} }
else if (!BaresipService.requestAudioFocus(ctx)) else if (!BaresipService.requestAudioFocus(ctx))
Toast.makeText(ctx, R.string.audio_focus_denied, Toast.LENGTH_SHORT).show() Toast.makeText(ctx, R.string.audio_focus_denied, Toast.LENGTH_SHORT).show()
else if (Call.calls().any { it.ua.account.aor != ua.account.aor })
Toast.makeText(ctx, R.string.call_already_active, Toast.LENGTH_SHORT).show()
else { else {
viewModel.dialerState.callButtonsEnabled.value = false viewModel.dialerState.callButtonsEnabled.value = false
if (Build.VERSION.SDK_INT < 31) { if (Build.VERSION.SDK_INT < 31) {