Bypass Volume / DND

I’m in the middle of working on an app for pagerduty as part of a hackathon, and an important aspect is that you can be paged and it’ll go through DND / always play the alarm at full volume. Does SFOS provide an API for this somewhere? I’m guessing my app won’t just be able to set the volume to 100% when an alert is fired, but I suppose that might be a solution buggy as it would be.

1 Like

The DnD mode is toggled through a dconf key.

You can activate/deactivate it by writing true or false to:

/lipstick/do_not_disturb

Although I must say an app deactivating the users choice to be not disturbed would be considered EXTREMELY impertinent, to the point where I would consider such an app malware.

So if you do this make it opt-in and very clear that this will happen.

5 Likes

Regarding volume settings there’s an ancient piece of the system called profiled.

It understands user-defined profiles, and also is responsible for silent mode AFAIK.

Play around with the profileclient tool, look at profiles in ~/.profiled.

Maybe your app can switch to an app-defined non-silent profile when it needs to notify someone, and restore the previously active one immediately after.

Again, the same as above applies, it should be opt-in.

3 Likes

One more point:

You’ll notice that alarms (as set through the clock app) already bypass both Silent and DND mode.

You can look at how that is achieved and use a similar approach.

1 Like

Firefighters, for example, practically require this feature, so there is a real use case for it. It can be “hacked in” for sure, I don’t think there’s an API for that. It would be nice to have it, and a Sailjail rule existing for it.

Anyway, you can use DBus to query and set the profile and play the sound manually. See the removed feature in Battery Buddy for inspiration :slight_smile: Apparently ~/.profiled is a thing, but I have no experience of it. (Is it allowed by Sailjail? I don’t think so?)

1 Like

Thanks so much for the pointers The whole point of the app is to wake you up in the middle of the night because there’s some emergency or another, though if I release it I’ll be sure to clarify that it does so on the front page. As @direc85 pointed out, this is just a required thing in certain fields (Emergency Services, Doctors, or in my particular case certain server admins if nobody’s around to take the night shift :wink: )

Did you look at Personal Rintones?

I wasn’t aware that had the ability to override those settings. I actually looked at it once long ago as a way to avoid needing to build the app, but (at least at the time, and it seems like still) the app wasn’t aware of your contacts and it was impossible to add all of a contact’s numbers to an override. Because these calls are automated out of a phone bank it was impossible to use it for this.

you can limit the digits that have to match.

At a glance I see hundreds of phone numbers across dozens of prefixes, this is also a bit off topic given that the thread is about developing an application :slight_smile: