From 21e412ef6f69996304df8e4a6ca5baf5f21a11e8 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 16 Apr 2020 11:02:42 +0200 Subject: [PATCH] only show remote video when connected --- .../eu/siacs/conversations/ui/RtpSessionActivity.java | 9 +++++++-- .../xmpp/jingle/JingleConnectionManager.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index f1d01afc7..8883ec9fa 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -531,8 +531,13 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe if (remoteVideoTrack.isPresent()) { ensureSurfaceViewRendererIsSetup(binding.remoteVideo); remoteVideoTrack.get().addSink(binding.remoteVideo); - binding.appBarLayout.setVisibility(View.GONE); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + if (state == RtpEndUserState.CONNECTED) { + binding.appBarLayout.setVisibility(View.GONE); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + } else { + getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + binding.remoteVideo.setVisibility(View.GONE); + } } else { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); binding.remoteVideo.setVisibility(View.GONE); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java index 886343be6..4ec48b35b 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java @@ -196,7 +196,7 @@ public class JingleConnectionManager extends AbstractConnectionManager { Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": encountered unknown media in session proposal. " + propose); return; } - if (isBusy()) { //TODO only if no other devices are active + if (isBusy()) { writeLogMissedIncoming(account, id.with.asBareJid(), id.sessionId, serverMsgId, timestamp); final int activeDevices = account.countPresences(); Log.d(Config.LOGTAG, "active devices: " + activeDevices);