complete list of reasons

This commit is contained in:
Daniel Gultsch 2020-04-14 18:18:16 +02:00
parent dd42a6b850
commit bfb9a6267a
2 changed files with 32 additions and 13 deletions

View File

@ -120,11 +120,13 @@ public class RtpContentMap {
rtpDescription = (RtpDescription) description; rtpDescription = (RtpDescription) description;
} else { } else {
Log.d(Config.LOGTAG, "description was " + description); Log.d(Config.LOGTAG, "description was " + description);
//todo throw unsupported application
throw new IllegalArgumentException("Content does not contain RtpDescription"); throw new IllegalArgumentException("Content does not contain RtpDescription");
} }
if (transportInfo instanceof IceUdpTransportInfo) { if (transportInfo instanceof IceUdpTransportInfo) {
iceUdpTransportInfo = (IceUdpTransportInfo) transportInfo; iceUdpTransportInfo = (IceUdpTransportInfo) transportInfo;
} else { } else {
//TODO throw UNSUPPORTED_TRANSPORT exception
throw new IllegalArgumentException("Content does not contain ICE-UDP transport"); throw new IllegalArgumentException("Content does not contain ICE-UDP transport");
} }
return new DescriptionTransport(rtpDescription, iceUdpTransportInfo); return new DescriptionTransport(rtpDescription, iceUdpTransportInfo);

View File

@ -5,19 +5,36 @@ import android.support.annotation.NonNull;
import com.google.common.base.CaseFormat; import com.google.common.base.CaseFormat;
public enum Reason { public enum Reason {
SUCCESS, DECLINE, BUSY, CANCEL, CONNECTIVITY_ERROR, FAILED_TRANSPORT, FAILED_APPLICATION, TIMEOUT, UNKNOWN; ALTERNATIVE_SESSION,
BUSY,
CANCEL,
CONNECTIVITY_ERROR,
DECLINE,
EXPIRED,
FAILED_APPLICATION,
FAILED_TRANSPORT,
GENERAL_ERROR,
GONE,
INCOMPATIBLE_PARAMETERS,
MEDIA_ERROR,
SECURITY_ERROR,
SUCCESS,
TIMEOUT,
UNSUPPORTED_APPLICATIONS,
UNSUPPORTED_TRANSPORTS,
UNKNOWN;
public static Reason of(final String value) { public static Reason of(final String value) {
try { try {
return Reason.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, value)); return Reason.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, value));
} catch (Exception e) { } catch (Exception e) {
return UNKNOWN; return UNKNOWN;
} }
} }
@Override @Override
@NonNull @NonNull
public String toString() { public String toString() {
return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, super.toString()); return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, super.toString());
} }
} }