I am setting the interruption filter using this code:
NotificationManager myNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
myNotificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_PRIORITY);
It works very well in every device, but, for some reason it doesn't in Xiaomi devices using Android 9. Do Not Disturb mode is not activated in those devices. It remains unchanged. If I ask the device what is the current interruption it answers with a value of 5. Which is an unknown and not documented value in Android Developer as stated here.
int iCurrentInterruption = oNotificationManager.getCurrentInterruptionFilter();
iCurrentInterruption has a value of 5. None of the following:
INTERRUPTION_FILTER_UNKNOWN = 0
INTERRUPTION_FILTER_ALL = 1
INTERRUPTION_FILTER_PRIORITY = 2
INTERRUPTION_FILTER_NONE = 3
INTERRUPTION_FILTER_ALARMS = 4