diff --git a/app/src/main/java/org/thoughtcrime/securesms/WebRtcCallActivity.java b/app/src/main/java/org/thoughtcrime/securesms/WebRtcCallActivity.java index ad288be4b65..a7ad8eb9496 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/WebRtcCallActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/WebRtcCallActivity.java @@ -178,7 +178,11 @@ protected void onUserLeaveHint() { @Override public void onBackPressed() { - if (!enterPipModeIfPossible()) { + if (enableVideoIfAvailable) { + if (!enterPipModeIfPossible()) { + super.onBackPressed(); + } + } else { super.onBackPressed(); } } @@ -194,10 +198,8 @@ private boolean enterPipModeIfPossible() { PictureInPictureParams params = new PictureInPictureParams.Builder() .setAspectRatio(new Rational(9, 16)) .build(); - enterPictureInPictureMode(params); CallParticipantsListDialog.dismiss(getSupportFragmentManager()); - - return true; + return enterPictureInPictureMode(params); } return false; } @@ -328,6 +330,7 @@ private void handleSetMuteAudio(boolean enabled) { } private void handleSetMuteVideo(boolean muted) { + enableVideoIfAvailable = !muted; Recipient recipient = viewModel.getRecipient().get(); if (!recipient.equals(Recipient.UNKNOWN)) {