From 9c302d14ae557ebff9793158a2f8a02afa8bd815 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Thu, 15 May 2025 18:03:27 +0300 Subject: [PATCH] Use toasts for no network and no hw aec notices --- .../com/tutpro/baresip/BaresipService.kt | 22 +++++-------------- .../kotlin/com/tutpro/baresip/MainActivity.kt | 6 ----- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index 4e601331..132d9f53 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -497,23 +497,11 @@ class BaresipService: Service() { ) } - val message = if (linkAddresses.isEmpty()) { - if (!aecAvailable) - '\u2022' + " " + getString(R.string.no_network) + '\n' + - '\u2022' + " " + getString(R.string.no_aec) - else - getString(R.string.no_network) - } - else - if (!aecAvailable) getString(R.string.no_aec) else "" - if (message != "") { - val newIntent = Intent(this, MainActivity::class.java) - newIntent.flags = - Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP or - Intent.FLAG_ACTIVITY_NEW_TASK - newIntent.putExtra("action", "no,$message") - startActivity(newIntent) - } + if (linkAddresses.isEmpty()) + toast(getString(R.string.no_network), Toast.LENGTH_LONG) + + if (!aecAvailable) + toast(getString(R.string.no_aec), Toast.LENGTH_LONG) } "Start Content Observer" -> { diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt index d3d80c03..56e1c25a 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt @@ -2261,12 +2261,6 @@ class MainActivity : ComponentActivity() { Log.d(TAG, "Handling intent '$action'") val ev = action.split(",") when (ev[0]) { - "no" -> { - alertTitle.value = getString(R.string.notice) - alertMessage.value = ev[1] - showAlert.value = true - return - } "call", "dial" -> { if (Call.inCall()) { Toast.makeText(applicationContext, getString(R.string.call_already_active),