From 0d21764980e3b77e5a44108c70dc923dbbe15b3b Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 11 Aug 2017 11:26:04 -0400 Subject: [PATCH] Explicitly allow shell to update listener/assist Oddly, this was flaky; sometimes shell could update the entries Fixes: 63793946 Test: cts cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest Change-Id: I5cc6d6a49ad083e68cac1717f97b025966619102 --- .../com/android/server/notification/NotificationManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 704978b9616f..acf0ac1e2758 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); -- 2.11.0