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

Commit 0d722703 authored by Chris Wren's avatar Chris Wren Committed by android-build-merger
Browse files

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

am: ccdd08d3

* commit 'ccdd08d3':
  don't allow assistant to block notifications.
parents bbeb3848 ccdd08d3
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) {