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

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

Merge "revert recent changes around system listener registrations" into nyc-dev

parents 2f14bb31 b7c81095
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -119,7 +119,13 @@ public abstract class NotificationRankerService extends NotificationListenerServ
    @Override
    @Override
    public void registerAsSystemService(Context context, ComponentName componentName,
    public void registerAsSystemService(Context context, ComponentName componentName,
            int currentUser)  {
            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
    @Override
+1 −10
Original line number Original line Diff line number Diff line
@@ -1444,17 +1444,8 @@ public class NotificationManagerService extends SystemService {
         */
         */
        @Override
        @Override
        public void unregisterListener(INotificationListener token, int userid) {
        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);
            mListeners.unregisterService(token, userid);
        }
        }
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }


        /**
        /**
         * Allow an INotificationListener to simulate a "clear all" operation.
         * Allow an INotificationListener to simulate a "clear all" operation.