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

am: 46820517e4

* commit '46820517e449de678ac103a39b69276efe412eed':
  revert recent changes around system listener registrations
This commit is contained in:
Chris Wren
2016-03-10 17:43:44 +00:00
committed by android-build-merger
2 changed files with 8 additions and 11 deletions

View File

@@ -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

View File

@@ -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);
}
/**