From d4225fcf32f9675e520f7ea056c66ff272215111 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 17 Jan 2024 19:02:30 +0100 Subject: [PATCH] fix regression with screen not being put in right state --- .../siacs/conversations/ui/RtpSessionActivity.java | 13 +++++++++---- .../xmpp/jingle/JingleRtpConnection.java | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index 2e4576f57..c40a49a72 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -532,6 +532,8 @@ public class RtpSessionActivity extends XmppActivity setWith(account.getRoster().getContact(with), null); } else if (Intent.ACTION_VIEW.equals(action)) { final String extraLastState = intent.getStringExtra(EXTRA_LAST_REPORTED_STATE); + final String lastAction = intent.getStringExtra(EXTRA_LAST_ACTION); + final Set media = actionToMedia(lastAction); final RtpEndUserState state = extraLastState == null ? null : RtpEndUserState.valueOf(extraLastState); if (state != null) { @@ -548,10 +550,13 @@ public class RtpSessionActivity extends XmppActivity .fireJingleRtpConnectionStateUpdates()) { return; } - if (END_CARD.contains(state) - || xmppConnectionService - .getJingleConnectionManager() - .hasMatchingProposal(account, with)) { + if (END_CARD.contains(state)) { + return; + } + if (xmppConnectionService + .getJingleConnectionManager() + .hasMatchingProposal(account, with)) { + putScreenInCallMode(media); return; } Log.d(Config.LOGTAG, "restored state (" + state + ") was not an end card. finishing"); 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 0368f1a51..edb586565 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -34,7 +34,6 @@ import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Conversational; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.RtpSessionStatus; -import eu.siacs.conversations.services.AppRTCAudioManager; import eu.siacs.conversations.services.CallIntegration; import eu.siacs.conversations.ui.RtpSessionActivity; import eu.siacs.conversations.xml.Element; @@ -73,7 +72,10 @@ public class JingleRtpConnection extends AbstractJingleConnection public static final List STATES_SHOWING_ONGOING_CALL = Arrays.asList( - State.PROCEED, State.SESSION_INITIALIZED_PRE_APPROVED, State.SESSION_ACCEPTED); + State.PROPOSED, + State.PROCEED, + State.SESSION_INITIALIZED_PRE_APPROVED, + State.SESSION_ACCEPTED); private static final long BUSY_TIME_OUT = 30; private final WebRTCWrapper webRTCWrapper = new WebRTCWrapper(this);