Use toasts for no network and no hw aec notices

This commit is contained in:
Juha Heinanen
2025-05-15 18:03:27 +03:00
parent 387ea318bb
commit 9c302d14ae
2 changed files with 5 additions and 23 deletions
@@ -497,23 +497,11 @@ class BaresipService: Service() {
) )
} }
val message = if (linkAddresses.isEmpty()) { if (linkAddresses.isEmpty())
if (!aecAvailable) toast(getString(R.string.no_network), Toast.LENGTH_LONG)
'\u2022' + " " + getString(R.string.no_network) + '\n' +
'\u2022' + " " + getString(R.string.no_aec) if (!aecAvailable)
else toast(getString(R.string.no_aec), Toast.LENGTH_LONG)
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)
}
} }
"Start Content Observer" -> { "Start Content Observer" -> {
@@ -2261,12 +2261,6 @@ class MainActivity : ComponentActivity() {
Log.d(TAG, "Handling intent '$action'") Log.d(TAG, "Handling intent '$action'")
val ev = action.split(",") val ev = action.split(",")
when (ev[0]) { when (ev[0]) {
"no" -> {
alertTitle.value = getString(R.string.notice)
alertMessage.value = ev[1]
showAlert.value = true
return
}
"call", "dial" -> { "call", "dial" -> {
if (Call.inCall()) { if (Call.inCall()) {
Toast.makeText(applicationContext, getString(R.string.call_already_active), Toast.makeText(applicationContext, getString(R.string.call_already_active),