diff options
3 files changed, 11 insertions, 3 deletions
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index 30f2697c1b1f..4a7cf62356e3 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -463,7 +463,11 @@ public final class NotificationChannel implements Parcelable { /** * Returns the user specified importance e.g. {@link NotificationManager#IMPORTANCE_LOW} for - * notifications posted to this channel. + * notifications posted to this channel. Note: This value might be > + * {@link NotificationManager#IMPORTANCE_NONE}, but notifications posted to this channel will + * not be shown to the user if the parent {@link NotificationChannelGroup} or app is blocked. + * See {@link NotificationChannelGroup#isBlocked()} and + * {@link NotificationManager#areNotificationsEnabled()}. */ public int getImportance() { return mImportance; diff --git a/core/java/android/app/NotificationChannelGroup.java b/core/java/android/app/NotificationChannelGroup.java index 16166f7cf1cf..0fa3c7fa6492 100644 --- a/core/java/android/app/NotificationChannelGroup.java +++ b/core/java/android/app/NotificationChannelGroup.java @@ -145,7 +145,9 @@ public final class NotificationChannelGroup implements Parcelable { /** * Returns whether or not notifications posted to {@link NotificationChannel channels} belonging - * to this group are blocked. + * to this group are blocked. This value is independent of + * {@link NotificationManager#areNotificationsEnabled()} and + * {@link NotificationChannel#getImportance()}. */ public boolean isBlocked() { return mBlocked; diff --git a/services/core/java/com/android/server/notification/ValidateNotificationPeople.java b/services/core/java/com/android/server/notification/ValidateNotificationPeople.java index c0c66b248ea5..6cf8f86aed83 100644 --- a/services/core/java/com/android/server/notification/ValidateNotificationPeople.java +++ b/services/core/java/com/android/server/notification/ValidateNotificationPeople.java @@ -468,12 +468,14 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor { private final LinkedList<String> mPendingLookups; private final Context mContext; + // Amount of time to wait for a result from the contacts db before rechecking affinity. + private static final long LOOKUP_TIME = 1000; private float mContactAffinity = NONE; private NotificationRecord mRecord; private PeopleRankingReconsideration(Context context, String key, LinkedList<String> pendingLookups) { - super(key); + super(key, LOOKUP_TIME); mContext = context; mPendingLookups = pendingLookups; } |