Currently mic icon is active only when a call is connected

This commit is contained in:
Juha Heinanen
2021-12-03 15:16:12 +02:00
parent 4a483afdc1
commit 0d770b6f57

View File

@ -1147,13 +1147,15 @@ class MainActivity : AppCompatActivity() {
when (item.itemId) {
R.id.micIcon -> {
BaresipService.isMicMuted = !BaresipService.isMicMuted
if (BaresipService.isMicMuted) {
item.setIcon(R.drawable.mic_off)
Api.calls_mute(true)
} else {
item.setIcon(R.drawable.mic_on)
Api.calls_mute(false)
if (Call.call("connected") != null) {
BaresipService.isMicMuted = !BaresipService.isMicMuted
if (BaresipService.isMicMuted) {
item.setIcon(R.drawable.mic_off)
Api.calls_mute(true)
} else {
item.setIcon(R.drawable.mic_on)
Api.calls_mute(false)
}
}
}
@ -1672,6 +1674,10 @@ class MainActivity : AppCompatActivity() {
rejectButton.visibility = View.INVISIBLE
callControl.visibility = View.INVISIBLE
dialpadButton.isEnabled = true
if (BaresipService.isMicMuted) {
BaresipService.isMicMuted = false
micIcon!!.setIcon(R.drawable.mic_on)
}
} else {
swipeRefresh.isEnabled = false
val call = Call.uaCalls(ua, "")[0]