From 8ce91d1300d2b4b3e259f0e39238c7a2430d6675 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 16 Jul 2024 16:01:59 +0200 Subject: [PATCH] Fixed 'waiting for encryption' when leavign & going back to a call --- app/src/main/AndroidManifest.xml | 1 + .../linphone/ui/call/viewmodel/CurrentCallViewModel.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9f2aacbca..49bc95b92 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -47,6 +47,7 @@ android:label="@string/app_name" android:enableOnBackInvokedCallback="true" android:localeConfig="@xml/locales_config" + android:theme="@style/Theme.Linphone" tools:targetApi="35"> 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 841148c0e..4ef0fcb2e 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 @@ -1000,8 +1000,6 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() { "$TAG Configuring call with remote address [${call.remoteAddress.asStringUriOnly()}] as current" ) contact.value?.destroy() - waitingForEncryptionInfo.postValue(true) - isMediaEncrypted.postValue(false) terminatedByUsed = false zrtpSasValidationAttempts = 0 @@ -1010,6 +1008,13 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() { callMediaEncryptionModel.update(call) call.addListener(callListener) + if (call.currentParams.mediaEncryption == MediaEncryption.None) { + waitingForEncryptionInfo.postValue(true) + isMediaEncrypted.postValue(false) + } else { + updateEncryption() + } + val remoteContactAddress = call.remoteContactAddress val conferenceInfo = if (remoteContactAddress != null) { call.core.findConferenceInformationFromUri(remoteContactAddress)