diff options
| -rw-r--r-- | api/current.txt | 4 | ||||
| -rw-r--r-- | core/java/android/app/Notification.java | 41 |
2 files changed, 45 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index 30b413a7245e..ed32591c989e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5554,7 +5554,11 @@ package android.app { method public java.lang.String getKey(); method public java.lang.CharSequence getName(); method public java.lang.String getUri(); + method public boolean isBot(); + method public boolean isImportant(); + method public android.app.Notification.Person setBot(boolean); method public android.app.Notification.Person setIcon(android.graphics.drawable.Icon); + method public android.app.Notification.Person setImportant(boolean); method public android.app.Notification.Person setKey(java.lang.String); method public android.app.Notification.Person setName(java.lang.CharSequence); method public android.app.Notification.Person setUri(java.lang.String); diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 83d6003b5161..2ac3e2314f89 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -7527,6 +7527,8 @@ public class Notification implements Parcelable @Nullable private Icon mIcon; @Nullable private String mUri; @Nullable private String mKey; + private boolean mBot; + private boolean mImportant; protected Person(Parcel in) { mName = in.readCharSequence(); @@ -7535,6 +7537,8 @@ public class Notification implements Parcelable } mUri = in.readString(); mKey = in.readString(); + mImportant = in.readBoolean(); + mBot = in.readBoolean(); } /** @@ -7611,6 +7615,27 @@ public class Notification implements Parcelable return this; } + /** + * Sets whether this is an important person. Use this method to denote users who frequently + * interact with the user of this device, when it is not possible to refer to the user + * by {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI}. + * + * @param isImportant {@code true} if this is an important person, {@code false} otherwise. + */ + public Person setImportant(boolean isImportant) { + mImportant = isImportant; + return this; + } + + /** + * Sets whether this person is a machine rather than a human. + * + * @param isBot {@code true} if this person is a machine, {@code false} otherwise. + */ + public Person setBot(boolean isBot) { + mBot = isBot; + return this; + } /** * @return the uri provided for this person or {@code null} if no Uri was provided @@ -7645,6 +7670,20 @@ public class Notification implements Parcelable } /** + * @return whether this Person is a machine. + */ + public boolean isBot() { + return mBot; + } + + /** + * @return whether this Person is important. + */ + public boolean isImportant() { + return mImportant; + } + + /** * @return the URI associated with this person, or "name:mName" otherwise * @hide */ @@ -7674,6 +7713,8 @@ public class Notification implements Parcelable } dest.writeString(mUri); dest.writeString(mKey); + dest.writeBoolean(mImportant); + dest.writeBoolean(mBot); } public static final Creator<Person> CREATOR = new Creator<Person>() { |