- Fixed crash when returning to the previous activity after received call

or message.
- Better handling of proximity sensor and speaker phone.
- Use aorSpinner.tag to store aor of the selected account.
This commit is contained in:
Juha Heinanen
2020-05-04 20:04:54 +03:00
parent b5053e3019
commit a3d138bafe
9 changed files with 91 additions and 119 deletions
@@ -416,14 +416,11 @@ class BaresipService: Service() {
updateStatusNotification()
}
"ToggleSpeaker" -> {
Log.d(LOG_TAG, "Toggling speakerphone from $speakerPhone")
am.isSpeakerphoneOn = !am.isSpeakerphoneOn
speakerPhone = am.isSpeakerphoneOn
}
"ProximitySensing" -> {
proximitySensing(intent!!.getBooleanExtra("enable", false))
"SetSpeaker" -> {
Log.d(LOG_TAG, "Set speakerphone $speakerPhone")
am.isSpeakerphoneOn = speakerPhone
if (Call.call("established") != null)
proximitySensing(!speakerPhone)
}
"Stop", "Stop Force" -> {
@@ -652,6 +649,7 @@ class BaresipService: Service() {
am.mode = AudioManager.MODE_IN_COMMUNICATION
requestAudioFocus(AudioAttributes.USAGE_VOICE_COMMUNICATION)
setCallVolume()
proximitySensing(!speakerPhone)
if (!Utils.isVisible())
return
}
@@ -741,6 +739,7 @@ class BaresipService: Service() {
abandonAudioFocus()
}
speakerPhone = false
am.isSpeakerphoneOn = false
proximitySensing(false)
}
if (ua.account.callHistory && !call.hasHistory) {
@@ -748,8 +747,7 @@ class BaresipService: Service() {
CallHistory.save()
if (call.dir == "in") ua.account.missedCalls = true
}
if (!Utils.isVisible())
return
if (!Utils.isVisible()) return
}
"transfer failed" -> {
Log.d(LOG_TAG, "AoR $aor hanging up call $callp with ${ev[1]}")