Updated icon & text for in-call media encryption label for SRTP

This commit is contained in:
Sylvain Berfini 2024-05-28 14:20:47 +02:00
parent ec207af81d
commit 1594252aeb
5 changed files with 22 additions and 5 deletions

View file

@ -112,6 +112,8 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
val isZrtpPq = MutableLiveData<Boolean>()
val isZrtp = MutableLiveData<Boolean>()
val isMediaEncrypted = MutableLiveData<Boolean>()
val hideVideo = MutableLiveData<Boolean>()
@ -941,7 +943,7 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
@WorkerThread
private fun updateEncryption(): Boolean {
when (currentCall.currentParams.mediaEncryption) {
when (val mediaEncryption = currentCall.currentParams.mediaEncryption) {
MediaEncryption.ZRTP -> {
val authToken = currentCall.authenticationToken
val isDeviceTrusted = currentCall.authenticationTokenVerified && authToken != null
@ -965,7 +967,7 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
}
isMediaEncrypted.postValue(true)
isZrtp.postValue(true)
// When Post Quantum is available, ZRTP is Post Quantum if key exchange was made with Post Quantum algorithm
val stats = currentCall.getStats(StreamType.Audio)
isZrtpPq.postValue(
@ -980,11 +982,15 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
return isDeviceTrusted
}
MediaEncryption.SRTP, MediaEncryption.DTLS -> {
Log.i("$TAG Current call media encryption is [$mediaEncryption]")
isMediaEncrypted.postValue(true)
isZrtp.postValue(false)
isZrtpPq.postValue(false)
}
else -> {
Log.w("$TAG Current call doesn't have any media encryption!")
isMediaEncrypted.postValue(false)
isZrtp.postValue(false)
isZrtpPq.postValue(false)
}
}

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="256"
android:viewportHeight="256">
<path
android:pathData="M128,112a28,28 0,0 0,-8 54.83L120,184a8,8 0,0 0,16 0L136,166.83A28,28 0,0 0,128 112ZM128,152a12,12 0,1 1,12 -12A12,12 0,0 1,128 152ZM208,80L176,80L176,56a48,48 0,0 0,-96 0L80,80L48,80A16,16 0,0 0,32 96L32,208a16,16 0,0 0,16 16L208,224a16,16 0,0 0,16 -16L224,96A16,16 0,0 0,208 80ZM96,56a32,32 0,0 1,64 0L160,80L96,80ZM208,208L48,208L48,96L208,96L208,208Z"
android:fillColor="#4e6074"/>
</vector>

View file

@ -238,7 +238,7 @@
android:adjustViewBounds="true"
android:paddingTop="3dp"
android:contentDescription="@null"
android:src="@{viewModel.isZrtpPq ? @drawable/atom : @drawable/lock_simple, default=@drawable/atom}"
android:src="@{viewModel.isZrtpPq ? @drawable/atom : viewModel.isZrtp ? @drawable/lock_key : @drawable/lock_simple, default=@drawable/atom}"
android:visibility="@{!viewModel.fullScreenMode &amp;&amp; !viewModel.pipMode &amp;&amp; viewModel.isMediaEncrypted ? View.VISIBLE : View.GONE}"
app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintTop_toTopOf="@id/media_encryption_label"
@ -252,7 +252,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="@{viewModel.isZrtpPq ? @string/call_post_quantum_zrtp_end_to_end_encrypted : @string/call_zrtp_end_to_end_encrypted, default=@string/call_post_quantum_zrtp_end_to_end_encrypted}"
android:text="@{viewModel.isZrtpPq ? @string/call_post_quantum_zrtp_end_to_end_encrypted : viewModel.isZrtp ? @string/call_zrtp_end_to_end_encrypted : @string/call_srtp_point_to_point_encrypted, default=@string/call_post_quantum_zrtp_end_to_end_encrypted}"
android:textSize="12sp"
android:textColor="@color/blue_info_500"
android:maxLines="1"

View file

@ -589,8 +589,9 @@
<string name="call_state_resuming">Reprise…</string>
<string name="call_state_ended">Terminé</string>
<string name="call_zrtp_end_to_end_encrypted">Appel chiffré de bout en bout</string>
<string name="call_post_quantum_zrtp_end_to_end_encrypted">Appel chiffré de bout en bout</string>
<string name="call_post_quantum_zrtp_end_to_end_encrypted">Appel chiffré de bout en bout en post-quantique</string>
<string name="call_do_zrtp_sas_validation_again">Faire la validation à nouveau</string>
<string name="call_srtp_point_to_point_encrypted">Appel chiffré de point à point</string>
<string name="calls_list_title">Liste des appels</string>
<string name="call_transfer_title">Transférer l\'appel vers</string>
<string name="call_remote_is_recording">%s est en train d\'enregistrer</string>

View file

@ -627,6 +627,7 @@
<string name="call_zrtp_end_to_end_encrypted">End-to-end encrypted by ZRTP</string>
<string name="call_post_quantum_zrtp_end_to_end_encrypted">End-to-end encrypted by post-quantum ZRTP</string>
<string name="call_do_zrtp_sas_validation_again">Validate ZRTP SAS again</string>
<string name="call_srtp_point_to_point_encrypted">Point-to-point encrypted by SRTP</string>
<string name="calls_list_title">Calls list</string>
<string name="call_transfer_title">Transfer call to</string>
<string name="call_remote_is_recording">%s is recording</string>