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

@@ -0,0 +1,40 @@
package org.thoughtcrime.securesms.webrtc;
import android.content.Context;
import androidx.annotation.NonNull;
import org.signal.core.util.logging.Log;
import org.signal.ringrtc.CallException;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.util.NetworkUtil;
/**
* Represents the user's desired bandwidth mode for calls.
*/
public enum CallBandwidthMode {
LOW_ALWAYS(0),
HIGH_ON_WIFI(1),
HIGH_ALWAYS(2);
private final int code;
CallBandwidthMode(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public static CallBandwidthMode fromCode(int code) {
switch (code) {
case 1:
return HIGH_ON_WIFI;
case 2:
return HIGH_ALWAYS;
default:
return LOW_ALWAYS;
}
}
}