mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +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,6 +1453,8 @@ public class CallController extends BaseController {
|
|||||||
.PeerConnectionEventType.SENSOR_FAR) ||
|
.PeerConnectionEventType.SENSOR_FAR) ||
|
||||||
peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||||
.PeerConnectionEventType.SENSOR_NEAR)) {
|
.PeerConnectionEventType.SENSOR_NEAR)) {
|
||||||
|
|
||||||
|
if (!isVoiceOnlyCall) {
|
||||||
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||||
.PeerConnectionEventType.SENSOR_FAR) && videoOn;
|
.PeerConnectionEventType.SENSOR_FAR) && videoOn;
|
||||||
if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(), PERMISSIONS_CAMERA) &&
|
if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(), PERMISSIONS_CAMERA) &&
|
||||||
@ -1460,6 +1462,7 @@ public class CallController extends BaseController {
|
|||||||
&& enableVideo != localVideoTrack.enabled()) {
|
&& enableVideo != localVideoTrack.enabled()) {
|
||||||
toggleMedia(enableVideo, true);
|
toggleMedia(enableVideo, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||||
.PeerConnectionEventType.NICK_CHANGE)) {
|
.PeerConnectionEventType.NICK_CHANGE)) {
|
||||||
gotNick(peerConnectionEvent.getSessionId(), peerConnectionEvent.getNick());
|
gotNick(peerConnectionEvent.getSessionId(), peerConnectionEvent.getNick());
|
||||||
|
@ -176,7 +176,7 @@ public class MagicAudioManager {
|
|||||||
setAudioDeviceInternal(MagicAudioManager.AudioDevice.EARPIECE);
|
setAudioDeviceInternal(MagicAudioManager.AudioDevice.EARPIECE);
|
||||||
|
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
||||||
.SENSOR_FAR, null, null, null));
|
.SENSOR_NEAR, null, null, null));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Sensor reports that a "handset is removed from a person's ear", or
|
// 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);
|
setAudioDeviceInternal(MagicAudioManager.AudioDevice.SPEAKER_PHONE);
|
||||||
|
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
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