summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beverly Tai <beverlyt@google.com> 2020-06-01 20:42:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-06-01 20:42:02 +0000
commitd464849e586666b99ec1d88a248fe48db9136bd8 (patch)
treee4ea7403d88b774d3f99ea5dd7b21abe4f32cc97
parentd53625f6606c32cbec18644aebafd8418fa7fb5e (diff)
parent9a9787e116616370c1af1665e5ccf3fa04161fd1 (diff)
Merge "Don't announce dnd intercepted notfications" into rvc-dev
-rwxr-xr-xservices/core/java/com/android/server/notification/NotificationManagerService.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 6ae58ec7feea..62de3a1bc7cc 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -6802,9 +6802,13 @@ public class NotificationManagerService extends SystemService {
boolean hasValidVibrate = false;
boolean hasValidSound = false;
boolean sentAccessibilityEvent = false;
- // If the notification will appear in the status bar, it should send an accessibility
- // event
- if (!record.isUpdate && record.getImportance() > IMPORTANCE_MIN) {
+
+ // If the notification will appear in the status bar, it should send an accessibility event
+ final boolean suppressedByDnd = record.isIntercepted()
+ && (record.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_STATUS_BAR) != 0;
+ if (!record.isUpdate
+ && record.getImportance() > IMPORTANCE_MIN
+ && !suppressedByDnd) {
sendAccessibilityEvent(notification, record.getSbn().getPackageName());
sentAccessibilityEvent = true;
}