mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-26 06:58:37 +00:00
Fixed ZRTP dialogs missing upon rotation
This commit is contained in:
parent
ce3c37ad15
commit
94e6b28f4f
3 changed files with 21 additions and 3 deletions
|
|
@ -383,6 +383,14 @@ class ActiveCallFragment : GenericCallFragment() {
|
||||||
// Need to be done manually
|
// Need to be done manually
|
||||||
callViewModel.updateCallDuration()
|
callViewModel.updateCallDuration()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (callViewModel.isZrtpAlertDialogVisible) {
|
||||||
|
Log.i("$TAG Fragment resuming, showing ZRTP alert dialog")
|
||||||
|
showZrtpAlertDialog(callViewModel.zrtpSasValidationAttempts == 1)
|
||||||
|
} else if (callViewModel.isZrtpDialogVisible) {
|
||||||
|
Log.i("$TAG Fragment resuming, showing ZRTP SAS validation dialog")
|
||||||
|
callViewModel.showZrtpSasDialogIfPossible()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
|
@ -431,6 +439,7 @@ class ActiveCallFragment : GenericCallFragment() {
|
||||||
event.consume {
|
event.consume {
|
||||||
callViewModel.skipZrtpSas()
|
callViewModel.skipZrtpSas()
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
callViewModel.isZrtpDialogVisible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -438,11 +447,13 @@ class ActiveCallFragment : GenericCallFragment() {
|
||||||
event.consume { authToken ->
|
event.consume { authToken ->
|
||||||
callViewModel.updateZrtpSas(authToken)
|
callViewModel.updateZrtpSas(authToken)
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
callViewModel.isZrtpDialogVisible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.show()
|
dialog.show()
|
||||||
zrtpSasDialog = dialog
|
zrtpSasDialog = dialog
|
||||||
|
callViewModel.isZrtpDialogVisible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showZrtpAlertDialog(allowTryAgain: Boolean = true) {
|
private fun showZrtpAlertDialog(allowTryAgain: Boolean = true) {
|
||||||
|
|
@ -453,6 +464,7 @@ class ActiveCallFragment : GenericCallFragment() {
|
||||||
event.consume {
|
event.consume {
|
||||||
callViewModel.showZrtpSasDialogIfPossible()
|
callViewModel.showZrtpSasDialogIfPossible()
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
callViewModel.isZrtpAlertDialogVisible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -460,10 +472,13 @@ class ActiveCallFragment : GenericCallFragment() {
|
||||||
event.consume {
|
event.consume {
|
||||||
callViewModel.hangUp()
|
callViewModel.hangUp()
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
callViewModel.isZrtpAlertDialogVisible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.show()
|
dialog.show()
|
||||||
zrtpSasDialog = dialog
|
zrtpSasDialog = dialog
|
||||||
|
callViewModel.isZrtpDialogVisible = false
|
||||||
|
callViewModel.isZrtpAlertDialogVisible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,9 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
|
||||||
|
|
||||||
var zrtpSasValidationAttempts = 0
|
var zrtpSasValidationAttempts = 0
|
||||||
|
|
||||||
|
var isZrtpDialogVisible: Boolean = false
|
||||||
|
var isZrtpAlertDialogVisible: Boolean = false
|
||||||
|
|
||||||
// Chat
|
// Chat
|
||||||
|
|
||||||
val operationInProgress = MutableLiveData<Boolean>()
|
val operationInProgress = MutableLiveData<Boolean>()
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
<androidx.constraintlayout.widget.Guideline
|
||||||
android:id="@+id/half_screen"
|
android:id="@+id/guideline"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintGuide_percent="0.50" />
|
app:layout_constraintGuide_percent="0.75" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/dialog_background"
|
android:id="@+id/dialog_background"
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/confirm"
|
app:layout_constraintTop_toBottomOf="@id/confirm"
|
||||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/half_screen"/>
|
app:layout_constraintBottom_toBottomOf="@id/guideline"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue