diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 704978b9616f8..acf0ac1e27587 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2840,7 +2840,7 @@ public class NotificationManagerService extends SystemService { public void setNotificationListenerAccessGrantedForUser(ComponentName listener, int userId, boolean granted) throws RemoteException { Preconditions.checkNotNull(listener); - enforceSystemOrSystemUI("grant notification listener access"); + checkCallerIsSystemOrShell(); if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), userId, false, granted); @@ -2861,7 +2861,7 @@ public class NotificationManagerService extends SystemService { public void setNotificationAssistantAccessGrantedForUser(ComponentName assistant, int userId, boolean granted) throws RemoteException { Preconditions.checkNotNull(assistant); - enforceSystemOrSystemUI("grant notification assistant access"); + checkCallerIsSystemOrShell(); if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), userId, false, granted);