RingRTC v2.4.0 Release Integration.

Co-authored-by: Peter Thatcher <peter@signal.org>
This commit is contained in:
Jim Gustafson
2020-07-29 20:07:05 -07:00
committed by Greyson Parrelli
parent 550b121990
commit a942293a74
11 changed files with 154 additions and 108 deletions

View File

@@ -304,7 +304,7 @@ dependencies {
implementation 'org.signal:argon2:13.1@aar'
implementation 'org.signal:ringrtc-android:2.3.1'
implementation 'org.signal:ringrtc-android:2.4.1'
implementation "me.leolin:ShortcutBadger:1.1.16"
implementation 'se.emilsjolander:stickylistheaders:2.7.0'

View File

@@ -508,7 +508,8 @@ public final class PushProcessMessageJob extends BaseJob {
.putExtra(WebRtcCallService.EXTRA_CALL_ID, message.getId())
.putExtra(WebRtcCallService.EXTRA_REMOTE_PEER, remotePeer)
.putExtra(WebRtcCallService.EXTRA_REMOTE_DEVICE, content.getSenderDevice())
.putExtra(WebRtcCallService.EXTRA_OFFER_DESCRIPTION, message.getDescription())
.putExtra(WebRtcCallService.EXTRA_OFFER_OPAQUE, message.getOpaque())
.putExtra(WebRtcCallService.EXTRA_OFFER_SDP, message.getSdp())
.putExtra(WebRtcCallService.EXTRA_SERVER_RECEIVED_TIMESTAMP, content.getServerReceivedTimestamp())
.putExtra(WebRtcCallService.EXTRA_SERVER_DELIVERED_TIMESTAMP, content.getServerDeliveredTimestamp())
.putExtra(WebRtcCallService.EXTRA_OFFER_TYPE, message.getType().getCode())
@@ -527,11 +528,12 @@ public final class PushProcessMessageJob extends BaseJob {
RemotePeer remotePeer = new RemotePeer(Recipient.externalHighTrustPush(context, content.getSender()).getId());
intent.setAction(WebRtcCallService.ACTION_RECEIVE_ANSWER)
.putExtra(WebRtcCallService.EXTRA_CALL_ID, message.getId())
.putExtra(WebRtcCallService.EXTRA_REMOTE_PEER, remotePeer)
.putExtra(WebRtcCallService.EXTRA_REMOTE_DEVICE, content.getSenderDevice())
.putExtra(WebRtcCallService.EXTRA_ANSWER_DESCRIPTION, message.getDescription())
.putExtra(WebRtcCallService.EXTRA_MULTI_RING, content.getCallMessage().get().isMultiRing());
.putExtra(WebRtcCallService.EXTRA_CALL_ID, message.getId())
.putExtra(WebRtcCallService.EXTRA_REMOTE_PEER, remotePeer)
.putExtra(WebRtcCallService.EXTRA_REMOTE_DEVICE, content.getSenderDevice())
.putExtra(WebRtcCallService.EXTRA_ANSWER_OPAQUE, message.getOpaque())
.putExtra(WebRtcCallService.EXTRA_ANSWER_SDP, message.getSdp())
.putExtra(WebRtcCallService.EXTRA_MULTI_RING, content.getCallMessage().get().isMultiRing());
context.startService(intent);
}

View File

@@ -4,9 +4,11 @@ import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import org.signal.ringrtc.CallId;
import com.google.protobuf.ByteString;
import org.signal.ringrtc.CallId;
import org.signal.ringrtc.IceCandidate;
import org.webrtc.IceCandidate;
import org.whispersystems.signalservice.api.messages.calls.IceUpdateMessage;
/**
@@ -24,14 +26,11 @@ public class IceCandidateParcel implements Parcelable {
}
public IceCandidateParcel(@NonNull IceUpdateMessage iceUpdateMessage) {
this.iceCandidate = new IceCandidate(iceUpdateMessage.getSdpMid(),
iceUpdateMessage.getSdpMLineIndex(),
iceUpdateMessage.getSdp());
this.iceCandidate = new IceCandidate(iceUpdateMessage.getOpaque(), iceUpdateMessage.getSdp());
}
private IceCandidateParcel(@NonNull Parcel in) {
this.iceCandidate = new IceCandidate(in.readString(),
in.readInt(),
this.iceCandidate = new IceCandidate(in.createByteArray(),
in.readString());
}
@@ -41,9 +40,8 @@ public class IceCandidateParcel implements Parcelable {
public @NonNull IceUpdateMessage getIceUpdateMessage(@NonNull CallId callId) {
return new IceUpdateMessage(callId.longValue(),
iceCandidate.sdpMid,
iceCandidate.sdpMLineIndex,
iceCandidate.sdp);
iceCandidate.getOpaque(),
iceCandidate.getSdp());
}
@Override
@@ -53,9 +51,8 @@ public class IceCandidateParcel implements Parcelable {
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeString(iceCandidate.sdpMid);
dest.writeInt(iceCandidate.sdpMLineIndex);
dest.writeString(iceCandidate.sdp);
dest.writeByteArray(iceCandidate.getOpaque());
dest.writeString(iceCandidate.getSdp());
}
public static final Creator<IceCandidateParcel> CREATOR = new Creator<IceCandidateParcel>() {

View File

@@ -17,11 +17,14 @@ import android.util.Pair;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.protobuf.ByteString;
import org.greenrobot.eventbus.EventBus;
import org.signal.ringrtc.CallException;
import org.signal.ringrtc.CallId;
import org.signal.ringrtc.CallManager;
import org.signal.ringrtc.CallManager.CallEvent;
import org.signal.ringrtc.IceCandidate;
import org.signal.ringrtc.Remote;
import org.thoughtcrime.securesms.ApplicationContext;
import org.thoughtcrime.securesms.WebRtcCallActivity;
@@ -56,7 +59,6 @@ import org.thoughtcrime.securesms.webrtc.audio.OutgoingRinger;
import org.thoughtcrime.securesms.webrtc.audio.SignalAudioManager;
import org.thoughtcrime.securesms.webrtc.locks.LockManager;
import org.webrtc.EglBase;
import org.webrtc.IceCandidate;
import org.webrtc.PeerConnection;
import org.whispersystems.libsignal.IdentityKey;
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
@@ -105,13 +107,15 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
public static final String EXTRA_BLUETOOTH = "audio_bluetooth";
public static final String EXTRA_REMOTE_PEER = "remote_peer";
public static final String EXTRA_REMOTE_DEVICE = "remote_device";
public static final String EXTRA_OFFER_DESCRIPTION = "offer_description";
public static final String EXTRA_OFFER_OPAQUE = "offer_opaque";
public static final String EXTRA_OFFER_SDP = "offer_sdp";
public static final String EXTRA_OFFER_TYPE = "offer_type";
public static final String EXTRA_MULTI_RING = "multi_ring";
public static final String EXTRA_HANGUP_TYPE = "hangup_type";
public static final String EXTRA_HANGUP_IS_LEGACY = "hangup_is_legacy";
public static final String EXTRA_HANGUP_DEVICE_ID = "hangup_device_id";
public static final String EXTRA_ANSWER_DESCRIPTION = "answer_description";
public static final String EXTRA_ANSWER_OPAQUE = "answer_opaque";
public static final String EXTRA_ANSWER_SDP = "answer_sdp";
public static final String EXTRA_ICE_CANDIDATES = "ice_candidates";
public static final String EXTRA_ENABLE = "enable_value";
public static final String EXTRA_BROADCAST = "broadcast";
@@ -389,7 +393,8 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
CallId callId = getCallId(intent);
RemotePeer remotePeer = getRemotePeer(intent);
Integer remoteDevice = intent.getIntExtra(EXTRA_REMOTE_DEVICE, -1);
String offer = intent.getStringExtra(EXTRA_OFFER_DESCRIPTION);
byte[] opaque = intent.getByteArrayExtra(EXTRA_OFFER_OPAQUE);
String sdp = intent.getStringExtra(EXTRA_OFFER_SDP);
long serverReceivedTimestamp = intent.getLongExtra(EXTRA_SERVER_RECEIVED_TIMESTAMP, -1);
long serverDeliveredTimestamp = intent.getLongExtra(EXTRA_SERVER_DELIVERED_TIMESTAMP, -1);
OfferMessage.Type offerType = OfferMessage.Type.fromCode(intent.getStringExtra(EXTRA_OFFER_TYPE));
@@ -422,7 +427,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
Log.i(TAG, "handleReceivedOffer(): messageAgeSec: " + messageAgeSec + ", serverReceivedTimestamp: " + serverReceivedTimestamp + ", serverDeliveredTimestamp: " + serverDeliveredTimestamp);
try {
callManager.receivedOffer(callId, remotePeer, remoteDevice, offer, messageAgeSec, callType, 1, isMultiRing, true);
callManager.receivedOffer(callId, remotePeer, remoteDevice, opaque, sdp, messageAgeSec, callType, 1, isMultiRing, true);
} catch (CallException e) {
callFailure("Unable to process received offer: ", e);
}
@@ -620,9 +625,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
camera,
iceServers,
isAlwaysTurn,
deviceList,
enableVideoOnCreate,
true);
enableVideoOnCreate);
} catch (CallException e) {
callFailure("Unable to proceed with call: ", e);
}
@@ -664,9 +667,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
camera,
iceServers,
hideIp,
deviceList,
false,
true);
false);
} catch (CallException e) {
callFailure("Unable to proceed with call: ", e);
}
@@ -704,12 +705,13 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
CallId callId = getCallId(intent);
Integer remoteDevice = intent.getIntExtra(EXTRA_REMOTE_DEVICE, -1);
boolean broadcast = intent.getBooleanExtra(EXTRA_BROADCAST, false);
String offer = intent.getStringExtra(EXTRA_OFFER_DESCRIPTION);
byte[] opaque = intent.getByteArrayExtra(EXTRA_OFFER_OPAQUE);
String sdp = intent.getStringExtra(EXTRA_OFFER_SDP);
OfferMessage.Type offerType = OfferMessage.Type.fromCode(intent.getStringExtra(EXTRA_OFFER_TYPE));
Log.i(TAG, "handleSendOffer: id: " + callId.format(remoteDevice));
OfferMessage offerMessage = new OfferMessage(callId.longValue(), offer, offerType);
OfferMessage offerMessage = new OfferMessage(callId.longValue(), sdp, offerType, opaque);
Integer destinationDeviceId = broadcast ? null : remoteDevice;
SignalServiceCallMessage callMessage = SignalServiceCallMessage.forOffer(offerMessage, true, destinationDeviceId);
@@ -721,11 +723,12 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
CallId callId = getCallId(intent);
Integer remoteDevice = intent.getIntExtra(EXTRA_REMOTE_DEVICE, -1);
boolean broadcast = intent.getBooleanExtra(EXTRA_BROADCAST, false);
String answer = intent.getStringExtra(EXTRA_ANSWER_DESCRIPTION);
byte[] opaque = intent.getByteArrayExtra(EXTRA_ANSWER_OPAQUE);
String sdp = intent.getStringExtra(EXTRA_ANSWER_SDP);
Log.i(TAG, "handleSendAnswer: id: " + callId.format(remoteDevice));
AnswerMessage answerMessage = new AnswerMessage(callId.longValue(), answer);
AnswerMessage answerMessage = new AnswerMessage(callId.longValue(), sdp, opaque);
Integer destinationDeviceId = broadcast ? null : remoteDevice;
SignalServiceCallMessage callMessage = SignalServiceCallMessage.forAnswer(answerMessage, true, destinationDeviceId);
@@ -788,13 +791,14 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
private void handleReceivedAnswer(Intent intent) {
CallId callId = getCallId(intent);
Integer remoteDevice = intent.getIntExtra(EXTRA_REMOTE_DEVICE, -1);
String description = intent.getStringExtra(EXTRA_ANSWER_DESCRIPTION);
byte[] opaque = intent.getByteArrayExtra(EXTRA_ANSWER_OPAQUE);
String sdp = intent.getStringExtra(EXTRA_ANSWER_SDP);
boolean isMultiRing = intent.getBooleanExtra(EXTRA_MULTI_RING, false);
Log.i(TAG, "handleReceivedAnswer(): id: " + callId.format(remoteDevice));
try {
callManager.receivedAnswer(callId, remoteDevice, description , isMultiRing);
callManager.receivedAnswer(callId, remoteDevice, opaque, sdp, isMultiRing);
} catch (CallException e) {
callFailure("receivedAnswer() failed: ", e);
}
@@ -1802,7 +1806,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
}
@Override
public void onSendOffer(CallId callId, Remote remote, Integer remoteDevice, Boolean broadcast, String offer, CallManager.CallMediaType callMediaType) {
public void onSendOffer(CallId callId, Remote remote, Integer remoteDevice, Boolean broadcast, byte[] opaque, String sdp, CallManager.CallMediaType callMediaType) {
Log.i(TAG, "onSendOffer: id: " + callId.format(remoteDevice) + " type: " + callMediaType.name());
if (remote instanceof RemotePeer) {
@@ -1811,12 +1815,13 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
Intent intent = new Intent(this, WebRtcCallService.class);
intent.setAction(ACTION_SEND_OFFER)
.putExtra(EXTRA_CALL_ID, callId.longValue())
.putExtra(EXTRA_REMOTE_PEER, remotePeer)
.putExtra(EXTRA_REMOTE_DEVICE, remoteDevice)
.putExtra(EXTRA_BROADCAST, broadcast)
.putExtra(EXTRA_OFFER_DESCRIPTION, offer)
.putExtra(EXTRA_OFFER_TYPE, offerType);
.putExtra(EXTRA_CALL_ID, callId.longValue())
.putExtra(EXTRA_REMOTE_PEER, remotePeer)
.putExtra(EXTRA_REMOTE_DEVICE, remoteDevice)
.putExtra(EXTRA_BROADCAST, broadcast)
.putExtra(EXTRA_OFFER_OPAQUE, opaque)
.putExtra(EXTRA_OFFER_SDP, sdp)
.putExtra(EXTRA_OFFER_TYPE, offerType);
startService(intent);
} else {
@@ -1825,7 +1830,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
}
@Override
public void onSendAnswer(CallId callId, Remote remote, Integer remoteDevice, Boolean broadcast, String answer) {
public void onSendAnswer(CallId callId, Remote remote, Integer remoteDevice, Boolean broadcast, byte[] opaque, String sdp) {
Log.i(TAG, "onSendAnswer: id: " + callId.format(remoteDevice));
if (remote instanceof RemotePeer) {
@@ -1833,11 +1838,12 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
Intent intent = new Intent(this, WebRtcCallService.class);
intent.setAction(ACTION_SEND_ANSWER)
.putExtra(EXTRA_CALL_ID, callId.longValue())
.putExtra(EXTRA_REMOTE_PEER, remotePeer)
.putExtra(EXTRA_REMOTE_DEVICE, remoteDevice)
.putExtra(EXTRA_BROADCAST, broadcast)
.putExtra(EXTRA_ANSWER_DESCRIPTION, answer);
.putExtra(EXTRA_CALL_ID, callId.longValue())
.putExtra(EXTRA_REMOTE_PEER, remotePeer)
.putExtra(EXTRA_REMOTE_DEVICE, remoteDevice)
.putExtra(EXTRA_BROADCAST, broadcast)
.putExtra(EXTRA_ANSWER_OPAQUE, opaque)
.putExtra(EXTRA_ANSWER_SDP, sdp);
startService(intent);
} else {

View File

@@ -432,8 +432,8 @@ dependencyVerification {
['org.signal:argon2:13.1',
'0f686ccff0d4842bfcc74d92e8dc780a5f159b9376e37a1189fabbcdac458bef'],
['org.signal:ringrtc-android:2.3.1',
'2860e38b3e01c25ff23abdb848bd3fd772ffddb4387ea7838b71e2400da1648d'],
['org.signal:ringrtc-android:2.4.1',
'd120bb238d8435ab442a40e72d641f1fedc4492cc0eee894a1a63b7a17f2f126'],
['org.signal:signal-metadata-java:0.1.2',
'6aaeb6a33bf3161a3e6ac9db7678277f7a4cf5a2c96b84342e4007ee49bab1bd'],