From 6dfaa935c41ba3db47a3c3857f93690ebd48c5a8 Mon Sep 17 00:00:00 2001 From: Yuri Lin Date: Mon, 7 Feb 2022 15:08:29 -0500 Subject: [PATCH] Update matchesCallFilter guidance to recommend tel: codes Using tel: or mailto: works for repeat callers, and the new documentation recommends against using a contacts content lookup URI, as we don't explicitly look up phone numbers associated with the contact at the time of the matchesCallFilter call. Bug: 183924362 Bug: 203806689 Bug: 192592755 Test: NotificationManagerTest Change-Id: I4786f3206f145ab4273a1151a9356101582e9044 --- core/java/android/app/NotificationManager.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java index 4aa2d2e8a6a0d..392f52a08fb5c 100644 --- a/core/java/android/app/NotificationManager.java +++ b/core/java/android/app/NotificationManager.java @@ -2573,11 +2573,18 @@ public class NotificationManager { * method will return false regardless of input. *

*

- * The provided URI must meet the requirements for a URI associated with a - * {@link Person}: it may be the {@code String} representation of a - * {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI}, or a - * mailto: or tel: schema URI matching an entry in the - * Contacts database. See also {@link Person.Builder#setUri} and + * The provided URI should be a tel: or mailto: schema URI indicating + * the source of the call. For an accurate answer regarding whether the caller matches the + * user's permitted contacts, the path part of the URI must match an entry the Contacts database + * in the appropriate column. + *

+ *

+ * Passing in a {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI} is also + * permissible, but should only be used for priority contact interruptions and may not provide + * accurate results in the case of repeat callers. + *

+ *

+ * See also {@link Person.Builder#setUri} and * {@link android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI} * for more information. *