Merge pull request #2014 from vector-im/feature/fix_call_sound_device

Fix: Loudspeaker is always used
This commit is contained in:
Benoit Marty 2020-09-01 15:33:06 +02:00 committed by GitHub
commit 8157644ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ Bugfix 🐛:
- Fix FontSize issue (#1483, #1787) - Fix FontSize issue (#1483, #1787)
- Fix bad color for settings icon on Android < 24 (#1786) - Fix bad color for settings icon on Android < 24 (#1786)
- Change user or room avatar: when selecting Gallery, I'm not proposed to crop the selected image (#1590) - Change user or room avatar: when selecting Gallery, I'm not proposed to crop the selected image (#1590)
- Loudspeaker is always used (#1685)
- Fix uploads still don't work with room v6 (#1879) - Fix uploads still don't work with room v6 (#1879)
- Can't handle ongoing call events in background (#1992) - Can't handle ongoing call events in background (#1992)

View File

@ -125,7 +125,7 @@ class CallAudioManager(
} else { } else {
// if a wired headset is plugged, sound will be directed to it // if a wired headset is plugged, sound will be directed to it
// (can't really force earpiece when headset is plugged) // (can't really force earpiece when headset is plugged)
if (isBluetoothHeadsetOn()) { if (isBluetoothHeadsetConnected(audioManager)) {
Timber.v("##VOIP: AudioManager default to WIRELESS_HEADSET ") Timber.v("##VOIP: AudioManager default to WIRELESS_HEADSET ")
setCurrentSoundDevice(SoundDevice.WIRELESS_HEADSET) setCurrentSoundDevice(SoundDevice.WIRELESS_HEADSET)
// try now in case already connected? // try now in case already connected?
@ -246,7 +246,7 @@ class CallAudioManager(
} }
private fun isHeadsetOn(): Boolean { private fun isHeadsetOn(): Boolean {
return isWiredHeadsetOn() || isBluetoothHeadsetOn() return isWiredHeadsetOn() || (audioManager?.let { isBluetoothHeadsetConnected(it) } ?: false)
} }
private fun isWiredHeadsetOn(): Boolean { private fun isWiredHeadsetOn(): Boolean {