Search in sources :

Example 1 with WebRtcViewModel

use of org.thoughtcrime.securesms.events.WebRtcViewModel in project Signal-Android by WhisperSystems.

the class WebRtcCallActivity method handleAnswerCall.

private void handleAnswerCall() {
    WebRtcViewModel event = EventBus.getDefault().getStickyEvent(WebRtcViewModel.class);
    if (event != null) {
        callScreen.setActiveCall(event.getRecipient(), getString(R.string.RedPhone_answering));
        Intent intent = new Intent(this, WebRtcCallService.class);
        intent.setAction(WebRtcCallService.ACTION_ANSWER_CALL);
        startService(intent);
    }
}
Also used : Intent(android.content.Intent) WebRtcViewModel(org.thoughtcrime.securesms.events.WebRtcViewModel)

Example 2 with WebRtcViewModel

use of org.thoughtcrime.securesms.events.WebRtcViewModel in project Signal-Android by signalapp.

the class WebRtcCallActivity method handleAnswerCall.

private void handleAnswerCall() {
    WebRtcViewModel event = EventBus.getDefault().getStickyEvent(WebRtcViewModel.class);
    if (event != null) {
        Permissions.with(this).request(Manifest.permission.RECORD_AUDIO, Manifest.permission.CAMERA).ifNecessary().withRationaleDialog(getString(R.string.WebRtcCallActivity_to_answer_the_call_from_s_give_signal_access_to_your_microphone, event.getRecipient().toShortString()), R.drawable.ic_mic_white_48dp, R.drawable.ic_videocam_white_48dp).withPermanentDenialDialog(getString(R.string.WebRtcCallActivity_signal_requires_microphone_and_camera_permissions_in_order_to_make_or_receive_calls)).onAllGranted(() -> {
            callScreen.setActiveCall(event.getRecipient(), getString(R.string.RedPhone_answering));
            Intent intent = new Intent(this, WebRtcCallService.class);
            intent.setAction(WebRtcCallService.ACTION_ANSWER_CALL);
            startService(intent);
        }).onAnyDenied(this::handleDenyCall).execute();
    }
}
Also used : Intent(android.content.Intent) WebRtcViewModel(org.thoughtcrime.securesms.events.WebRtcViewModel)

Example 3 with WebRtcViewModel

use of org.thoughtcrime.securesms.events.WebRtcViewModel in project Signal-Android by signalapp.

the class WebRtcCallActivity method handleDenyCall.

private void handleDenyCall() {
    WebRtcViewModel event = EventBus.getDefault().getStickyEvent(WebRtcViewModel.class);
    if (event != null) {
        Intent intent = new Intent(this, WebRtcCallService.class);
        intent.setAction(WebRtcCallService.ACTION_DENY_CALL);
        startService(intent);
        callScreen.setActiveCall(event.getRecipient(), getString(R.string.RedPhone_ending_call));
        delayedFinish();
    }
}
Also used : Intent(android.content.Intent) WebRtcViewModel(org.thoughtcrime.securesms.events.WebRtcViewModel)

Aggregations

Intent (android.content.Intent)3 WebRtcViewModel (org.thoughtcrime.securesms.events.WebRtcViewModel)3