Provide an API to request DND

Bug #1505385 reported by Danielle Foré
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gala
Confirmed
Wishlist
Unassigned
Switchboard Notifications Plug
Confirmed
Wishlist
Unassigned

Bug Description

Not sure if it's more appropriate here or in Gala...

Corentin and I were just discussing a way for apps to request Do Not Disturb mode. Some use cases:

* Calendar wants to set Do Not Disturb during an event (like a meeting)
* Videos wants to set Do Not Disturb while watching video full screen
* A presentation app wants to set Do Not Disturb while presenting
* A writing app has an "Focus Mode" (like iA writer) and wants to set Do Not Disturb while in this mode

Revision history for this message
Corentin Noël (tintou) wrote :

Yeah, this would be awesome.
In Android Marshmallow they introduced it and it's pretty cool to not have to handle such things.
Here is an article with some screenshots that can help for the implementation:
http://www.androidcentral.com/inside-android-ms-new-do-not-disturb-mode

Changed in switchboard-plug-notifications:
status: New → Confirmed
Changed in gala:
status: New → Confirmed
importance: Undecided → Medium
Changed in switchboard-plug-notifications:
importance: Undecided → Medium
Changed in gala:
importance: Medium → Wishlist
Changed in switchboard-plug-notifications:
importance: Medium → Wishlist
Revision history for this message
xapantu (xapantu) wrote : Re: [Bug 1505385] [NEW] Provide an API to request DND

Maybe an integer with the number of apps that request the DND would be
sufficient. E.g. every apps that require it adds +1 when it wants it,
and remove 1 once it's done. That would create some problem if one of
these applications crashed though.

On 12/10/2015 22:39, Daniel Fore wrote:
> Public bug reported:
>
> Not sure if it's more appropriate here or in Gala...
>
> Corentin and I were just discussing a way for apps to request Do Not
> Disturb mode. Some use cases:
>
> * Calendar wants to set Do Not Disturb during an event (like a meeting)
> * Videos wants to set Do Not Disturb while watching video full screen
> * A presentation app wants to set Do Not Disturb while presenting
> * A writing app has an "Focus Mode" (like iA writer) and wants to set Do Not Disturb while in this mode
>
> ** Affects: gala
> Importance: Undecided
> Status: New
>
> ** Affects: switchboard-plug-notifications
> Importance: Undecided
> Status: New
>
> ** Also affects: gala
> Importance: Undecided
> Status: New
>

Revision history for this message
Marcus Wichelmann (l-admin-3) wrote :

In the moment that is possible using the public dconf-key. Or isn't that enough?

Revision history for this message
xapantu (xapantu) wrote : Re: [Bug 1505385] Re: Provide an API to request DND

Not really, for instance :

# State 0, do not disturb not enabled

# App 1 is started, switches DND on

# App 2 is started, is happy about DND on

# App 1 shut down, disable DND as it enables it itself

# BOOM, app 2 is launched but DND is off

On 13/10/2015 00:03, Marcus Wichelmann wrote:
> In the moment that is possible using the public dconf-key. Or isn't that
> enough?
>

Revision history for this message
Danielle Foré (danrabbit) wrote :

I guess a smart thing to do would be also to watch for the process to end in case it did (for example) crash or the developer simply forget to end the request for DnD

Revision history for this message
Cameron Norman (cameronnemo) wrote :

Maybe use file descriptors so it is closed when the process exits? That way no messy watching of the processes. Make sure the CLOEXEC flag is on so child processes (e.g. a mail application triggered from the about dialog) do not activate DND.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.