From eb53c228f062a895dd90a00b6f2d7e7dda3d8ca1 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 6 Apr 2018 12:56:09 -0700 Subject: [PATCH] Added nullability annotations to API Certain methods where left out in the new APIs Change-Id: Ide1e2f387a4918f2134254d862eeff06bfd3a730 Fixes: 74409592 Test: only non-semantic changes --- core/java/android/app/Notification.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 86fedb135f474..e7b6cf0e5dd1e 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -6431,6 +6431,7 @@ public class Notification implements Parcelable /** * @return the user to be displayed for any replies sent by the user */ + @NonNull public Person getUser() { return mUser; } @@ -6505,7 +6506,8 @@ public class Notification implements Parcelable * * @return this object for method chaining */ - public MessagingStyle addMessage(CharSequence text, long timestamp, Person sender) { + public MessagingStyle addMessage(@NonNull CharSequence text, long timestamp, + @Nullable Person sender) { return addMessage(new Message(text, timestamp, sender)); } @@ -6933,7 +6935,7 @@ public class Notification implements Parcelable * in order to differentiate between the different users. *

*/ - public Message(CharSequence text, long timestamp, @Nullable Person sender){ + public Message(@NonNull CharSequence text, long timestamp, @Nullable Person sender) { mText = text; mTimestamp = timestamp; mSender = sender;