From 7a2eb5704b1fe27a04970fc23e3619497790af64 Mon Sep 17 00:00:00 2001 From: Terence Zhang Date: Tue, 26 Apr 2022 22:50:15 +0000 Subject: [PATCH] added call notif exemption to PostNotificationRunnable Test: NotificationManagerServiceTest Fixes: 227456870 Change-Id: I54810e4ebe4a32ab3bfd7ffe2eb118c01973fd25 --- .../server/notification/NotificationManagerService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 21ee4c21ceeb4..17e561947d703 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -7313,6 +7313,7 @@ public class NotificationManagerService extends SystemService { @Override public void run() { boolean appBanned = !areNotificationsEnabledForPackageInt(pkg, uid); + boolean isCallNotification = isCallNotification(pkg, uid); synchronized (mNotificationLock) { try { NotificationRecord r = null; @@ -7331,8 +7332,10 @@ public class NotificationManagerService extends SystemService { final StatusBarNotification n = r.getSbn(); final Notification notification = n.getNotification(); + boolean isCallNotificationAndCorrectStyle = isCallNotification + && notification.isStyle(Notification.CallStyle.class); - if (!notification.isMediaNotification() + if (!(notification.isMediaNotification() || isCallNotificationAndCorrectStyle) && (appBanned || isRecordBlockedLocked(r))) { mUsageStats.registerBlocked(r); if (DBG) {