Loading services/core/java/com/android/server/notification/NotificationManagerService.java +49 −33 Original line number Diff line number Diff line Loading @@ -2772,6 +2772,8 @@ public class NotificationManagerService extends SystemService { public void setNotificationPolicyAccessGranted(String pkg, boolean granted) throws RemoteException { checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled( pkg, getCallingUserHandle().getIdentifier(), true, granted); Loading @@ -2784,6 +2786,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); } } finally { Binder.restoreCallingIdentity(identity); } } @Override Loading Loading @@ -2864,6 +2869,8 @@ public class NotificationManagerService extends SystemService { boolean granted) throws RemoteException { Preconditions.checkNotNull(listener); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), userId, false, granted); Loading @@ -2872,12 +2879,16 @@ public class NotificationManagerService extends SystemService { getContext().sendBroadcastAsUser(new Intent( NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED) .setPackage(listener.getPackageName()) .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), getCallingUserHandle(), null); savePolicyFile(); } } finally { Binder.restoreCallingIdentity(identity); } } @Override Loading @@ -2885,6 +2896,8 @@ public class NotificationManagerService extends SystemService { int userId, boolean granted) throws RemoteException { Preconditions.checkNotNull(assistant); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), userId, false, granted); Loading @@ -2899,6 +2912,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); } } finally { Binder.restoreCallingIdentity(identity); } } @Override Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +49 −33 Original line number Diff line number Diff line Loading @@ -2772,6 +2772,8 @@ public class NotificationManagerService extends SystemService { public void setNotificationPolicyAccessGranted(String pkg, boolean granted) throws RemoteException { checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled( pkg, getCallingUserHandle().getIdentifier(), true, granted); Loading @@ -2784,6 +2786,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); } } finally { Binder.restoreCallingIdentity(identity); } } @Override Loading Loading @@ -2864,6 +2869,8 @@ public class NotificationManagerService extends SystemService { boolean granted) throws RemoteException { Preconditions.checkNotNull(listener); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), userId, false, granted); Loading @@ -2872,12 +2879,16 @@ public class NotificationManagerService extends SystemService { getContext().sendBroadcastAsUser(new Intent( NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED) .setPackage(listener.getPackageName()) .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), getCallingUserHandle(), null); savePolicyFile(); } } finally { Binder.restoreCallingIdentity(identity); } } @Override Loading @@ -2885,6 +2896,8 @@ public class NotificationManagerService extends SystemService { int userId, boolean granted) throws RemoteException { Preconditions.checkNotNull(assistant); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), userId, false, granted); Loading @@ -2899,6 +2912,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); } } finally { Binder.restoreCallingIdentity(identity); } } @Override Loading