Add pre-join vanity view for 1:1 video calls.

This commit is contained in:
Cody Henthorne
2020-09-18 15:51:17 -04:00
committed by Greyson Parrelli
parent cd2467085e
commit a8415a3484
15 changed files with 353 additions and 167 deletions

View File

@@ -81,16 +81,7 @@ public class CommunicationActions {
WebRtcCallService.isCallActive(activity, new ResultReceiver(new Handler(Looper.getMainLooper())) {
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
if (resultCode == 1) {
startCallInternal(activity, recipient, false);
} else {
new AlertDialog.Builder(activity)
.setMessage(R.string.CommunicationActions_start_video_call)
.setPositiveButton(R.string.CommunicationActions_call, (d, w) -> startCallInternal(activity, recipient, true))
.setNegativeButton(R.string.CommunicationActions_cancel, (d, w) -> d.dismiss())
.setCancelable(true)
.show();
}
startCallInternal(activity, recipient, resultCode != 1);
}
});
}
@@ -268,13 +259,11 @@ public class CommunicationActions {
.withPermanentDenialDialog(activity.getString(R.string.ConversationActivity_signal_needs_the_microphone_and_camera_permissions_in_order_to_call_s, recipient.getDisplayName(activity)))
.onAllGranted(() -> {
Intent intent = new Intent(activity, WebRtcCallService.class);
intent.setAction(WebRtcCallService.ACTION_OUTGOING_CALL)
intent.setAction(WebRtcCallService.ACTION_PRE_JOIN_CALL)
.putExtra(WebRtcCallService.EXTRA_REMOTE_PEER, new RemotePeer(recipient.getId()))
.putExtra(WebRtcCallService.EXTRA_OFFER_TYPE, OfferMessage.Type.VIDEO_CALL.getCode());
activity.startService(intent);
MessageSender.onMessageSent();
Intent activityIntent = new Intent(activity, WebRtcCallActivity.class);
activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)