Fixed issue with encryption label being stuck in 'waiting for encryption'

This commit is contained in:
Sylvain Berfini 2025-06-23 09:34:28 +02:00
parent 67e3c51a84
commit 4a1c5304b1

View file

@ -350,7 +350,6 @@ class CurrentCallViewModel
"$TAG From now on current call will be [${newCurrentCall.remoteAddress.asStringUriOnly()}]"
)
configureCall(newCurrentCall)
updateEncryption()
} else {
Log.e("$TAG Failed to get a valid call to display")
endCall(call)
@ -463,7 +462,6 @@ class CurrentCallViewModel
)
currentCall.removeListener(callListener)
configureCall(call)
updateEncryption()
} else if (LinphoneUtils.isCallIncoming(call.state)) {
Log.w(
"$TAG A call is being received [${call.remoteAddress.asStringUriOnly()}], using it as current call unless declined"
@ -1105,9 +1103,14 @@ class CurrentCallViewModel
callMediaEncryptionModel.update(call)
call.addListener(callListener)
if (call.currentParams.mediaEncryption == MediaEncryption.None) {
waitingForEncryptionInfo.postValue(true)
isMediaEncrypted.postValue(false)
val state = call.state
if (LinphoneUtils.isCallOutgoing(state) || LinphoneUtils.isCallIncoming(state)) {
if (call.currentParams.mediaEncryption == MediaEncryption.None) {
waitingForEncryptionInfo.postValue(true)
isMediaEncrypted.postValue(false)
} else {
updateEncryption()
}
} else {
updateEncryption()
}
@ -1196,7 +1199,6 @@ class CurrentCallViewModel
updateOutputAudioDevice(audioDevice)
isOutgoing.postValue(call.dir == Call.Dir.Outgoing)
val state = call.state
isOutgoingRinging.postValue(state == Call.State.OutgoingRinging)
isIncomingEarlyMedia.postValue(state == Call.State.IncomingEarlyMedia)
isOutgoingEarlyMedia.postValue(state == Call.State.OutgoingEarlyMedia)