Meditating while Do Not Disturb is on permanently enables DND #94

Open
opened 2021-07-05 21:37:01 +00:00 by Ghost · 2 comments

This is relatively minor but I thought I'd report it.

I'm seeing it on a Pixel 4a with Android 11, running CalyxOS (should be the same as AOSP for this part).

To reproduce:

  • In Android, enable Do Not Disturb on a schedule
  • In Meditation Assistant, set Ringtone and Notifications to Priority Only
  • While Do Not Disturb is enabled by the schedule, start a session

Expected behaviour:

  • After the session, Do Not Disturb setting will stay the same as before (enabled by schedule, and will automatically disable when the schedule expires).

Observed behaviour:

  • Do Not Disturb is now manually enabled and must be manually disabled. In the DND settings it says "Do Not Disturb was automatically turned on by an app (Meditation Assistant)".

Looking in the code, I am guessing this is a side effect of calling getCurrentInterruptionFilter() to save the previous DND state and setInterruptionFilter() to restore it. The state is set but the metadata about being set by schedule is lost.

Looking through NotificationManager class I'm not sure that Android's public API provides a solution for this, though.

This is relatively minor but I thought I'd report it. I'm seeing it on a Pixel 4a with Android 11, running CalyxOS (should be the same as AOSP for this part). To reproduce: * In Android, enable Do Not Disturb on a schedule * In Meditation Assistant, set Ringtone and Notifications to Priority Only * While Do Not Disturb is enabled by the schedule, start a session Expected behaviour: * After the session, Do Not Disturb setting will stay the same as before (enabled by schedule, and will automatically disable when the schedule expires). Observed behaviour: * Do Not Disturb is now manually enabled and must be manually disabled. In the DND settings it says "Do Not Disturb was automatically turned on by an app (Meditation Assistant)". Looking in the code, I am guessing this is a side effect of calling `getCurrentInterruptionFilter()` to save the previous DND state and `setInterruptionFilter()` to restore it. The state is set but the metadata about being set by schedule is lost. Looking through NotificationManager class I'm not sure that Android's public API provides a solution for this, though.
tslocum added the
bug
label 2021-07-05 22:58:34 +00:00
Owner

Thanks for reporting this. I will look into this further when I have some time. It might be possible to check if DND is already set before applying custom DND settings.

Thanks for reporting this. I will look into this further when I have some time. It might be possible to check if DND is already set before applying custom DND settings.

I've also observed this behavior on my Fairphone 2, running Lineage Android 10.

I've also observed this behavior on my Fairphone 2, running Lineage Android 10.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/meditationassistant#94
No description provided.