From 187dff3df930dba56c3166e0aa1ef8f62331016c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 20 Apr 2020 13:08:43 +0200 Subject: [PATCH] put contact picture in incoming call notification --- .../eu/siacs/conversations/services/NotificationService.java | 4 ++++ .../conversations/xmpp/jingle/AbstractJingleConnection.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 9f1617b56..ac1efaaca 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -351,6 +351,10 @@ public class NotificationService { builder.setSmallIcon(R.drawable.ic_call_white_24dp); builder.setContentTitle(mXmppConnectionService.getString(R.string.rtp_state_incoming_call)); } + builder.setLargeIcon(mXmppConnectionService.getAvatarService().get( + id.getContact(), + AvatarService.getSystemUiAvatarSize(mXmppConnectionService)) + ); builder.setContentText(id.account.getRoster().getContact(id.with).getDisplayName()); builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC); builder.setPriority(NotificationCompat.PRIORITY_HIGH); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java index b6e160898..088b4fc17 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java @@ -4,6 +4,7 @@ import com.google.common.base.Objects; import com.google.common.base.Preconditions; import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; @@ -68,6 +69,10 @@ public abstract class AbstractJingleConnection { ); } + public Contact getContact() { + return account.getRoster().getContact(with); + } + @Override public boolean equals(Object o) { if (this == o) return true;