From fe33f5c627b08d9652a725eb52e84146814bfd5e Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Wed, 23 Feb 2022 11:20:00 -0500 Subject: [PATCH] Add missing userId arg And a bit of logging Test: create new user, validate DND pregrants Fixes: 194923567 Change-Id: Id48e0949f4e70f4b1be841cbebd5e5e474086efe --- .../server/notification/NotificationManagerService.java | 6 +++--- .../com/android/server/notification/NotificationRecord.java | 2 ++ 2 files changed, 5 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 3d34976adc272..370643f17086f 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -766,7 +766,7 @@ public class NotificationManagerService extends SystemService { ArraySet defaultDnds = mConditionProviders.getDefaultPackages(); for (int i = 0; i < defaultDnds.size(); i++) { - allowDndPackage(defaultDnds.valueAt(i)); + allowDndPackage(userId, defaultDnds.valueAt(i)); } setDefaultAssistantForUser(userId); @@ -866,9 +866,9 @@ public class NotificationManagerService extends SystemService { } } - private void allowDndPackage(String packageName) { + private void allowDndPackage(int userId, String packageName) { try { - getBinderService().setNotificationPolicyAccessGranted(packageName, true); + getBinderService().setNotificationPolicyAccessGrantedForUser(packageName, userId, true); } catch (RemoteException e) { e.printStackTrace(); } diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java index 70e968fa8bdc5..3912140379814 100644 --- a/services/core/java/com/android/server/notification/NotificationRecord.java +++ b/services/core/java/com/android/server/notification/NotificationRecord.java @@ -475,6 +475,7 @@ public final class NotificationRecord { pw.println(prefix + "opPkg=" + getSbn().getOpPkg()); pw.println(prefix + "icon=" + notification.getSmallIcon()); pw.println(prefix + "flags=0x" + Integer.toHexString(notification.flags)); + pw.println(prefix + "originalFlags=0x" + Integer.toHexString(mOriginalFlags)); pw.println(prefix + "pri=" + notification.priority); pw.println(prefix + "key=" + getSbn().getKey()); pw.println(prefix + "seen=" + mStats.hasSeen()); @@ -541,6 +542,7 @@ public final class NotificationRecord { if (notification == null) { pw.println(prefix + "None"); return; + } pw.println(prefix + "fullscreenIntent=" + notification.fullScreenIntent); pw.println(prefix + "contentIntent=" + notification.contentIntent);