mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Play sound for raised hand.
This commit is contained in:
committed by
Clark Chen
parent
b4f2208bae
commit
1b9cf631be
@@ -259,6 +259,8 @@ public class GroupConnectedActionProcessor extends GroupActionProcessor {
|
||||
@Override
|
||||
protected @NonNull WebRtcServiceState handleGroupCallRaisedHand(@NonNull WebRtcServiceState currentState, List<Long> raisedHands) {
|
||||
Log.i(TAG, "handleGroupCallRaisedHand():");
|
||||
|
||||
boolean playSound = false;
|
||||
long now = System.currentTimeMillis();
|
||||
WebRtcServiceStateBuilder.CallInfoStateBuilder builder = currentState.builder().changeCallInfoState();
|
||||
Long localDemuxId = currentState.getCallInfoState().requireGroupCall().getLocalDeviceState().getDemuxId();
|
||||
@@ -270,6 +272,7 @@ public class GroupConnectedActionProcessor extends GroupActionProcessor {
|
||||
boolean wasHandAlreadyRaised = updatedParticipant.isHandRaised();
|
||||
if (raisedHandIndex >= 0 && !wasHandAlreadyRaised) {
|
||||
builder.putParticipant(updatedParticipant.getCallParticipantId(), updatedParticipant.withHandRaisedTimestamp(now + raisedHandIndex));
|
||||
playSound = true;
|
||||
} else if (raisedHandIndex < 0 && wasHandAlreadyRaised) {
|
||||
builder.putParticipant(updatedParticipant.getCallParticipantId(), updatedParticipant.withHandRaisedTimestamp(CallParticipant.HAND_LOWERED));
|
||||
}
|
||||
@@ -290,6 +293,10 @@ public class GroupConnectedActionProcessor extends GroupActionProcessor {
|
||||
new CallParticipantId(localDemuxId, Recipient.self().getId())));
|
||||
}
|
||||
}
|
||||
if (playSound) {
|
||||
webRtcInteractor.playStateChangeUp();
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,10 @@ public class WebRtcInteractor {
|
||||
WebRtcCallService.sendAudioManagerCommand(context, new AudioManagerCommand.SetDefaultDevice(recipientId, userDevice, clearUserEarpieceSelection));
|
||||
}
|
||||
|
||||
public void playStateChangeUp() {
|
||||
WebRtcCallService.sendAudioManagerCommand(context, new AudioManagerCommand.PlayStateChangeUp());
|
||||
}
|
||||
|
||||
void peekGroupCallForRingingCheck(@NonNull GroupCallRingCheckInfo groupCallRingCheckInfo) {
|
||||
signalCallManager.peekGroupCallForRingingCheck(groupCallRingCheckInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user