How do I check for Do Not Disturb mode and disable it?
Moderator: Martin
How do I check for Do Not Disturb mode and disable it?
Hello, I'm trying to write a flow that will check for a certain notification + if Do Not Disturb (DND) mode is on, then it will disable it. Which trigger do I use for DND check and which action to disable it? I search for it in the list but nothing comes close (unless I miss it). I see "Interruptions Mode" but not sure if this is DND mode or not. Please help.
Re: How do I check for Do Not Disturb mode and disable it?
Yes Interruptions Mode is for setting DND.
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.
Flow will be like this
Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode
If true
Action => Set Interruptions Mode
But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action
Action => Sound
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.
Flow will be like this
Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode
If true
Action => Set Interruptions Mode
But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action
Action => Sound
Re: How do I check for Do Not Disturb mode and disable it?
Thanks. So I'm guessing "None / Don't interrupt" is DND mode ON and "All / Always interrupt" is DND mode OFF?anuraag wrote:Yes Interruptions Mode is for setting DND.
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.
Flow will be like this
Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode
If true
Action => Set Interruptions Mode
But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action
Action => Sound
Re: How do I check for Do Not Disturb mode and disable it?
Yes. You are correct.
Re: How do I check for Do Not Disturb mode and disable it?
Thanks again. It works! You are awesome.anuraag wrote:Yes. You are correct.
Re: How do I check for Do Not Disturb mode and disable it?
My search for an answer to a similar question brought me here, and this ALMOST answers my question. However, I'm trying to use whether DND status is on as a CONDITION, so that if a different trigger occurs while DND is active, Y will happen. I suppose I could toggle a global variable each time DND is toggled, but that just seems so inelegant somehow.anuraag wrote:Yes Interruptions Mode is for setting DND.
Use "Notification on Statusbar Displayed" as trigger and then "Interruptions Mode" as condition.
Flow will be like this
Trigger =>Notification on Statusbar Displayed
Condition =>Interruptions Mode
If true
Action => Set Interruptions Mode
But you want notification sound for that notification as your phone was on DND mode when that notification arrived, so you need another action
Action => Sound
I see that there is also a "Notification on Statusbar Displayed" condition, but I have to select a package name. I assume that the package to be selected is "settings," but from there...what?
Re: How do I check for Do Not Disturb mode and disable it?
Interruptions Mode or DND comes in 2 flavors, trigger and condition. The one stated above is the condition version, which check for state, to be used with other triggers. If you need to trigger when the Interruption mode changes, use the trigger version instead.
But from what I understand from your comment, it seems you should use the condition version. But you want to use another trigger in another flow; probably you need to disable/enable flow based on the interruption mode.
Notification on Statusbar Displayed when used with package name, will only filter that package name. What kind of notification do you want to check? Not all notification comes only from settings. Maybe you are using notif from gmail, whatsapp or alarm clock. You should select the proper one, or you will missed out the notif. You can use my variable logger flow to log the possible notification you are looking for.
But from what I understand from your comment, it seems you should use the condition version. But you want to use another trigger in another flow; probably you need to disable/enable flow based on the interruption mode.
Notification on Statusbar Displayed when used with package name, will only filter that package name. What kind of notification do you want to check? Not all notification comes only from settings. Maybe you are using notif from gmail, whatsapp or alarm clock. You should select the proper one, or you will missed out the notif. You can use my variable logger flow to log the possible notification you are looking for.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: How do I check for Do Not Disturb mode and disable it?
You are correct, I want the condition version. It looked to me like you were using the trigger version, as I was able to follow your instructions using trigger. I was NOT, however, able to follow them using a condition, hence the confusion.