Package com.aurelienpierre.sioul
Class DndHeard
java.lang.Object
com.aurelienpierre.sioul.DndHeard
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
FieldsModifier and TypeFieldDescription(package private) static final StringLook 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 intA mode of Sioul's as Android has it now (PauseMode.live(android.content.Context, java.lang.String)). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Stringdecide(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 Booleannoted(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(package private) static booleanseen(int filter) The phone's do-not-disturb on for this filter.
-
Field Details
-
LATER
Look again once Sioul's own change settled: this, then the milliseconds to wait.- See Also:
-
LIVE_UNKNOWN
A mode of Sioul's as Android has it now (PauseMode.live(android.content.Context, java.lang.String)).- See Also:
-
LIVE_ON
- See Also:
-
LIVE_OFF
- See Also:
-
LIVE_DISABLED
- See Also:
-
LIVE_GONE
- See Also:
-
-
Constructor Details
-
DndHeard
private DndHeard()
-
-
Method Details
-
decide
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(). Answers "on", "off", LATER and a delay, or "" (nothing for Sioul). The caller notes the filter seen (`seen`). -
noted
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). -
seen
The phone's do-not-disturb on for this filter. -
number
-