title: Android: Using Person with NotificationCompat
body: <p>I want to use <code>Android</code>'s <a href="https://developer.android.com/reference/android/app/Person" rel="nofollow noreferrer"><code>Person</code></a> class to create a sender of a <code>notification</code> so the user image is displayed in <code>MessagingStyle</code> notifications in <code>Android P</code>.</p>
  
  <p>However, the <a href="https://developer.android.com/reference/android/support/v4/app/NotificationCompat.MessagingStyle" rel="nofollow noreferrer"><code>NotificationCompat.MessagingStyle</code></a> class doesn't support using the <code>Person</code> class, it only seems to be supported by <a href="https://developer.android.com/reference/android/app/Notification.MessagingStyle" rel="nofollow noreferrer"><code>Notification.MessagingStyle</code></a> (see the addMessage method).</p>
  
  <p>Is there any way to use the <code>Person</code> class with <code>NotificationCompat</code>?</p>
  
  <p>This is what I want to do:</p>
  
  <pre><code>NotificationCompat.MessagingStyle msgStyle = NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification(notification); 
  
  Person.Builder builder = new Person.Builder().setName(name).setIcon(icon);
  
  msgStyle.addMessage(message, System.currentTimeMillis(), builder.build());
  </code></pre>
  
  <p>In case there isn't, I need to use the <code>NotificationCompat.MessagingStyle</code> class because I'm using the method "extractMessagingStyleFromNotification" to keep the existing messages in the notification, that way I only need to add the new one. Is there any way to achieve the same using <code>Notification.MessagingStyle</code>?</p>