0

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.

mikemass90
  • 11
  • 1
  • 3
  • this might help : https://stackoverflow.com/questions/46787086/whats-automaticzenrule-what-is-it-used-for docs : https://developer.android.com/reference/android/service/notification/package-summary & https://developer.android.com/reference/android/app/AutomaticZenRule - might be a way where you can add/update/remove rules in dnd via code, so you work with the android dnd system rather than your app trying to reverse engineer it ... possibly? – Mark Aug 20 '21 at 18:54
  • Thanks! I'll look into that. – mikemass90 Aug 22 '21 at 17:52

0 Answers0