Only play raise hand sound if no other hands are raised.
This commit is contained in:
parent
4afffc7dd3
commit
5fef60c2b0
1 changed files with 6 additions and 2 deletions
|
@ -260,7 +260,7 @@ public class GroupConnectedActionProcessor extends GroupActionProcessor {
|
|||
protected @NonNull WebRtcServiceState handleGroupCallRaisedHand(@NonNull WebRtcServiceState currentState, List<Long> raisedHands) {
|
||||
Log.i(TAG, "handleGroupCallRaisedHand():");
|
||||
|
||||
boolean playSound = false;
|
||||
boolean playSound = !raisedHands.isEmpty();
|
||||
long now = System.currentTimeMillis();
|
||||
WebRtcServiceStateBuilder.CallInfoStateBuilder builder = currentState.builder().changeCallInfoState();
|
||||
Long localDemuxId = currentState.getCallInfoState().requireGroupCall().getLocalDeviceState().getDemuxId();
|
||||
|
@ -270,9 +270,13 @@ public class GroupConnectedActionProcessor extends GroupActionProcessor {
|
|||
for (CallParticipant updatedParticipant : participants) {
|
||||
int raisedHandIndex = raisedHands.indexOf(updatedParticipant.getCallParticipantId().getDemuxId());
|
||||
boolean wasHandAlreadyRaised = updatedParticipant.isHandRaised();
|
||||
|
||||
if (wasHandAlreadyRaised) {
|
||||
playSound = false;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue