Allow us to enable "Do not disturb" mode during tracking

From RedEyedProgrammer on 2016/01/01 20:48:49 +0000

I am the lead software developer for a highly trafficked website. This means that during the night I need to be able to receive calls and SMS in case my site has problems. At the same time, I don’t want to be notified about anything from my social media accounts or anything else. Android’s “Do not disturb” mode seems to handle this situation perfectly. Would it be possible to have an option to enable this mode during tracking?

Copied from original feature request: http://urbandroid.uservoice.com/forums/264867-sleep-as-android/suggestions/11278104-allow-us-to-enable-do-not-disturb-mode-during-tr

From Petr Nálevka on 2018/02/27 13:22:54 +0000

+Peter this is probably a special MIUI "feature" as in stock Android there is no more silent mode only DND… a similar vendor specific modification did Samsung and we have special handling for Samsung, so we can add the exception for MIUI too, but unfortunately we do not know if this is s specific version of MIUI only or device specific etc…

From Peter Gašparík on 2018/02/20 16:55:00 +0000

Hi, you said that "Setting it to SILENT behaves differently on different Android versions." i have MIUI 8, which is Android 7.1.1 and have DND feature, but when i start sleep tracking, it will set Silent mode instead of DND, is it bug?

From Petr Nálevka on 2016/05/30 09:25:07 +0000

+GK Hello, this API does not change the fact that we are not able to set priority mode on Android 6.0… the API only allows to set modes: NORMAL/SILENT/VIBRATE…SILENT maps to different modes on different versions of Android, on 6.0 to DND or 5.0 to priority…

From gk on 2016/05/30 00:06:26 +0000

Hi +Petr , on marshmallow, doesnt "setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_PRIORITY)" enable you to set it to priority mode only? (I dont know, not a programmer…but found that on stackexchange before I found this reply of your to the exact same question I had)

From Petr Nálevka on 2016/03/16 08:59:09 +0000

+KG if you enable settings>sleep tracking>do not disturb while tracking it will automatically start DND after you start tracking…What we do is we set the device to SILENT_PROFILE… different Android versions differ a bit on what happens when we do that. On Lollipop it will turn the device to priority mode, on Marshallow it will turn the DND mode and on older devices it will put the device to silent. Unfortunately there is no way to fine control this behavior as the app can only set silent profile and it is up to the system what happens…

From KG on 2016/03/15 18:30:35 +0000

I would like it if this feature was available as well. Currently I have to go in and manually turn off WiFi, data and enable DND. I used to just use airplane mode but I need to be able to receive calls from certain people so DND works best… Pain in the butt to go through all those steps though.

From Anonymous on 2016/03/10 06:20:35 +0000

I would like a setting for it to just turn off data and wifi connections when tracking, and back on after tracking. That way the emails and other alerts pushed through the Internet connection would not come through. But the phone calls and texts would come through fine, without being on silent or vibrate (which still makes some of the worst noises in some cases).
I'm requesting this because I need to be able to be woken by calls and texts. But I've noticed from the tracking and noise recordings that my sleep is being messed up many times a night by instantly going to light sleep whenever any noise/vibration is made by the phone, which in nearly all cases corresponds to an incoming email sound and vibration.

From Petr Nálevka on 2016/01/03 23:26:34 +0000

+Anon… I understand that DND != silent but Google did not give an API to control DND… there are only 3 states an app can set SILENT/NORMAL/VIBRATE and that maps to different ringer modes or DND settings depending on Android version as I described below. There is nothing more we can do in the app. Google should provide APIs to control DND from apps, but this is in contrast to all the recent development in Android where apps can set less and less settings…

From Anonymous on 2016/01/03 23:01:34 +0000

But silent mode is not the same DND mode!
I would love it when the app will automatically switch to DND mode as soon as I start the alarm so only people Iike can wake me up when calling me!

From RedEyedProgrammer on 2016/01/03 01:42:33 +0000

Fair enough. Thanks for considering my suggestion. I'll just manually enable the native DND setting before going to bed.

From Petr Nálevka on 2016/01/02 22:21:01 +0000

The Android API allows us to do just one thing - set ringer mode to SILENT, VIBRATE or NORMAL. Setting it to SILENT behaves differently on different Android versions. Before L it does as documented. On L it turn on the priority mode and that's why we also enable VIBRATE to get as close to the original behavior as possible. On M it turns on the default DND mode which is "alarm only". There is not much more we could do as the API is very limited. There is no access to the fine grained DND mode settings available to the user from apps…

From RedEyedProgrammer on 2016/01/02 20:32:27 +0000

Hi Petr,

I did not try it. The documentation says:
"toggle this ON to let Your device go to silent mode while tracking sleep. You won't hear any ringtones from calls, messages, notifications - but music and alarm volume will be left at normal level."

This wouldn't work for me if the documentation is correct, because I still need to be alerted of SMS messages and incoming voice calls because of my work.

Android's native "Do not disturb" mode allows us to set our devices to mute all calls and alerts, except for whatever we put as an exception. In my case, I have set alarms, calls, and messages as exceptions.

If the existing "silent profile while tracking" option could allow for exceptions to allow phone calls and text messages to come through, it would be sufficient for me, but I imagine that delegating the management of user preferences for exceptions to the OS would probably make sense since some users have already set their preferences there and they'd only need to manage their notification exceptions in one place.

Would love to be able to set which Do Not Disturb mode gets turned on. Right now if I am in Do Not Disturb Priority mode Sleep as Android does not switch it to Do Not Disturb Alarms Only which is what I would like it to do, as I am often in Priority Mode as I go to sleep…

Firstly, you need to ensure that neither “Do Not Disturb” mode nor the Routines that put the phone on silent in certain scenarios are enabled.