kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add internal setting for call bandwidth mode.
rodzic
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(),
|
||||
|
|
|
@ -24,7 +24,8 @@ public final class InternalValues extends SignalStoreValues {
|
|||
public static final String REMOVE_SENDER_KEY_MINIMUM = "internal.remove_sender_key_minimum";
|
||||
public static final String DELAY_RESENDS = "internal.delay_resends";
|
||||
public static final String CALLING_SERVER = "internal.calling_server";
|
||||
public static final String AUDIO_PROCESSING_METHOD = "internal.audio_processing_method";
|
||||
public static final String CALLING_AUDIO_PROCESSING_METHOD = "internal.calling_audio_processing_method";
|
||||
public static final String CALLING_BANDWIDTH_MODE = "internal.calling_bandwidth_mode";
|
||||
public static final String SHAKE_TO_REPORT = "internal.shake_to_report";
|
||||
public static final String DISABLE_STORAGE_SERVICE = "internal.disable_storage_service";
|
||||
|
||||
|
@ -159,11 +160,22 @@ public final class InternalValues extends SignalStoreValues {
|
|||
/**
|
||||
* Setting to override the default handling of hardware/software AEC.
|
||||
*/
|
||||
public synchronized CallManager.AudioProcessingMethod audioProcessingMethod() {
|
||||
public synchronized CallManager.AudioProcessingMethod callingAudioProcessingMethod() {
|
||||
if (FeatureFlags.internalUser()) {
|
||||
return CallManager.AudioProcessingMethod.values()[getInteger(AUDIO_PROCESSING_METHOD, CallManager.AudioProcessingMethod.Default.ordinal())];
|
||||
return CallManager.AudioProcessingMethod.values()[getInteger(CALLING_AUDIO_PROCESSING_METHOD, CallManager.AudioProcessingMethod.Default.ordinal())];
|
||||
} else {
|
||||
return CallManager.AudioProcessingMethod.Default;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting to override the default calling bandwidth mode.
|
||||
*/
|
||||
public synchronized CallManager.BandwidthMode callingBandwidthMode() {
|
||||
if (FeatureFlags.internalUser()) {
|
||||
return CallManager.BandwidthMode.values()[getInteger(CALLING_BANDWIDTH_MODE, CallManager.BandwidthMode.NORMAL.ordinal())];
|
||||
} else {
|
||||
return CallManager.BandwidthMode.NORMAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ object AudioProcessingMethodSelector {
|
|||
|
||||
@JvmStatic
|
||||
fun get(): AudioProcessingMethod {
|
||||
if (SignalStore.internalValues().audioProcessingMethod() != AudioProcessingMethod.Default) {
|
||||
return SignalStore.internalValues().audioProcessingMethod()
|
||||
if (SignalStore.internalValues().callingAudioProcessingMethod() != AudioProcessingMethod.Default) {
|
||||
return SignalStore.internalValues().callingAudioProcessingMethod()
|
||||
}
|
||||
|
||||
val useAec3: Boolean = FeatureFlags.useAec3()
|
||||
|
|
|
@ -35,6 +35,10 @@ public final class NetworkUtil {
|
|||
}
|
||||
|
||||
public static @NonNull CallManager.BandwidthMode getCallingBandwidthMode(@NonNull Context context, @NonNull PeerConnection.AdapterType networkAdapter) {
|
||||
if (SignalStore.internalValues().callingBandwidthMode() != CallManager.BandwidthMode.NORMAL) {
|
||||
return SignalStore.internalValues().callingBandwidthMode();
|
||||
}
|
||||
|
||||
return useLowBandwidthCalling(context, networkAdapter) ? CallManager.BandwidthMode.LOW : CallManager.BandwidthMode.NORMAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -2692,11 +2692,12 @@
|
|||
<string name="preferences__internal_local_metrics" translatable="false">Local Metrics</string>
|
||||
<string name="preferences__internal_clear_local_metrics" translatable="false">Clear local metrics</string>
|
||||
<string name="preferences__internal_click_to_clear_all_local_metrics_state" translatable="false">Click to clear all local metrics state.</string>
|
||||
<string name="preferences__internal_calling" translatable="false">Group call server</string>
|
||||
<string name="preferences__internal_calling_default" translatable="false">Default</string>
|
||||
<string name="preferences__internal_calling_s_server" translatable="false">%1$s server</string>
|
||||
<string name="preferences__internal_audio" translatable="false">Audio options</string>
|
||||
<string name="preferences__internal_audio_processing_method" translatable="false">Audio processing method</string>
|
||||
<string name="preferences__internal_calling_server" translatable="false">Group call server</string>
|
||||
<string name="preferences__internal_calling_server_default" translatable="false">Default</string>
|
||||
<string name="preferences__internal_calling_server_s" translatable="false">%1$s server</string>
|
||||
<string name="preferences__internal_calling" translatable="false">Calling options</string>
|
||||
<string name="preferences__internal_calling_audio_processing_method" translatable="false">Audio processing method</string>
|
||||
<string name="preferences__internal_calling_bandwidth_mode" translatable="false">Bandwidth mode</string>
|
||||
<string name="preferences__internal_badges" translatable="false">Badges</string>
|
||||
<string name="preferences__internal_badges_enqueue_redemption" translatable="false">Enqueue redemption.</string>
|
||||
<string name="preferences__internal_release_channel" translatable="false">Release channel</string>
|
||||
|
|
Ładowanie…
Reference in New Issue