Loading services/core/java/com/android/server/notification/NotificationManagerService.java +49 −33 Original line number Original line Diff line number Diff line Loading @@ -2749,6 +2749,8 @@ public class NotificationManagerService extends SystemService { public void setNotificationPolicyAccessGranted(String pkg, boolean granted) public void setNotificationPolicyAccessGranted(String pkg, boolean granted) throws RemoteException { throws RemoteException { checkCallerIsSystemOrShell(); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled( mConditionProviders.setPackageOrComponentEnabled( pkg, getCallingUserHandle().getIdentifier(), true, granted); pkg, getCallingUserHandle().getIdentifier(), true, granted); Loading @@ -2761,6 +2763,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); savePolicyFile(); } } } finally { Binder.restoreCallingIdentity(identity); } } } @Override @Override Loading Loading @@ -2841,6 +2846,8 @@ public class NotificationManagerService extends SystemService { boolean granted) throws RemoteException { boolean granted) throws RemoteException { Preconditions.checkNotNull(listener); Preconditions.checkNotNull(listener); checkCallerIsSystemOrShell(); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), userId, false, granted); userId, false, granted); Loading @@ -2849,12 +2856,16 @@ public class NotificationManagerService extends SystemService { getContext().sendBroadcastAsUser(new Intent( getContext().sendBroadcastAsUser(new Intent( NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED) NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED) .setPackage(listener.getPackageName()) .setPackage(listener.getPackageName()) .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), getCallingUserHandle(), null); getCallingUserHandle(), null); savePolicyFile(); savePolicyFile(); } } } finally { Binder.restoreCallingIdentity(identity); } } } @Override @Override Loading @@ -2862,6 +2873,8 @@ public class NotificationManagerService extends SystemService { int userId, boolean granted) throws RemoteException { int userId, boolean granted) throws RemoteException { Preconditions.checkNotNull(assistant); Preconditions.checkNotNull(assistant); checkCallerIsSystemOrShell(); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), userId, false, granted); userId, false, granted); Loading @@ -2876,6 +2889,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); savePolicyFile(); } } } finally { Binder.restoreCallingIdentity(identity); } } } @Override @Override Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +49 −33 Original line number Original line Diff line number Diff line Loading @@ -2749,6 +2749,8 @@ public class NotificationManagerService extends SystemService { public void setNotificationPolicyAccessGranted(String pkg, boolean granted) public void setNotificationPolicyAccessGranted(String pkg, boolean granted) throws RemoteException { throws RemoteException { checkCallerIsSystemOrShell(); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled( mConditionProviders.setPackageOrComponentEnabled( pkg, getCallingUserHandle().getIdentifier(), true, granted); pkg, getCallingUserHandle().getIdentifier(), true, granted); Loading @@ -2761,6 +2763,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); savePolicyFile(); } } } finally { Binder.restoreCallingIdentity(identity); } } } @Override @Override Loading Loading @@ -2841,6 +2846,8 @@ public class NotificationManagerService extends SystemService { boolean granted) throws RemoteException { boolean granted) throws RemoteException { Preconditions.checkNotNull(listener); Preconditions.checkNotNull(listener); checkCallerIsSystemOrShell(); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), userId, false, granted); userId, false, granted); Loading @@ -2849,12 +2856,16 @@ public class NotificationManagerService extends SystemService { getContext().sendBroadcastAsUser(new Intent( getContext().sendBroadcastAsUser(new Intent( NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED) NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED) .setPackage(listener.getPackageName()) .setPackage(listener.getPackageName()) .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), getCallingUserHandle(), null); getCallingUserHandle(), null); savePolicyFile(); savePolicyFile(); } } } finally { Binder.restoreCallingIdentity(identity); } } } @Override @Override Loading @@ -2862,6 +2873,8 @@ public class NotificationManagerService extends SystemService { int userId, boolean granted) throws RemoteException { int userId, boolean granted) throws RemoteException { Preconditions.checkNotNull(assistant); Preconditions.checkNotNull(assistant); checkCallerIsSystemOrShell(); checkCallerIsSystemOrShell(); final long identity = Binder.clearCallingIdentity(); try { if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) { mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), userId, false, granted); userId, false, granted); Loading @@ -2876,6 +2889,9 @@ public class NotificationManagerService extends SystemService { savePolicyFile(); savePolicyFile(); } } } finally { Binder.restoreCallingIdentity(identity); } } } @Override @Override Loading