From bfb9a6267a88547aac5db4f5f9ae688f3e1e09eb Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 14 Apr 2020 18:18:16 +0200 Subject: [PATCH] complete list of reasons --- .../xmpp/jingle/RtpContentMap.java | 2 + .../xmpp/jingle/stanzas/Reason.java | 43 +++++++++++++------ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java index fcac3d729..96339061a 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java @@ -120,11 +120,13 @@ public class RtpContentMap { rtpDescription = (RtpDescription) description; } else { Log.d(Config.LOGTAG, "description was " + description); + //todo throw unsupported application throw new IllegalArgumentException("Content does not contain RtpDescription"); } if (transportInfo instanceof IceUdpTransportInfo) { iceUdpTransportInfo = (IceUdpTransportInfo) transportInfo; } else { + //TODO throw UNSUPPORTED_TRANSPORT exception throw new IllegalArgumentException("Content does not contain ICE-UDP transport"); } return new DescriptionTransport(rtpDescription, iceUdpTransportInfo); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java index 635f26d54..8fee7a552 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java @@ -5,19 +5,36 @@ import android.support.annotation.NonNull; import com.google.common.base.CaseFormat; 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) { - try { - return Reason.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, value)); - } catch (Exception e) { - return UNKNOWN; - } - } + public static Reason of(final String value) { + try { + return Reason.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, value)); + } catch (Exception e) { + return UNKNOWN; + } + } - @Override - @NonNull - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, super.toString()); - } + @Override + @NonNull + public String toString() { + return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, super.toString()); + } } \ No newline at end of file