diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/NotificationService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java index 095abdee1..270005dc9 100644 --- a/src/main/java/de/pixart/messenger/services/NotificationService.java +++ b/src/main/java/de/pixart/messenger/services/NotificationService.java @@ -658,9 +658,13 @@ public class NotificationService { private void modifyForTextOnly(final Builder builder, final UnreadConversation.Builder uBuilder, final ArrayList<Message> messages) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - final Person me = new Person.Builder().setName(mXmppConnectionService.getString(R.string.me)).build(); - NotificationCompat.MessagingStyle messagingStyle = new NotificationCompat.MessagingStyle(me); final Conversation conversation = (Conversation) messages.get(0).getConversation(); + final Person.Builder meBuilder = new Person.Builder().setName(mXmppConnectionService.getString(R.string.me)); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + meBuilder.setIcon(IconCompat.createWithBitmap(mXmppConnectionService.getAvatarService().get(conversation.getAccount(), AvatarService.getSystemUiAvatarSize(mXmppConnectionService)))); + } + final Person me = meBuilder.build(); + NotificationCompat.MessagingStyle messagingStyle = new NotificationCompat.MessagingStyle(me); final boolean multiple = conversation.getMode() == Conversation.MODE_MULTI; if (multiple) { messagingStyle.setConversationTitle(conversation.getName()); |