Skip to main content

Module eventalarms

Module eventalarms 

Source
Expand description

Reminders before events on a phone (docs/android.md, “Events”): Android freezes an app it does not show, so the coming reminders of events (their own alarms, Sioul’s before them, the working day before) are given ahead to Android’s alarm clock (android/package/src/com/aurelienpierre/sioul/ EventAlarms.java), as the doses are (alarms): at the window’s minute, when Sioul is put away, after each ring. At its time a receiver asks here what to say (sioul_event_decide): the event read again (moved, cancelled, told already?), sleep or a pause holding it or not, the time left said as it is then; shown in the quiet “Events” channel, a tap opening the event. Every device tells its own: one held back on the phone because the computer was used a moment ago, then shown on an empty desk, would be an appointment missed.

Also here, Android’s side of new mail’s notification (mail_note, MailNotes.java), and what a tapped notification opens (opened). Elsewhere nothing: the window’s minute and sioul remind --watch tell them.

Constants§

AGAIN 🔒
A reminder held while nothing says when it may come (Free time ended, say) is asked about again this often.
AT_MOST 🔒
At most this many alarms given: Android keeps 500 per app, the doses’ among them.
LOOK_AGAIN 🔒
Java asks again this long after the list was given, when nothing rang meanwhile…
LOOK_STEP 🔒
…in steps of this, so that the same list is not handed again each minute.

Statics§

GIVEN 🔒
The list last handed to Java, so that it is handed again only when it changes.

Functions§

again_at 🔒
When a reminder held now may come: when the time now ends (waking, the end of free time, the hours’ end); while a layer holds it (a slot of time for you, do-not-disturb) or the end is unknown (a pause), in a quarter of an hour (Unix seconds).
coming 🔒
What Java is given: the events’ reminders not told yet that still make sense, nearest first, at most a hundred, each {key, at (Unix milliseconds), title, body} (the words said if Sioul cannot be asked at its time); one held now (you sleep) at the time it may come; look, when to ask for the list again (a day on, in steps of six hours, so that the list given is the same from one minute to the next); words.
decide 🔒
At a reminder’s time (EventAlarms): {“shown”: true} once told here; or {“again_at”: ms}, held now (you sleep) and still worth telling then; or {} (moved, cancelled, told already, too late). The coming list is given again after, as the calendars are now.
hand 🔒
The list handed to Java when it changed since it was last.
listed 🔒
The list Java is given, from reminders gathered already: the events’ own.
mail_note 🔒
New mail’s notification on a phone (mailnote), in the quiet “New mail” channel: one at a time, the next batch in its place; a tap opens the Porch. through: someone Always through is in it, whom the system’s do-not-disturb should let through (a channel that passes, Java’s to choose).
opened 🔒
What a notification tapped while Sioul was away opens, once: (“event”, its file) or (“porch”, “”).
schedule 🔒
The coming events’ reminders given to Android’s alarm clock when they changed: as Sioul is put away, and after each ring. Nothing elsewhere.
schedule_from 🔒
The same from the window’s minute, with the reminders it gathered (remind::tick): the calendars read once a minute, not twice.
show 🔒
A reminder shown in Android’s notifications, “Events”: its words, “Open”, a tap opening the event; gone from the shade an hour after the event began.
sioul_event_coming⚠
The coming list, for Java (EventAlarms.ask: after a restart, an update, a change of time or of zone, and once a day), in zone, the phone’s as Java has it; “” when it fails, and Java keeps its list.
sioul_event_decide⚠
decide, for Java (android/main.cpp); a panic answers null, and Java shows the words it was given with the list rather than nothing. Given back to sioul_string_free.
when 🔒
When a reminder’s alarm rings (Unix seconds): its time; past it, at once when nothing holds it, else when the hold ends (waking).
words 🔒
The words Java says, in your language, given with the list: Sioul may not be running when a reminder is shown.