Currently mic icon is active only when a call is connected
This commit is contained in:
@@ -1147,6 +1147,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
|
|
||||||
R.id.micIcon -> {
|
R.id.micIcon -> {
|
||||||
|
if (Call.call("connected") != null) {
|
||||||
BaresipService.isMicMuted = !BaresipService.isMicMuted
|
BaresipService.isMicMuted = !BaresipService.isMicMuted
|
||||||
if (BaresipService.isMicMuted) {
|
if (BaresipService.isMicMuted) {
|
||||||
item.setIcon(R.drawable.mic_off)
|
item.setIcon(R.drawable.mic_off)
|
||||||
@@ -1156,6 +1157,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Api.calls_mute(false)
|
Api.calls_mute(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
R.id.speakerIcon -> {
|
R.id.speakerIcon -> {
|
||||||
am.isSpeakerphoneOn = !am.isSpeakerphoneOn
|
am.isSpeakerphoneOn = !am.isSpeakerphoneOn
|
||||||
@@ -1672,6 +1674,10 @@ class MainActivity : AppCompatActivity() {
|
|||||||
rejectButton.visibility = View.INVISIBLE
|
rejectButton.visibility = View.INVISIBLE
|
||||||
callControl.visibility = View.INVISIBLE
|
callControl.visibility = View.INVISIBLE
|
||||||
dialpadButton.isEnabled = true
|
dialpadButton.isEnabled = true
|
||||||
|
if (BaresipService.isMicMuted) {
|
||||||
|
BaresipService.isMicMuted = false
|
||||||
|
micIcon!!.setIcon(R.drawable.mic_on)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
swipeRefresh.isEnabled = false
|
swipeRefresh.isEnabled = false
|
||||||
val call = Call.uaCalls(ua, "")[0]
|
val call = Call.uaCalls(ua, "")[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user