diff --git a/core/java/android/service/notification/NotificationRankerService.java b/core/java/android/service/notification/NotificationRankerService.java index e325354385148..47fdac6bf4c25 100644 --- a/core/java/android/service/notification/NotificationRankerService.java +++ b/core/java/android/service/notification/NotificationRankerService.java @@ -119,7 +119,13 @@ public abstract class NotificationRankerService extends NotificationListenerServ @Override public void registerAsSystemService(Context context, ComponentName componentName, int currentUser) { - throw new IllegalStateException("the ranker may not start itself."); + throw new UnsupportedOperationException("the ranker lifecycle is managed by the system."); + } + + /** @hide */ + @Override + public void unregisterAsSystemService() { + throw new UnsupportedOperationException("the ranker lifecycle is managed by the system."); } @Override diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 02c786e9ba714..516602e55e5c1 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1444,16 +1444,7 @@ public class NotificationManagerService extends SystemService { */ @Override public void unregisterListener(INotificationListener token, int userid) { - final long identity = Binder.clearCallingIdentity(); - try { - if(mRankerServices.checkServiceTokenLocked(token) != null) { - mRankerServices.unregisterService(token, userid); - } else { - mListeners.unregisterService(token, userid); - } - } finally { - Binder.restoreCallingIdentity(identity); - } + mListeners.unregisterService(token, userid); } /**