Why does calling notify() inside NotificationListenerService.onNotificationPosted not cause infinite loop?

33 Views Asked by At

I can see from Android docs that calling NotificationManagerCompat.notify() inside NotificationListenerService.onNotificationPosted() can be done to update notifications. Why is this not causing a notification posted, which triggers another notification, which triggers onNotificationPosted() again, and make an infinite loop? Or is it making an infinite loop but the system stops it?

When I notify() inside onNotificationPosted(), it doesn't seem like such infinite loop takes place, hence wondering what is going on behind the scenes.

0

There are 0 best solutions below