Removed the possibility to have a second chance at ZRTP SAS validation

This commit is contained in:
Sylvain Berfini 2024-08-12 17:07:19 +02:00
parent 4978c9a16d
commit 9c40709666
6 changed files with 10 additions and 14 deletions

View file

@ -281,7 +281,7 @@ class ActiveCallFragment : GenericCallFragment() {
) )
} else { } else {
// Only allow "trying again" once // Only allow "trying again" once
showZrtpAlertDialog(callViewModel.zrtpSasValidationAttempts == 1) showZrtpAlertDialog(false)
} }
} }
} }
@ -432,7 +432,7 @@ class ActiveCallFragment : GenericCallFragment() {
if (callViewModel.isZrtpAlertDialogVisible) { if (callViewModel.isZrtpAlertDialogVisible) {
Log.i("$TAG Fragment resuming, showing ZRTP alert dialog") Log.i("$TAG Fragment resuming, showing ZRTP alert dialog")
showZrtpAlertDialog(callViewModel.zrtpSasValidationAttempts == 1) showZrtpAlertDialog(false)
} else if (callViewModel.isZrtpDialogVisible) { } else if (callViewModel.isZrtpDialogVisible) {
Log.i("$TAG Fragment resuming, showing ZRTP SAS validation dialog") Log.i("$TAG Fragment resuming, showing ZRTP SAS validation dialog")
callViewModel.showZrtpSasDialogIfPossible() callViewModel.showZrtpSasDialogIfPossible()

View file

@ -177,8 +177,6 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
MutableLiveData<Event<Boolean>>() MutableLiveData<Event<Boolean>>()
} }
var zrtpSasValidationAttempts = 0
var isZrtpDialogVisible: Boolean = false var isZrtpDialogVisible: Boolean = false
var isZrtpAlertDialogVisible: Boolean = false var isZrtpAlertDialogVisible: Boolean = false
@ -251,7 +249,6 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
Log.w( Log.w(
"$TAG Notified that authentication token is [${if (verified) "verified" else "not verified!"}]" "$TAG Notified that authentication token is [${if (verified) "verified" else "not verified!"}]"
) )
zrtpSasValidationAttempts += 1
isZrtpSasValidationRequired.postValue(!verified) isZrtpSasValidationRequired.postValue(!verified)
zrtpAuthTokenVerifiedEvent.postValue(Event(verified)) zrtpAuthTokenVerifiedEvent.postValue(Event(verified))
if (verified) { if (verified) {
@ -1022,7 +1019,6 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
contact.value?.destroy() contact.value?.destroy()
terminatedByUsed = false terminatedByUsed = false
zrtpSasValidationAttempts = 0
currentCall = call currentCall = call
callStatsModel.update(call, call.audioStats) callStatsModel.update(call, call.audioStats)
callMediaEncryptionModel.update(call) callMediaEncryptionModel.update(call)

View file

@ -13,8 +13,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="10dp" android:layout_marginStart="20dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="20dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/header" android:id="@+id/header"

View file

@ -13,8 +13,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="10dp" android:layout_marginStart="20dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="20dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/header" android:id="@+id/header"

View file

@ -13,8 +13,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="10dp" android:layout_marginStart="20dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="20dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/header" android:id="@+id/header"

View file

@ -13,8 +13,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="10dp" android:layout_marginStart="20dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="20dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/header" android:id="@+id/header"