From 4a1c5304b16d536a32806799a089f524c271f002 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 23 Jun 2025 09:34:28 +0200 Subject: [PATCH] Fixed issue with encryption label being stuck in 'waiting for encryption' --- .../ui/call/viewmodel/CurrentCallViewModel.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt index c1f1c1a91..724325f3b 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt @@ -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)