Android 11 - Detect apps that can interrupt in DND mode

Viewed 139

How I can detect expected apps that can interrupt in DND mode? Or when the app's notification shows up, can I know that app in the expected list?

Update: After few days investigation, I'm not sure this is good solution but It's the only clue. In NotificationManager#Policy#toString has something like below

return "NotificationManager.Policy["
                        + "priorityCategories=" + priorityCategoriesToString(priorityCategories)
                        + ",priorityCallSenders=" + prioritySendersToString(priorityCallSenders)
                        + ",priorityMessageSenders=" + prioritySendersToString(priorityMessageSenders)
                        + ",priorityConvSenders="
                        + conversationSendersToString(priorityConversationSenders)
                        + ",suppressedVisualEffects="
                        + suppressedEffectsToString(suppressedVisualEffects)
                        + ",areChannelsBypassingDnd=" + (((state & STATE_CHANNELS_BYPASSING_DND) != 0)
                            ? "true" : "false")
                        + "]";

areChannelsBypassingDnd value is the only clue.

0 Answers
Related