I'm investigating building a custom Do Not Disturb Android app, specifically regarding its notification masking ability.
What I want to happen is to activate a "routine" with specifics apps (by package name) tied to it, so that when the routine is running, if a notification from that app comes in, the notification isn't displayed until the routine is stopped (just like how Do Not Disturb does it).
Right now, what I've done is cancel the notification via the NotificationListenerService so it doesn't show up in the status bar, save the notifications details, then display those in an activity once the routine is stopped. It nearly accomplishes my goal, but I'd like to replicate the Do Not Disturb functionality if possible.