Skip to main content

Module alarms

Module alarms 

Source
Expand description

Doses on a phone, reminded while Sioul is not on the screen (docs/health.md, “On a phone”): Android freezes an app in the background, so each coming dose is given to Android’s alarm clock (android/main.cpp); at its time a receiver asks here what to say (health::alarm_decide), after reading what your other devices marked: taken, nothing; not known, the doubt said first. Elsewhere, nothing here: the window’s minute reminds.

Statics§

GIVEN 🔒
The doses last given to Android, so that they are given again only when they change.
REMOVED 🔒
Doses marked whose reminder was taken away already, in this process.

Functions§

exact 🔒
Whether reminders come at their minute: on a phone, only when Android lets Sioul set exact alarms; elsewhere, always.
handed 🔒
A text handed to Android’s side, freed by sioul_string_free.
key_of 🔒 ⚠
A key from Android’s side; “” when unreadable.
notifications_allowed 🔒
Whether reminders can show at all: on a phone, only when Android lets Sioul’s notifications through; elsewhere, always.
opened 🔒
The dose of a reminder tapped while Sioul was away, once.
remove_reminder 🔒
The reminder shown for a dose taken away: once it is marked, here or on another device, a reminder left on the phone would say it is still to take.
schedule 🔒
The coming doses given to Android’s alarm clock, when they changed: at each minute of the window, when it is put away, and after a dose is marked or Health’s settings saved; the alarm at waking with them (wake), which keeps its own list, codes and receiver.
sioul_alarm_decide⚠
At a dose’s time: what to say (health::alarm_decide). Blocks up to half a minute (the sync app given time to bring the others’ marks): never on Android’s main thread.
sioul_alarm_taken⚠
“Taken” on a phone’s reminder (health::alarm_taken).
sioul_string_free⚠
A text handed by sioul_alarm_decide, sioul_alarm_taken, sioul_time_action (timenote.rs) or sioul_wake_next (wake.rs), given back.