Skip to content

Commit e6c4893

Browse files
committed
Update the documentation on EXTRA_PEOPLE.
Include the supported formats with links to ContactsContract documentation. Bug: 15283556 Change-Id: Ic48b0a9ad1be61f0fa119b1d0e9d6aac5e5bea27
1 parent 311fc0b commit e6c4893

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

core/java/android/app/Notification.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,8 @@ public String getSortKey() {
798798
public static final String EXTRA_TEMPLATE = "android.template";
799799

800800
/**
801-
* {@link #extras} key: An array of people that this notification relates to, specified
802-
* by contacts provider contact URI.
801+
* {@link #extras} key: A String array containing the people that this notification relates to,
802+
* each of which was supplied to {@link Builder#addPerson(String)}.
803803
*/
804804
public static final String EXTRA_PEOPLE = "android.people";
805805

@@ -2393,10 +2393,27 @@ public Builder setCategory(String category) {
23932393
/**
23942394
* Add a person that is relevant to this notification.
23952395
*
2396+
* <P>
2397+
* Depending on user preferences, this annotation may allow the notification to pass
2398+
* through interruption filters, and to appear more prominently in the user interface.
2399+
* </P>
2400+
*
2401+
* <P>
2402+
* The person should be specified by the {@code String} representation of a
2403+
* {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI}.
2404+
* </P>
2405+
*
2406+
* <P>The system will also attempt to resolve {@code mailto:} and {@code tel:} schema
2407+
* URIs. The path part of these URIs must exist in the contacts database, in the
2408+
* appropriate column, or the reference will be discarded as invalid. Telephone schema
2409+
* URIs will be resolved by {@link android.provider.ContactsContract.PhoneLookup}.
2410+
* </P>
2411+
*
2412+
* @param uri A URI for the person.
23962413
* @see Notification#EXTRA_PEOPLE
23972414
*/
2398-
public Builder addPerson(String handle) {
2399-
mPeople.add(handle);
2415+
public Builder addPerson(String uri) {
2416+
mPeople.add(uri);
24002417
return this;
24012418
}
24022419

0 commit comments

Comments
 (0)