Remove restriction on proximity lock in landscape calling.

This commit is contained in:
Alex Hart
2025-08-15 16:34:36 -03:00
committed by Jeffrey Starke
parent dfdadc9d7a
commit 8992ed047d
2 changed files with 5 additions and 28 deletions

View File

@@ -24,7 +24,6 @@ import org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper;
import org.thoughtcrime.securesms.components.webrtc.GroupCallSafetyNumberChangeNotificationUtil;
import org.thoughtcrime.securesms.database.CallTable;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.dependencies.AppDependencies;
import org.thoughtcrime.securesms.events.CallParticipant;
import org.thoughtcrime.securesms.events.WebRtcViewModel;
import org.thoughtcrime.securesms.groups.GroupId;
@@ -618,10 +617,6 @@ public abstract class WebRtcActionProcessor {
callParticipant.getVideoSink().setDeviceOrientationDegrees(sinkRotationDegrees);
}
AppDependencies.getSignalCallManager()
.getLockManager()
.updateOrientation(Orientation.fromDegrees(orientationDegrees));
return currentState.builder()
.changeLocalDeviceState()
.setOrientation(Orientation.fromDegrees(stateRotationDegrees))

View File

@@ -3,12 +3,8 @@ package org.thoughtcrime.securesms.webrtc.locks;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.os.PowerManager;
import android.provider.Settings;
import androidx.annotation.NonNull;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.components.sensors.Orientation;
/**
* Maintains wake lock state.
@@ -19,14 +15,11 @@ public class LockManager {
private static final String TAG = Log.tag(LockManager.class);
private final PowerManager.WakeLock fullLock;
private final PowerManager.WakeLock partialLock;
private final WifiManager.WifiLock wifiLock;
private final ProximityLock proximityLock;
private final PowerManager.WakeLock fullLock;
private final PowerManager.WakeLock partialLock;
private final WifiManager.WifiLock wifiLock;
private final ProximityLock proximityLock;
private PhoneState phoneState = PhoneState.IDLE;
private Orientation orientation = Orientation.PORTRAIT_BOTTOM_EDGE;
private boolean proximityDisabled = false;
public enum PhoneState {
@@ -60,25 +53,14 @@ public class LockManager {
}
private void updateInCallLockState() {
if (orientation == Orientation.PORTRAIT_BOTTOM_EDGE && !proximityDisabled) {
if (!proximityDisabled) {
setLockState(LockState.PROXIMITY);
} else {
setLockState(LockState.FULL);
}
}
public void updateOrientation(@NonNull Orientation orientation) {
Log.d(TAG, "Update orientation: " + orientation);
this.orientation = orientation;
if (phoneState == PhoneState.IN_CALL || phoneState == PhoneState.IN_VIDEO) {
updateInCallLockState();
}
}
public void updatePhoneState(PhoneState state) {
this.phoneState = state;
switch(state) {
case IDLE:
setLockState(LockState.SLEEP);