Add toggle to control call bandwidth.

This commit is contained in:
Alex Hart
2021-01-12 17:40:47 -04:00
committed by Greyson Parrelli
parent 8724d904b7
commit be91f2396c
20 changed files with 347 additions and 100 deletions

View File

@@ -6,6 +6,8 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.thoughtcrime.securesms.webrtc.CallBandwidthMode;
public final class SettingsValues extends SignalStoreValues {
public static final String LINK_PREVIEWS = "settings.link_previews";
@@ -14,6 +16,8 @@ public final class SettingsValues extends SignalStoreValues {
private static final String SIGNAL_BACKUP_DIRECTORY = "settings.signal.backup.directory";
private static final String SIGNAL_LATEST_BACKUP_DIRECTORY = "settings.signal.backup.directory,latest";
private static final String CALL_BANDWIDTH_MODE = "settings.signal.call.bandwidth.mode";
public static final String THREAD_TRIM_LENGTH = "pref_trim_length";
public static final String THREAD_TRIM_ENABLED = "pref_trim_threads";
@@ -77,6 +81,14 @@ public final class SettingsValues extends SignalStoreValues {
putString(SIGNAL_BACKUP_DIRECTORY, null);
}
public void setCallBandwidthMode(@NonNull CallBandwidthMode callBandwidthMode) {
putInteger(CALL_BANDWIDTH_MODE, callBandwidthMode.getCode());
}
public @NonNull CallBandwidthMode getCallBandwidthMode() {
return CallBandwidthMode.fromCode(getInteger(CALL_BANDWIDTH_MODE, CallBandwidthMode.HIGH_ALWAYS.getCode()));
}
private @Nullable Uri getUri(@NonNull String key) {
String uri = getString(key, "");