Class DndReceiver

java.lang.Object
android.content.BroadcastReceiver
com.aurelienpierre.sioul.DndReceiver

public final class DndReceiver extends BroadcastReceiver
Do-not-disturb applied in Sioul's own process (crates/sioul-app/src/ everywhere.rs, `apply`), where Android's modes of Sioul's are kept (PauseMode): asked by the background service when your other devices changed it, at the alarm of its next end (the switch's "until", waking, the night), and after the phone's restart. Sioul's window open or not: the library is loaded alone, as for a dose (DoseAlarms.load(android.content.Context)), and Rust answers on a thread of its own, the broadcast held open meanwhile. Both ways (docs/do-not-disturb.md): the phone's own do-not-disturb heard as it changes, Sioul closed or not. Android sends a package with Do Not Disturb access ACTION_INTERRUPTION_FILTER_CHANGED (NotificationManagerService, "explicitly send the broadcast to all DND packages, even if they aren't currently running"), and the owner of a mode its ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED; both are protected broadcasts, which only the system sends, so this receiver stays not exported. Decided in Java (DndHeard), the library loaded only for a press; a change heard while Sioul's own settles is looked at again once it did. The notification listener, while bound, hears every change too (AppNotes, onInterruptionFilterChanged) and forwards it here (HEARD): whichever word comes first is decided, the other finds nothing new. Each decision is logged, without anything of the person's. The state found at a restart or an update is noted, so that the next change counts from it. Also Sioul's switch pressed on its quick-settings tile (DndTile).