mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Add support for MISSED_VIDEO_CALL type.
This commit is contained in:
@@ -328,8 +328,8 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
|
||||
}
|
||||
}
|
||||
|
||||
public void insertMissedCall(@NonNull RemotePeer remotePeer, boolean signal, long timestamp) {
|
||||
Pair<Long, Long> messageAndThreadId = DatabaseFactory.getSmsDatabase(this).insertMissedCall(remotePeer.getId(), timestamp);
|
||||
public void insertMissedCall(@NonNull RemotePeer remotePeer, boolean signal, long timestamp, boolean isVideoOffer) {
|
||||
Pair<Long, Long> messageAndThreadId = DatabaseFactory.getSmsDatabase(this).insertMissedCall(remotePeer.getId(), timestamp, isVideoOffer);
|
||||
ApplicationDependencies.getMessageNotifier().updateNotification(this, messageAndThreadId.second(), signal);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ public class ActiveCallActionProcessorDelegate extends WebRtcActionProcessor {
|
||||
webRtcInteractor.stopForegroundService();
|
||||
}
|
||||
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp());
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
|
||||
return terminate(currentState, remotePeer);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class ActiveCallActionProcessorDelegate extends WebRtcActionProcessor {
|
||||
}
|
||||
|
||||
if (incomingBeforeAccept) {
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp());
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
}
|
||||
} else if (action.equals(ACTION_ENDED_REMOTE_BUSY) && remotePeerIsActive) {
|
||||
activePeer.receivedBusy();
|
||||
@@ -215,7 +215,7 @@ public class ActiveCallActionProcessorDelegate extends WebRtcActionProcessor {
|
||||
ringer.start(OutgoingRinger.Type.BUSY);
|
||||
Util.runOnMainDelayed(ringer::stop, BUSY_TONE_LENGTH);
|
||||
} else if (action.equals(ACTION_ENDED_REMOTE_GLARE) && incomingBeforeAccept) {
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp());
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
}
|
||||
|
||||
currentState = currentState.builder()
|
||||
@@ -242,7 +242,7 @@ public class ActiveCallActionProcessorDelegate extends WebRtcActionProcessor {
|
||||
}
|
||||
|
||||
if (remotePeer.getState() == CallState.ANSWERING || remotePeer.getState() == CallState.LOCAL_RINGING) {
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp());
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
}
|
||||
|
||||
return terminate(currentState, remotePeer);
|
||||
@@ -273,7 +273,7 @@ public class ActiveCallActionProcessorDelegate extends WebRtcActionProcessor {
|
||||
webRtcInteractor.sendMessage(currentState);
|
||||
|
||||
if (activePeer.getState() == CallState.ANSWERING || activePeer.getState() == CallState.LOCAL_RINGING) {
|
||||
webRtcInteractor.insertMissedCall(activePeer, true, activePeer.getCallStartTimestamp());
|
||||
webRtcInteractor.insertMissedCall(activePeer, true, activePeer.getCallStartTimestamp(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
}
|
||||
|
||||
return terminate(currentState, activePeer);
|
||||
|
||||
@@ -136,7 +136,7 @@ public class IncomingCallActionProcessor extends DeviceAwareActionProcessor {
|
||||
|
||||
try {
|
||||
webRtcInteractor.getCallManager().hangup();
|
||||
DatabaseFactory.getSmsDatabase(context).insertMissedCall(activePeer.getId(), System.currentTimeMillis());
|
||||
DatabaseFactory.getSmsDatabase(context).insertMissedCall(activePeer.getId(), System.currentTimeMillis(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
return terminate(currentState, activePeer);
|
||||
} catch (CallException e) {
|
||||
return callFailure(currentState, "hangup() failed: ", e);
|
||||
|
||||
@@ -284,14 +284,14 @@ public abstract class WebRtcActionProcessor {
|
||||
if (TelephonyUtil.isAnyPstnLineBusy(context)) {
|
||||
Log.i(tag, "PSTN line is busy.");
|
||||
currentState = currentState.getActionProcessor().handleSendBusy(currentState, callMetadata, true);
|
||||
webRtcInteractor.insertMissedCall(callMetadata.getRemotePeer(), true, receivedOfferMetadata.getServerReceivedTimestamp());
|
||||
webRtcInteractor.insertMissedCall(callMetadata.getRemotePeer(), true, receivedOfferMetadata.getServerReceivedTimestamp(), offerMetadata.getOfferType() == OfferMessage.Type.VIDEO_CALL);
|
||||
return currentState;
|
||||
}
|
||||
|
||||
if (!RecipientUtil.isCallRequestAccepted(context.getApplicationContext(), callMetadata.getRemotePeer().getRecipient())) {
|
||||
Log.w(tag, "Caller is untrusted.");
|
||||
currentState = currentState.getActionProcessor().handleSendHangup(currentState, callMetadata, WebRtcData.HangupMetadata.fromType(HangupMessage.Type.NEED_PERMISSION), true);
|
||||
webRtcInteractor.insertMissedCall(callMetadata.getRemotePeer(), true, receivedOfferMetadata.getServerReceivedTimestamp());
|
||||
webRtcInteractor.insertMissedCall(callMetadata.getRemotePeer(), true, receivedOfferMetadata.getServerReceivedTimestamp(), offerMetadata.getOfferType() == OfferMessage.Type.VIDEO_CALL);
|
||||
return currentState;
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ public abstract class WebRtcActionProcessor {
|
||||
{
|
||||
Log.i(tag, "handleReceivedOfferExpired(): call_id: " + remotePeer.getCallId());
|
||||
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp());
|
||||
webRtcInteractor.insertMissedCall(remotePeer, true, remotePeer.getCallStartTimestamp(), currentState.getCallSetupState().isRemoteVideoOffer());
|
||||
|
||||
return terminate(currentState, remotePeer);
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ public class WebRtcInteractor {
|
||||
webRtcCallService.stopForeground(true);
|
||||
}
|
||||
|
||||
void insertMissedCall(@NonNull RemotePeer remotePeer, boolean signal, long timestamp) {
|
||||
webRtcCallService.insertMissedCall(remotePeer, signal, timestamp);
|
||||
void insertMissedCall(@NonNull RemotePeer remotePeer, boolean signal, long timestamp, boolean isVideoOffer) {
|
||||
webRtcCallService.insertMissedCall(remotePeer, signal, timestamp, isVideoOffer);
|
||||
}
|
||||
|
||||
void startWebRtcCallActivityIfPossible() {
|
||||
|
||||
Reference in New Issue
Block a user