Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccdd08d3 authored by Chris Wren's avatar Chris Wren Committed by Android (Google) Code Review
Browse files

Merge "don't allow assistant to block notifications." into nyc-dev

parents e65db9b9 4a4b49dc
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ import static android.service.notification.NotificationListenerService.SUPPRESSE
import static android.service.notification.NotificationListenerService.TRIM_FULL;
import static android.service.notification.NotificationListenerService.TRIM_FULL;
import static android.service.notification.NotificationListenerService.TRIM_LIGHT;
import static android.service.notification.NotificationListenerService.TRIM_LIGHT;
import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH;
import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH;
import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_NONE;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.END_TAG;
import static org.xmlpull.v1.XmlPullParser.END_TAG;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
@@ -2001,6 +2002,9 @@ public class NotificationManagerService extends SystemService {
        @Override
        @Override
        public void setImportanceFromAssistant(INotificationListener token, String key,
        public void setImportanceFromAssistant(INotificationListener token, String key,
                int importance, CharSequence explanation) throws RemoteException {
                int importance, CharSequence explanation) throws RemoteException {
            if (importance == IMPORTANCE_NONE) {
                throw new IllegalArgumentException("blocking not allowed: key=" + key);
            }
            final long identity = Binder.clearCallingIdentity();
            final long identity = Binder.clearCallingIdentity();
            try {
            try {
                synchronized (mNotificationList) {
                synchronized (mNotificationList) {