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.