From f3eb8219468586be8b42f6cf1dc5900c4676f200 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 27 Jun 2024 10:31:04 +0200 Subject: [PATCH] Fixed stucked in 'wait for encryption' for SRTP & not encrypted calls --- .idea/codeStyles/Project.xml | 123 ++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .../ui/call/viewmodel/CurrentCallViewModel.kt | 11 +- 3 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..7643783a8 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..79ee123c2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file 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 62ad516f5..4d7d7dc95 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 @@ -241,7 +241,6 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() { override fun onEncryptionChanged(call: Call, on: Boolean, authenticationToken: String?) { Log.i("$TAG Call encryption changed, updating...") updateEncryption() - callMediaEncryptionModel.update(call) } override fun onAuthenticationTokenVerified(call: Call, verified: Boolean) { @@ -346,6 +345,15 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() { if (corePreferences.automaticallyStartCallRecording) { isRecording.postValue(call.params.isRecording) } + + // MediaEncryption None & SRTP won't be notified through onEncryptionChanged callback, + // we have to do it manually to leave the "wait for encryption" state + when (call.currentParams.mediaEncryption) { + MediaEncryption.SRTP, MediaEncryption.None -> { + updateEncryption() + } + else -> {} + } } } @@ -1035,6 +1043,7 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() { } } waitingForEncryptionInfo.postValue(false) + callMediaEncryptionModel.update(currentCall) } @WorkerThread