Class DndHeard

java.lang.Object
com.aurelienpierre.sioul.DndHeard

final class DndHeard extends Object
What a change of the phone's own do-not-disturb means for Sioul's switch (docs/do-not-disturb.md, "Both ways"; DndReceiver), decided in Java so that most changes end without loading Sioul's library. Pure, checked on a JVM (android/jvm-checks/HeardCheck.java). - The phone's do-not-disturb is one fact: on (the interruption filter is not ALL) or off. A change of it from the state last seen, read once Sioul's own change settled, that disagrees with Sioul's do-not-disturb here is a press; one that agrees is Sioul's own coming back, or nothing. Rust has the last word (`everywhere::heard_from_system`). - Sioul's own modes say their own state too (ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED): one turned off while Sioul wants it on is an "off", even while another mode keeps the phone silenced; one turned on while Sioul wants none, an "on". Each is confirmed against the mode as Android has it now (`live`): a status that came late, after Sioul's own change, is no press.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    Look again once Sioul's own change settled: this, then the milliseconds to wait.
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
    A mode of Sioul's as Android has it now (PauseMode.live(android.content.Context, java.lang.String)).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static String
    decide(boolean access, Map<String,?> kept, String action, int status, String kind, int live, int filter, long now)
    `kept`: PauseMode's record (on.<kind>, `sioul_on`, `changing_until`, `seen_on`); `action`: the broadcast's; `status`, `kind` and `live`: the mode's, for a status; `filter`: the interruption filter now; `now`: SystemClock.elapsedRealtime().
    (package private) static Boolean
    noted(int filter)
    The state noted as seen at a restart or an update (PauseMode.noteSeen(android.content.Context)), so that the next change counts from it: on or off; null when Android does not say (nothing noted).
    private static long
    number(Object value)
     
    (package private) static boolean
    seen(int filter)
    The phone's do-not-disturb on for this filter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait