mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Don't try to use bluetooth headset if it is not connected.
This commit is contained in:
parent
95e80f0263
commit
d9009540dd
@ -14,6 +14,7 @@ Bugfix 🐛:
|
||||
- Fix FontSize issue (#1483, #1787)
|
||||
- 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)
|
||||
- Loudspeaker is always used (#1685)
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
@ -125,7 +125,7 @@ class CallAudioManager(
|
||||
} else {
|
||||
// if a wired headset is plugged, sound will be directed to it
|
||||
// (can't really force earpiece when headset is plugged)
|
||||
if (isBluetoothHeadsetOn()) {
|
||||
if (isBluetoothHeadsetConnected(audioManager)) {
|
||||
Timber.v("##VOIP: AudioManager default to WIRELESS_HEADSET ")
|
||||
setCurrentSoundDevice(SoundDevice.WIRELESS_HEADSET)
|
||||
// try now in case already connected?
|
||||
@ -246,7 +246,7 @@ class CallAudioManager(
|
||||
}
|
||||
|
||||
private fun isHeadsetOn(): Boolean {
|
||||
return isWiredHeadsetOn() || isBluetoothHeadsetOn()
|
||||
return isWiredHeadsetOn() || (audioManager?.let { isBluetoothHeadsetConnected(it) } ?: false)
|
||||
}
|
||||
|
||||
private fun isWiredHeadsetOn(): Boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user