mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Fix proximity sensor video stop
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
8b922caea4
commit
942c0581d3
@ -1453,12 +1453,15 @@ public class CallController extends BaseController {
|
||||
.PeerConnectionEventType.SENSOR_FAR) ||
|
||||
peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.SENSOR_NEAR)) {
|
||||
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.SENSOR_FAR) && videoOn;
|
||||
if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(), PERMISSIONS_CAMERA) &&
|
||||
inCall && videoOn
|
||||
&& enableVideo != localVideoTrack.enabled()) {
|
||||
toggleMedia(enableVideo, true);
|
||||
|
||||
if (!isVoiceOnlyCall) {
|
||||
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.SENSOR_FAR) && videoOn;
|
||||
if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(), PERMISSIONS_CAMERA) &&
|
||||
inCall && videoOn
|
||||
&& enableVideo != localVideoTrack.enabled()) {
|
||||
toggleMedia(enableVideo, true);
|
||||
}
|
||||
}
|
||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.NICK_CHANGE)) {
|
||||
|
@ -176,7 +176,7 @@ public class MagicAudioManager {
|
||||
setAudioDeviceInternal(MagicAudioManager.AudioDevice.EARPIECE);
|
||||
|
||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
||||
.SENSOR_FAR, null, null, null));
|
||||
.SENSOR_NEAR, null, null, null));
|
||||
|
||||
} else {
|
||||
// Sensor reports that a "handset is removed from a person's ear", or
|
||||
@ -184,7 +184,7 @@ public class MagicAudioManager {
|
||||
setAudioDeviceInternal(MagicAudioManager.AudioDevice.SPEAKER_PHONE);
|
||||
|
||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
||||
.SENSOR_NEAR, null, null, null));
|
||||
.SENSOR_FAR, null, null, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user