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

Commit b7c81095 authored by Chris Wren's avatar Chris Wren
Browse files

revert recent changes around system listener registrations

also guard against the ranker calling the self-service registration functions.
"why do we even have that lever?"

Bug: 27577115
Change-Id: I8a01cfdd801320e53d56bcbf515b9ba17e677166
parent 91f80006
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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
+1 −10
Original line number Diff line number Diff line
@@ -1444,17 +1444,8 @@ 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);
            }
        }

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