Package com.aurelienpierre.sioul
Class DoseReceiver
java.lang.Object
android.content.BroadcastReceiver
com.aurelienpierre.sioul.DoseReceiver
A dose's alarm, and the "Taken" of its reminder (DoseAlarms): each asks
Rust's side (crates/sioul-app/src/alarms.rs) on a thread of its own, the
broadcast held open meanwhile (goAsync). At an alarm, Rust first gives the
sync app twenty seconds to bring your other devices' marks; Android gives
the alarm's broadcast a minute (it comes from the background), the
button's ten seconds (from the foreground). An expedited JobScheduler job
would get longer, but waits for its turn, its quota and the phone's sleep,
where a broadcast runs at once. Past the deadline the broadcast is let go,
before Android takes Sioul for hung and stops it: an alarm's reminder then
says to check in Sioul rather than nothing, and Rust's answer, if it comes,
replaces it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classOne broadcast: answered in time, or let go at the deadline and answered after.Nested classes/interfaces inherited from class android.content.BroadcastReceiver
BroadcastReceiver.PendingResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidRust's decision at a dose's time: the reminder, as Rust says it; or nothing, maybe asked again later (news from another device awaited).voidprivate static JSONObjectprivate static voidRust's answer to "Taken": recorded, said quietly; more than half an hour late, when it was taken is asked in Sioul.private static StringMethods inherited from class android.content.BroadcastReceiver
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, getSentFromPackage, getSentFromUid, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
-
Field Details
-
DEADLINE_MS
- See Also:
-
FOREGROUND_DEADLINE_MS
- See Also:
-
-
Constructor Details
-
DoseReceiver
public DoseReceiver()
-
-
Method Details
-
onReceive
- Specified by:
onReceivein classBroadcastReceiver
-
decided
private static void decided(Context context, Intent intent, String key, String answer, boolean late) Rust's decision at a dose's time: the reminder, as Rust says it; or nothing, maybe asked again later (news from another device awaited). -
taken
Rust's answer to "Taken": recorded, said quietly; more than half an hour late, when it was taken is asked in Sioul. Else the reminder stays as it was, its button still there. -
parse
-
text
-