Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/iNPUTmice/Conversations.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2021-05-04 11:10:30 +0300
committerDaniel Gultsch <daniel@gultsch.de>2021-05-04 11:10:34 +0300
commit48156dd27f44adfbb12b2321fd22d671fb7e3ca6 (patch)
treed08b366d40c8633e914377a1300721ce7064c34f
parent905489e23703848f78f27f7f6bf742a7b80014b3 (diff)
a/v calls: seperate out SECURITY error from APP_FAILURE
until now problems with verifying the call (omemo or DTLS missing) would just be another app failure. This commit displays verifications problems as their own thing.
-rw-r--r--src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java16
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java3
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java22
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java3
-rw-r--r--src/main/res/values/strings.xml1
5 files changed, 34 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
index 496244300..e9e12d7e3 100644
--- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
@@ -81,6 +81,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
private static final List<RtpEndUserState> END_CARD = Arrays.asList(
RtpEndUserState.APPLICATION_ERROR,
+ RtpEndUserState.SECURITY_ERROR,
RtpEndUserState.DECLINED_OR_BUSY,
RtpEndUserState.CONNECTIVITY_ERROR,
RtpEndUserState.CONNECTIVITY_LOST_ERROR,
@@ -88,7 +89,8 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
);
private static final List<RtpEndUserState> STATES_SHOWING_HELP_BUTTON = Arrays.asList(
RtpEndUserState.APPLICATION_ERROR,
- RtpEndUserState.CONNECTIVITY_ERROR
+ RtpEndUserState.CONNECTIVITY_ERROR,
+ RtpEndUserState.SECURITY_ERROR
);
private static final List<RtpEndUserState> STATES_SHOWING_SWITCH_TO_CHAT = Arrays.asList(
RtpEndUserState.CONNECTING,
@@ -668,6 +670,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
case APPLICATION_ERROR:
setTitle(R.string.rtp_state_application_failure);
break;
+ case SECURITY_ERROR:
+ setTitle(R.string.rtp_state_security_error);
+ break;
case ENDED:
throw new IllegalStateException("Activity should have called finishAndReleaseWakeLock();");
default:
@@ -743,7 +748,8 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
RtpEndUserState.CONNECTIVITY_ERROR,
RtpEndUserState.CONNECTIVITY_LOST_ERROR,
RtpEndUserState.APPLICATION_ERROR,
- RtpEndUserState.RETRACTED
+ RtpEndUserState.RETRACTED,
+ RtpEndUserState.SECURITY_ERROR
).contains(state)) {
this.binding.rejectCall.setContentDescription(getString(R.string.exit));
this.binding.rejectCall.setOnClickListener(this::exit);
@@ -928,7 +934,11 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
if (isPictureInPicture()) {
binding.appBarLayout.setVisibility(View.GONE);
binding.pipPlaceholder.setVisibility(View.VISIBLE);
- if (state == RtpEndUserState.APPLICATION_ERROR || state == RtpEndUserState.CONNECTIVITY_ERROR) {
+ if (Arrays.asList(
+ RtpEndUserState.APPLICATION_ERROR,
+ RtpEndUserState.CONNECTIVITY_ERROR,
+ RtpEndUserState.SECURITY_ERROR)
+ .contains(state)) {
binding.pipWarning.setVisibility(View.VISIBLE);
binding.pipWaiting.setVisibility(View.GONE);
} else {
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java
index fcacd35d2..90f06fe26 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java
@@ -136,6 +136,7 @@ public abstract class AbstractJingleConnection {
TERMINATED_DECLINED_OR_BUSY, //equal to 'ENDED' (after other party declined the call)
TERMINATED_CONNECTIVITY_ERROR, //equal to 'ENDED' (but after network failures; ui will display retry button)
TERMINATED_CANCEL_OR_TIMEOUT, //more or less the same as retracted; caller pressed end call before session was accepted
- TERMINATED_APPLICATION_FAILURE
+ TERMINATED_APPLICATION_FAILURE,
+ TERMINATED_SECURITY_ERROR
}
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java
index 1f9eeb3c4..80133268e 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java
@@ -71,7 +71,8 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
State.TERMINATED_DECLINED_OR_BUSY,
State.TERMINATED_CONNECTIVITY_ERROR,
State.TERMINATED_CANCEL_OR_TIMEOUT,
- State.TERMINATED_APPLICATION_FAILURE
+ State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR
);
private static final Map<State, Collection<State>> VALID_TRANSITIONS;
@@ -81,7 +82,8 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
transitionBuilder.put(State.NULL, ImmutableList.of(
State.PROPOSED,
State.SESSION_INITIALIZED,
- State.TERMINATED_APPLICATION_FAILURE
+ State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR
));
transitionBuilder.put(State.PROPOSED, ImmutableList.of(
State.ACCEPTED,
@@ -89,6 +91,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
State.REJECTED,
State.RETRACTED,
State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR,
State.TERMINATED_CONNECTIVITY_ERROR //only used when the xmpp connection rebinds
));
transitionBuilder.put(State.PROCEED, ImmutableList.of(
@@ -97,6 +100,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
State.SESSION_INITIALIZED_PRE_APPROVED,
State.TERMINATED_SUCCESS,
State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR,
State.TERMINATED_CONNECTIVITY_ERROR //at this state used for error bounces of the proceed message
));
transitionBuilder.put(State.SESSION_INITIALIZED, ImmutableList.of(
@@ -105,7 +109,8 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
State.TERMINATED_DECLINED_OR_BUSY,
State.TERMINATED_CONNECTIVITY_ERROR, //at this state used for IQ errors and IQ timeouts
State.TERMINATED_CANCEL_OR_TIMEOUT,
- State.TERMINATED_APPLICATION_FAILURE
+ State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR
));
transitionBuilder.put(State.SESSION_INITIALIZED_PRE_APPROVED, ImmutableList.of(
State.SESSION_ACCEPTED,
@@ -113,14 +118,16 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
State.TERMINATED_DECLINED_OR_BUSY,
State.TERMINATED_CONNECTIVITY_ERROR, //at this state used for IQ errors and IQ timeouts
State.TERMINATED_CANCEL_OR_TIMEOUT,
- State.TERMINATED_APPLICATION_FAILURE
+ State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR
));
transitionBuilder.put(State.SESSION_ACCEPTED, ImmutableList.of(
State.TERMINATED_SUCCESS,
State.TERMINATED_DECLINED_OR_BUSY,
State.TERMINATED_CONNECTIVITY_ERROR,
State.TERMINATED_CANCEL_OR_TIMEOUT,
- State.TERMINATED_APPLICATION_FAILURE
+ State.TERMINATED_APPLICATION_FAILURE,
+ State.TERMINATED_SECURITY_ERROR
));
VALID_TRANSITIONS = transitionBuilder.build();
}
@@ -164,8 +171,9 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
case CANCEL:
case TIMEOUT:
return State.TERMINATED_CANCEL_OR_TIMEOUT;
- case FAILED_APPLICATION:
case SECURITY_ERROR:
+ return State.TERMINATED_SECURITY_ERROR;
+ case FAILED_APPLICATION:
case UNSUPPORTED_TRANSPORTS:
case UNSUPPORTED_APPLICATIONS:
return State.TERMINATED_APPLICATION_FAILURE;
@@ -959,6 +967,8 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
return rtpConnectionStarted == 0 ? RtpEndUserState.CONNECTIVITY_ERROR : RtpEndUserState.CONNECTIVITY_LOST_ERROR;
case TERMINATED_APPLICATION_FAILURE:
return RtpEndUserState.APPLICATION_ERROR;
+ case TERMINATED_SECURITY_ERROR:
+ return RtpEndUserState.SECURITY_ERROR;
}
throw new IllegalStateException(String.format("%s has no equivalent EndUserState", this.state));
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java
index 3b97fcbc7..61536bb7c 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java
@@ -13,5 +13,6 @@ public enum RtpEndUserState {
CONNECTIVITY_ERROR, //network error; retry button
CONNECTIVITY_LOST_ERROR, //network error but for call duration > 0
RETRACTED, //user pressed home or power button during 'ringing' - shows retry button
- APPLICATION_ERROR //something rather bad happened; libwebrtc failed or we got in IQ-error
+ APPLICATION_ERROR, //something rather bad happened; libwebrtc failed or we got in IQ-error
+ SECURITY_ERROR //problem with DTLS (missing) or verification
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 2db8b1da3..c9ad3d891 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -912,6 +912,7 @@
<string name="rtp_state_connectivity_lost_error">Connection lost</string>
<string name="rtp_state_retracted">Retracted call</string>
<string name="rtp_state_application_failure">App failure</string>
+ <string name="rtp_state_security_error">Verification problem</string>
<string name="hang_up">Hang up</string>
<string name="ongoing_call">Ongoing call</string>
<string name="ongoing_video_call">Ongoing video call</string>