refactor: discard offer messages from non-matching pre-offers we are already expecting

This commit is contained in:
Harris 2021-11-19 16:09:11 +11:00
parent 8e56f76fc1
commit 6100111b3b
1 changed files with 7 additions and 0 deletions

View File

@ -325,6 +325,13 @@ class WebRtcCallService: Service(), PeerConnection.Observer {
val callId = getCallId(intent)
val recipient = getRemoteRecipient(intent)
val preOffer = callManager.preOfferCallData
if (callManager.isPreOffer() && (preOffer == null || preOffer.callId != callId || preOffer.recipient != recipient)) {
Log.d(TAG, "Incoming ring from non-matching pre-offer")
return
}
val offer = intent.getStringExtra(EXTRA_REMOTE_DESCRIPTION) ?: return
val timestamp = intent.getLongExtra(EXTRA_TIMESTAMP, -1)
setCallInProgressNotification(TYPE_INCOMING_RINGING, recipient)