diff options
| author | Mady Mellor <madym@google.com> | 2020-01-29 11:41:58 -0800 |
|---|---|---|
| committer | Mady Mellor <madym@google.com> | 2020-01-29 11:51:27 -0800 |
| commit | 726df929e15bfe51350c16a334ca5394458c876d (patch) | |
| tree | 6cb8f349c2f1f1ff91a9314905c48cd23011c4c5 /core/java/android/app/Notification.java | |
| parent | d21c45fc95c64e3139016954bb099e057299037b (diff) | |
Make sure we visit the icon URIs of Person objects on Notifications
Test: manual - have bubbles test app with uri based icons, send notifs,
notice the notifications show pictures of people instead
of blank spaces & there are no exceptions in the logs
Fixes: 148543216
Change-Id: Idfb7c75d9c5541f2dcebfb0f20daa99f039f4181
Diffstat (limited to 'core/java/android/app/Notification.java')
| -rw-r--r-- | core/java/android/app/Notification.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 1af275fedd74..411df59cb0d1 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -2485,6 +2485,20 @@ public class Notification implements Parcelable if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) { visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI))); } + + ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST); + if (people != null && !people.isEmpty()) { + for (Person p : people) { + if (p.getIconUri() != null) { + visitor.accept(p.getIconUri()); + } + } + } + + final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON); + if (person != null && person.getIconUri() != null) { + visitor.accept(person.getIconUri()); + } } if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) { @@ -2493,6 +2507,11 @@ public class Notification implements Parcelable for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(messages)) { visitor.accept(message.getDataUri()); + + Person senderPerson = message.getSenderPerson(); + if (senderPerson != null && senderPerson.getIconUri() != null) { + visitor.accept(senderPerson.getIconUri()); + } } } @@ -2501,6 +2520,11 @@ public class Notification implements Parcelable for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(historic)) { visitor.accept(message.getDataUri()); + + Person senderPerson = message.getSenderPerson(); + if (senderPerson != null && senderPerson.getIconUri() != null) { + visitor.accept(senderPerson.getIconUri()); + } } } } |
