Fixed ZRTP media encryption label in advanced settings not showing if post quantum or not

This commit is contained in:
Sylvain Berfini 2024-11-15 16:07:14 +01:00
parent 1f08682340
commit 90971224d5

View file

@ -641,7 +641,23 @@ class SettingsViewModel @UiThread constructor() : GenericViewModel() {
Log.i("$TAG Current media encryption is [$defaultMediaEncryption]")
for (encryption in MediaEncryption.entries) {
if (core.isMediaEncryptionSupported(encryption)) {
mediaEncryptionLabels.add(encryption.toString())
if (encryption == MediaEncryption.ZRTP) {
if (core.postQuantumAvailable) {
Log.i("$TAG Post Quantum ZRTP is available")
mediaEncryptionLabels.add(
AppUtils.getString(
R.string.call_stats_media_encryption_zrtp_post_quantum
)
)
} else {
Log.i(
"$TAG Post Quantum ZRTP isn't available, will use classic ZRTP instead"
)
mediaEncryptionLabels.add(encryption.toString())
}
} else {
mediaEncryptionLabels.add(encryption.toString())
}
mediaEncryptionValues.add(encryption)
if (encryption == defaultMediaEncryption) {
mediaEncryptionIndex.postValue(index)