mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Implement 1:1 call mutes state.
This commit is contained in:
committed by
Greyson Parrelli
parent
23ad23c341
commit
e840efcecc
@@ -67,6 +67,10 @@ data class CallParticipant(
|
||||
return copy(identityKey = identityKey)
|
||||
}
|
||||
|
||||
fun withAudioEnabled(audioEnabled: Boolean): CallParticipant {
|
||||
return copy(isMicrophoneEnabled = audioEnabled)
|
||||
}
|
||||
|
||||
fun withVideoEnabled(videoEnabled: Boolean): CallParticipant {
|
||||
return copy(isVideoEnabled = videoEnabled)
|
||||
}
|
||||
|
||||
@@ -56,6 +56,21 @@ public class ActiveCallActionProcessorDelegate extends WebRtcActionProcessor {
|
||||
return currentState;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteAudioEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
|
||||
|
||||
Log.i(tag, "handleRemoteAudioEnable(): call_id: " + activePeer.getCallId());
|
||||
|
||||
CallParticipant oldParticipant = Objects.requireNonNull(currentState.getCallInfoState().getRemoteCallParticipant(activePeer.getRecipient()));
|
||||
CallParticipant newParticipant = oldParticipant.withAudioEnabled(enable);
|
||||
|
||||
return currentState.builder()
|
||||
.changeCallInfoState()
|
||||
.putParticipant(activePeer.getRecipient(), newParticipant)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
|
||||
|
||||
@@ -110,6 +110,11 @@ public class ConnectedCallActionProcessor extends DeviceAwareActionProcessor {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteAudioEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
return activeCallDelegate.handleRemoteAudioEnable(currentState, enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
return activeCallDelegate.handleRemoteVideoEnable(currentState, enable);
|
||||
|
||||
@@ -232,6 +232,11 @@ public class IncomingCallActionProcessor extends DeviceAwareActionProcessor {
|
||||
return currentState;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteAudioEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
return activeCallDelegate.handleRemoteAudioEnable(currentState, enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
return activeCallDelegate.handleRemoteVideoEnable(currentState, enable);
|
||||
|
||||
@@ -233,6 +233,11 @@ public class OutgoingCallActionProcessor extends DeviceAwareActionProcessor {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteAudioEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
return activeCallDelegate.handleRemoteAudioEnable(currentState, enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
return activeCallDelegate.handleRemoteVideoEnable(currentState, enable);
|
||||
|
||||
@@ -616,11 +616,9 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
|
||||
case REMOTE_CONNECTED:
|
||||
return p.handleCallConnected(s, remotePeer);
|
||||
case REMOTE_AUDIO_ENABLE:
|
||||
// TODO: Implement handling when the remote enables audio.
|
||||
break;
|
||||
return p.handleRemoteAudioEnable(s, true);
|
||||
case REMOTE_AUDIO_DISABLE:
|
||||
// TODO: Implement handling when the remote disables audio.
|
||||
break;
|
||||
return p.handleRemoteAudioEnable(s, false);
|
||||
case REMOTE_VIDEO_ENABLE:
|
||||
return p.handleRemoteVideoEnable(s, true);
|
||||
case REMOTE_VIDEO_DISABLE:
|
||||
|
||||
@@ -375,6 +375,11 @@ public abstract class WebRtcActionProcessor {
|
||||
.build();
|
||||
}
|
||||
|
||||
protected @NonNull WebRtcServiceState handleRemoteAudioEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
Log.i(tag, "handleRemoteAudioEnable not processed");
|
||||
return currentState;
|
||||
}
|
||||
|
||||
protected @NonNull WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
|
||||
Log.i(tag, "handleRemoteVideoEnable not processed");
|
||||
return currentState;
|
||||
|
||||
Reference in New Issue
Block a user