Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e856ca8 authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge "Add new semantic Person fields" into pi-dev

am: 6389e7bc

Change-Id: I316ff063efbe3c36a34e3e9e00a463ae4364c4bd
parents 1bdcfa8f 6389e7bc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
+41 −0
Original line number Diff line number Diff line
@@ -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
@@ -7644,6 +7669,20 @@ public class Notification implements Parcelable
            return mKey;
        }

        /**
         * @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>() {