Merge "Adds explanation of MessagingStyle fields" into tm-dev am: d7356c9e08

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18008166

Change-Id: I8383f70019acd88fdec9fad45efdd0045511baae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alexander Roederer
2022-05-05 17:30:34 +00:00
committed by Automerger Merge Worker

View File

@@ -7770,10 +7770,11 @@ public class Notification implements Parcelable
* user will always see the normal notification view. * user will always see the normal notification view.
* *
* <p> * <p>
* If the app is targeting Android P and above, it is required to use the {@link Person} * If the app is targeting Android {@link android.os.Build.VERSION_CODES#P} and above, it is
* class in order to get an optimal rendering of the notification and its avatars. For * required to use the {@link Person} class in order to get an optimal rendering of the
* conversations involving multiple people, the app should also make sure that it marks the * notification and its avatars. For conversations involving multiple people, the app should
* conversation as a group with {@link #setGroupConversation(boolean)}. * also make sure that it marks the conversation as a group with
* {@link #setGroupConversation(boolean)}.
* *
* <p> * <p>
* This class is a "rebuilder": It attaches to a Builder object and modifies its behavior. * This class is a "rebuilder": It attaches to a Builder object and modifies its behavior.
@@ -7846,8 +7847,8 @@ public class Notification implements Parcelable
* @param user Required - The person displayed for any messages that are sent by the * @param user Required - The person displayed for any messages that are sent by the
* user. Any messages added with {@link #addMessage(Notification.MessagingStyle.Message)} * user. Any messages added with {@link #addMessage(Notification.MessagingStyle.Message)}
* who don't have a Person associated with it will be displayed as if they were sent * who don't have a Person associated with it will be displayed as if they were sent
* by this user. The user also needs to have a valid name associated with it, which will * by this user. The user also needs to have a valid name associated with it, which is
* be enforced starting in Android P. * enforced starting in Android {@link android.os.Build.VERSION_CODES#P}.
*/ */
public MessagingStyle(@NonNull Person user) { public MessagingStyle(@NonNull Person user) {
mUser = user; mUser = user;
@@ -7904,9 +7905,9 @@ public class Notification implements Parcelable
/** /**
* Sets the title to be displayed on this conversation. May be set to {@code null}. * Sets the title to be displayed on this conversation. May be set to {@code null}.
* *
* <p>Starting in {@link Build.VERSION_CODES#R, this conversation title will be ignored if a * <p>Starting in {@link Build.VERSION_CODES#R}, this conversation title will be ignored
* valid shortcutId is added via {@link Notification.Builder#setShortcutId(String)}. In this * if a valid shortcutId is added via {@link Notification.Builder#setShortcutId(String)}.
* case, {@link ShortcutInfo#getLongLabel()} (or, if missing, * In this case, {@link ShortcutInfo#getLongLabel()} (or, if missing,
* {@link ShortcutInfo#getShortLabel()}) will be shown as the conversation title * {@link ShortcutInfo#getShortLabel()}) will be shown as the conversation title
* instead. * instead.
* *
@@ -8065,7 +8066,7 @@ public class Notification implements Parcelable
} }
/** /**
* Gets the list of {@code Message} objects that represent the notification * Gets the list of {@code Message} objects that represent the notification.
*/ */
public List<Message> getMessages() { public List<Message> getMessages() {
return mMessages; return mMessages;