mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Add internal setting for call bandwidth mode.
This commit is contained in:
committed by
Greyson Parrelli
parent
eee9c967fa
commit
2f97b80b9c
@@ -331,10 +331,10 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
||||
|
||||
dividerPref()
|
||||
|
||||
sectionHeaderPref(R.string.preferences__internal_calling)
|
||||
sectionHeaderPref(R.string.preferences__internal_calling_server)
|
||||
|
||||
radioPref(
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_calling_default),
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_calling_server_default),
|
||||
summary = DSLSettingsText.from(BuildConfig.SIGNAL_SFU_URL),
|
||||
isChecked = state.callingServer == BuildConfig.SIGNAL_SFU_URL,
|
||||
onClick = {
|
||||
@@ -345,7 +345,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
||||
BuildConfig.SIGNAL_SFU_INTERNAL_NAMES.zip(BuildConfig.SIGNAL_SFU_INTERNAL_URLS)
|
||||
.forEach { (name, server) ->
|
||||
radioPref(
|
||||
title = DSLSettingsText.from(requireContext().getString(R.string.preferences__internal_calling_s_server, name)),
|
||||
title = DSLSettingsText.from(requireContext().getString(R.string.preferences__internal_calling_server_s, name)),
|
||||
summary = DSLSettingsText.from(server),
|
||||
isChecked = state.callingServer == server,
|
||||
onClick = {
|
||||
@@ -354,14 +354,23 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
||||
)
|
||||
}
|
||||
|
||||
sectionHeaderPref(R.string.preferences__internal_audio)
|
||||
sectionHeaderPref(R.string.preferences__internal_calling)
|
||||
|
||||
radioListPref(
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_audio_processing_method),
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_calling_audio_processing_method),
|
||||
listItems = CallManager.AudioProcessingMethod.values().map { it.name }.toTypedArray(),
|
||||
selected = CallManager.AudioProcessingMethod.values().indexOf(state.audioProcessingMethod),
|
||||
selected = CallManager.AudioProcessingMethod.values().indexOf(state.callingAudioProcessingMethod),
|
||||
onSelected = {
|
||||
viewModel.setInternalAudioProcessingMethod(CallManager.AudioProcessingMethod.values()[it])
|
||||
viewModel.setInternalCallingAudioProcessingMethod(CallManager.AudioProcessingMethod.values()[it])
|
||||
}
|
||||
)
|
||||
|
||||
radioListPref(
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_calling_bandwidth_mode),
|
||||
listItems = CallManager.BandwidthMode.values().map { it.name }.toTypedArray(),
|
||||
selected = CallManager.BandwidthMode.values().indexOf(state.callingBandwidthMode),
|
||||
onSelected = {
|
||||
viewModel.setInternalCallingBandwidthMode(CallManager.BandwidthMode.values()[it])
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ data class InternalSettingsState(
|
||||
val disableAutoMigrationNotification: Boolean,
|
||||
val allowCensorshipSetting: Boolean,
|
||||
val callingServer: String,
|
||||
val audioProcessingMethod: CallManager.AudioProcessingMethod,
|
||||
val callingAudioProcessingMethod: CallManager.AudioProcessingMethod,
|
||||
val callingBandwidthMode: CallManager.BandwidthMode,
|
||||
val useBuiltInEmojiSet: Boolean,
|
||||
val emojiVersion: EmojiFiles.Version?,
|
||||
val removeSenderKeyMinimium: Boolean,
|
||||
|
||||
@@ -91,8 +91,13 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
|
||||
refresh()
|
||||
}
|
||||
|
||||
fun setInternalAudioProcessingMethod(method: CallManager.AudioProcessingMethod) {
|
||||
preferenceDataStore.putInt(InternalValues.AUDIO_PROCESSING_METHOD, method.ordinal)
|
||||
fun setInternalCallingAudioProcessingMethod(method: CallManager.AudioProcessingMethod) {
|
||||
preferenceDataStore.putInt(InternalValues.CALLING_AUDIO_PROCESSING_METHOD, method.ordinal)
|
||||
refresh()
|
||||
}
|
||||
|
||||
fun setInternalCallingBandwidthMode(bandwidthMode: CallManager.BandwidthMode) {
|
||||
preferenceDataStore.putInt(InternalValues.CALLING_BANDWIDTH_MODE, bandwidthMode.ordinal)
|
||||
refresh()
|
||||
}
|
||||
|
||||
@@ -121,7 +126,8 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
|
||||
disableAutoMigrationNotification = SignalStore.internalValues().disableGv1AutoMigrateNotification(),
|
||||
allowCensorshipSetting = SignalStore.internalValues().allowChangingCensorshipSetting(),
|
||||
callingServer = SignalStore.internalValues().groupCallingServer(),
|
||||
audioProcessingMethod = SignalStore.internalValues().audioProcessingMethod(),
|
||||
callingAudioProcessingMethod = SignalStore.internalValues().callingAudioProcessingMethod(),
|
||||
callingBandwidthMode = SignalStore.internalValues().callingBandwidthMode(),
|
||||
useBuiltInEmojiSet = SignalStore.internalValues().forceBuiltInEmoji(),
|
||||
emojiVersion = null,
|
||||
removeSenderKeyMinimium = SignalStore.internalValues().removeSenderKeyMinimum(),
|
||||
|
||||
Reference in New Issue
Block a user