put contact picture in incoming call notification

This commit is contained in:
Daniel Gultsch 2020-04-20 13:08:43 +02:00
parent df2ef0eeb0
commit 187dff3df9
2 changed files with 9 additions and 0 deletions

View file

@ -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);

View file

@ -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;