diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
index 9cfda2174447b4bfc24253e5e2146a7b83b79f88..848c447a13e9f57361b079de9899d627baa62d56 100644
--- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
@@ -78,6 +78,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
RtpEndUserState.APPLICATION_ERROR,
RtpEndUserState.DECLINED_OR_BUSY,
RtpEndUserState.CONNECTIVITY_ERROR,
+ RtpEndUserState.CONNECTIVITY_LOST_ERROR,
RtpEndUserState.RETRACTED
);
private static final String PROXIMITY_WAKE_LOCK_TAG = "conversations:in-rtp-session";
@@ -533,6 +534,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
case CONNECTIVITY_ERROR:
setTitle(R.string.rtp_state_connectivity_error);
break;
+ case CONNECTIVITY_LOST_ERROR:
+ setTitle(R.string.rtp_state_connectivity_lost_error);
+ break;
case RETRACTED:
setTitle(R.string.rtp_state_retracted);
break;
@@ -598,7 +602,12 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
this.binding.acceptCall.setOnClickListener(this::recordVoiceMail);
this.binding.acceptCall.setImageResource(R.drawable.ic_voicemail_white_24dp);
this.binding.acceptCall.setVisibility(View.VISIBLE);
- } else if (asList(RtpEndUserState.CONNECTIVITY_ERROR, RtpEndUserState.APPLICATION_ERROR, RtpEndUserState.RETRACTED).contains(state)) {
+ } else if (asList(
+ RtpEndUserState.CONNECTIVITY_ERROR,
+ RtpEndUserState.CONNECTIVITY_LOST_ERROR,
+ RtpEndUserState.APPLICATION_ERROR,
+ RtpEndUserState.RETRACTED
+ ).contains(state)) {
this.binding.rejectCall.setOnClickListener(this::exit);
this.binding.rejectCall.setImageResource(R.drawable.ic_clear_white_48dp);
this.binding.rejectCall.setVisibility(View.VISIBLE);
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 2f8486faaf7bfb1c272827f7f13b35cc00449ba0..4dadb599d97113dc30d2f3b0a2d9ae4f7e8e5d38 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java
@@ -814,7 +814,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
} else if (state == PeerConnection.PeerConnectionState.CLOSED) {
return RtpEndUserState.ENDING_CALL;
} else {
- return RtpEndUserState.CONNECTIVITY_ERROR;
+ return rtpConnectionStarted == 0 ? RtpEndUserState.CONNECTIVITY_ERROR : RtpEndUserState.CONNECTIVITY_LOST_ERROR;
}
case REJECTED:
case TERMINATED_DECLINED_OR_BUSY:
@@ -831,7 +831,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
case RETRACTED_RACED:
return RtpEndUserState.RETRACTED;
case TERMINATED_CONNECTIVITY_ERROR:
- return RtpEndUserState.CONNECTIVITY_ERROR;
+ return rtpConnectionStarted == 0 ? RtpEndUserState.CONNECTIVITY_ERROR : RtpEndUserState.CONNECTIVITY_LOST_ERROR;
case TERMINATED_APPLICATION_FAILURE:
return RtpEndUserState.APPLICATION_ERROR;
}
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 398777cfec9c1b69c56e1bc370f6b0b22831fd9b..3b97fcbc731c5b551e3e123d2cec38298bf9b6fb 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpEndUserState.java
@@ -11,6 +11,7 @@ public enum RtpEndUserState {
ENDED, //close UI
DECLINED_OR_BUSY, //other party declined; no retry button
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
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 679e3700630d49cba526f32479360bdfa0f271c8..a6d951b5634a8e925dd96477f3e7832952855c30 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -903,6 +903,7 @@
Ringing
Busy
Could not connect call
+ Connection lost
Retracted call
App failure
Hang up