From 353bc6c1dda4272115c1e928e967679615bc69e9 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Thu, 18 Jan 2018 12:49:30 +0100 Subject: [PATCH] Better toggle for sensor Signed-off-by: Mario Danic --- .../main/java/com/nextcloud/talk/activities/CallActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index f35ab3673..68e385f76 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -1247,7 +1247,8 @@ public class CallActivity extends AppCompatActivity { .PeerConnectionEventType.SENSOR_NEAR)) { boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent .PeerConnectionEventType.SENSOR_FAR) && videoOn; - if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) && inCall && videoOn) { + if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) && inCall && videoOn + && !localVideoTrack.enabled()) { runOnUiThread(() -> toggleMedia(enableVideo, true)); } } else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent