Temporary Turning Do Not Disturb On preserving user customized DND exceptions - Android

Viewed 15

I am using this code to turn DND (do not disturb) On:

NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        mNotificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_NONE);

The problem is it overrides any setting the user had before. For instance, if the user had DND with exceptions like Alarms, media, calls...etc. This is all disabled now.

How can I turn DND on with the same setup the user have?

0 Answers
Related