Investigate DND changes
Starting with API 35 Google is changing what we can do with DND.
Apps that target Android 15 (API level 35) and higher can no longer change the global state or policy of Do Not Disturb (DND) on a device (either by modifying user settings, or turning off DND mode). Instead, apps must contribute an AutomaticZenRule, which the system combines into a global policy with the existing most-restrictive-policy-wins scheme. Calls to existing APIs that previously affected global state (setInterruptionFilter, setNotificationPolicy) result in the creation or update of an implicit AutomaticZenRule, which is toggled on and off depending on the call-cycle of those API calls.
We need to verify that it doesn't break our current features if it does we need to adjust or disable the feature if there are no workaround.
my personal hope here is to add a bedtime mode sensor from the phone :)
I was drafting a new issue, but decided this was fitting enough to discuss here:
With Android 15 they've added a bunch of granularity to the DND functionality. Currently it appears the HA Companion app toggles the base DND setting.
Would it be possible to trigger specific DND modes? I looked into it, and wasn't able to find any leads, but maybe there's an area of docs that I don't know.
https://developer.android.com/about/versions/15/features#dnd-rules
Sleep as Android does target 35 now, and is able to toggle DND so I think the base/current functionality is still possible.
Would it be possible to trigger specific DND modes? I looked into it, and wasn't able to find any leads, but maybe there's an area of docs that I don't know.
Should be doable with android 16 IIRC, in Android 15 they kinda just pulled that out to do a early release for Pixels. APIs were not completed/ready.
This change did seem to affect being able to disable DND when certain modes are enabled (Running 16 QPR1).
- When I use
command: "off"while the device is in Priority Only mode (set via HA), DND turns off correctly. - When I use
command: "off"while the device is in just regular DND (e.g. tapping the DND quick tile), DND does not turn off.
This change did seem to affect being able to disable DND when certain modes are enabled (Running 16 QPR1).
* When I use `command: "off"` while the device is in Priority Only mode (set via HA), DND turns off correctly. * When I use `command: "off"` while the device is in just regular DND (e.g. tapping the DND quick tile), DND does not turn off.
This is actually a documented behavior change, as mentioned in the first post.
Apps can only change settings the app previously set, it can no longer change other states (set by you using the quick tile, or by another app). I'll update the documentation to reflect that.