Fixed 'waiting for encryption' when leavign & going back to a call

This commit is contained in:
Sylvain Berfini 2024-07-16 16:01:59 +02:00
parent 79ca1d6505
commit 8ce91d1300
2 changed files with 8 additions and 2 deletions

View file

@ -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">
<!-- Required for chat message notifications to be displayed in Android auto -->

View file

@ -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)