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

Commit 4a4b49dc authored by Chris Wren's avatar Chris Wren
Browse files

don't allow assistant to block notifications.

Bug: 26640716
Change-Id: I5c7b691ff664e8dafd39bf15cb1556731df2b0b9
parent 5affef07
Loading
Loading
Loading
Loading
+4 −0
Original line number 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_LIGHT;
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_TAG;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
@@ -2001,6 +2002,9 @@ public class NotificationManagerService extends SystemService {
        @Override
        public void setImportanceFromAssistant(INotificationListener token, String key,
                int importance, CharSequence explanation) throws RemoteException {
            if (importance == IMPORTANCE_NONE) {
                throw new IllegalArgumentException("blocking not allowed: key=" + key);
            }
            final long identity = Binder.clearCallingIdentity();
            try {
                synchronized (mNotificationList) {