Search in sources :

Example 1 with IdentityDatabase

use of org.thoughtcrime.securesms.database.IdentityDatabase in project Signal-Android by WhisperSystems.

the class WebRtcCallActivity method handleUntrustedIdentity.

private void handleUntrustedIdentity(@NonNull WebRtcViewModel event) {
    final IdentityKey theirIdentity = event.getIdentityKey();
    final Recipient recipient = event.getRecipient();
    callScreen.setUntrustedIdentity(recipient, theirIdentity);
    callScreen.setAcceptIdentityListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            IdentityDatabase identityDatabase = DatabaseFactory.getIdentityDatabase(WebRtcCallActivity.this);
            identityDatabase.saveIdentity(recipient.getRecipientId(), theirIdentity);
            Intent intent = new Intent(WebRtcCallActivity.this, WebRtcCallService.class);
            intent.putExtra(WebRtcCallService.EXTRA_REMOTE_NUMBER, recipient.getNumber());
            intent.setAction(WebRtcCallService.ACTION_OUTGOING_CALL);
            startService(intent);
        }
    });
    callScreen.setCancelIdentityButton(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            handleTerminate(recipient);
        }
    });
}
Also used : WebRtcCallService(org.thoughtcrime.securesms.service.WebRtcCallService) IdentityKey(org.whispersystems.libsignal.IdentityKey) IdentityDatabase(org.thoughtcrime.securesms.database.IdentityDatabase) Recipient(org.thoughtcrime.securesms.recipients.Recipient) Intent(android.content.Intent) View(android.view.View)

Aggregations

Intent (android.content.Intent)1 View (android.view.View)1 IdentityDatabase (org.thoughtcrime.securesms.database.IdentityDatabase)1 Recipient (org.thoughtcrime.securesms.recipients.Recipient)1 WebRtcCallService (org.thoughtcrime.securesms.service.WebRtcCallService)1 IdentityKey (org.whispersystems.libsignal.IdentityKey)1