mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed crash due to currentCall not being initialized
This commit is contained in:
parent
71b1cf8e7a
commit
71e1734ca0
1 changed files with 8 additions and 6 deletions
|
|
@ -701,6 +701,10 @@ class CurrentCallViewModel
|
|||
@UiThread
|
||||
fun changeAudioOutputDevice() {
|
||||
val routeAudioToSpeaker = isSpeakerEnabled.value != true
|
||||
if (!::currentCall.isInitialized) {
|
||||
Log.w("$TAG Current call not initialized yet, do not attempt to change output audio device")
|
||||
return
|
||||
}
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
var earpieceFound = false
|
||||
|
|
@ -775,12 +779,10 @@ class CurrentCallViewModel
|
|||
Log.i(
|
||||
"$TAG Found less than two devices, simply switching between earpiece & speaker"
|
||||
)
|
||||
if (::currentCall.isInitialized) {
|
||||
if (routeAudioToSpeaker) {
|
||||
AudioUtils.routeAudioToSpeaker(currentCall)
|
||||
} else {
|
||||
AudioUtils.routeAudioToEarpiece(currentCall)
|
||||
}
|
||||
if (routeAudioToSpeaker) {
|
||||
AudioUtils.routeAudioToSpeaker(currentCall)
|
||||
} else {
|
||||
AudioUtils.routeAudioToEarpiece(currentCall)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue