Stay in communication mode in order to avoid audio delay when changing mode
This commit is contained in:
@ -520,7 +520,8 @@ class BaresipService: Service() {
|
||||
}
|
||||
"call outgoing" -> {
|
||||
stopMediaPlayer()
|
||||
am.mode = AudioManager.MODE_IN_COMMUNICATION
|
||||
if (am.mode != AudioManager.MODE_IN_COMMUNICATION)
|
||||
am.mode = AudioManager.MODE_IN_COMMUNICATION
|
||||
requestAudioFocus(AudioAttributes.USAGE_VOICE_COMMUNICATION,
|
||||
AudioAttributes.CONTENT_TYPE_SPEECH)
|
||||
setCallVolume()
|
||||
@ -757,7 +758,6 @@ class BaresipService: Service() {
|
||||
am.isSpeakerphoneOn = false
|
||||
am.stopBluetoothSco()
|
||||
abandonAudioFocus()
|
||||
am.mode = AudioManager.MODE_NORMAL
|
||||
proximitySensing(false)
|
||||
}
|
||||
if (ua.account.callHistory && !call.hasHistory) {
|
||||
|
||||
@ -792,6 +792,9 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onResume()
|
||||
Log.d(TAG, "Main onResume with action '$resumeAction'")
|
||||
nm.cancelAll()
|
||||
// Keep the app in communication mode in order to avoid audio delay when the mode changes
|
||||
if (am.mode != AudioManager.MODE_RINGTONE && am.mode != AudioManager.MODE_IN_COMMUNICATION)
|
||||
am.mode = AudioManager.MODE_IN_COMMUNICATION
|
||||
visible = true
|
||||
when (resumeAction) {
|
||||
"call show" ->
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user