Skip to main content

Module steps

Module steps 

Source
Expand description

The phone in the background: “Sioul keeps your devices in step” (docs/android.md, “In the background”; StepService.java). A foreground service in a process of its own (“:steps”), which holds Sioul’s library without Qt’s window, asks Rust for a step at each of its alarms and when the sync app writes another device’s file into the sharing folder:

  1. the other devices’ news: at an alarm, Sioul’s own pull from the server while it works (else the sync app asked to look first, and waited for), then a quick exchange (share::exchange_here, which also keeps this device’s entry among the devices up to date; the service never says the phone is in use); a file the sync app wrote that the pull brought already, left out (brought_already); then the sealed files of the others’ notes and papers this phone waits for, fetched by their names (share::fetch_wanted_here), for the window’s exchange to write;
  2. do-not-disturb: what this device should ask of its system, compared with what was asked last; changed, Sioul’s own process is asked to apply it (DndReceiver), where Android’s modes of Sioul’s are kept;
  3. mail at its rhythm, the inbox only, fetched from the step’s start beside the exchange, every account at once, so that the step’s network comes in one burst (on mobile data, the radio woken once): what your own spam filter moves as you chose, into the Junk folder (spam::after_fetch); what your mail filters do, on the server, to the arrivals still unread (filters::after_fetch); the rest handed to the new-mail notifications (mailnote), told as soon as every account is fetched, which never tell what the spam filter flagged or moved, nor what a mail filter moves out of the inbox or marks read;
  4. the calls’ table (calls::step): made again when what it is made of changed, and the notification’s “Let every call through”;
  5. when to look next: two minutes while another device is in use, five otherwise, fifteen while you sleep.

On a computer nothing here runs: the window does all of it each minute.

Constants§

MAIL_EVERY 🔒
Mail fetched in the background this often (seconds).
STEP_ASLEEP 🔒
STEP_AWAKE 🔒
STEP_IN_USE 🔒
Steps while another device is in use, while awake otherwise, while asleep (seconds).

Statics§

FOLLOWED 🔒
What was last asked of the service here (on), and when (Unix seconds).
IN_SERVICE 🔒
In the background service’s own process: set by Java before each step.
MAILED 🔒
When mail was last fetched in the background (Unix seconds).
POKED 🔒
What was last asked of Sioul’s own process (everywhere::wanted); empty: nothing yet in this process.

Functions§

ask_contacts 🔒
Android’s question for reading contacts (the window’s). Nothing elsewhere.
brought_already 🔒
The files another device wrote that the sync app just put in the sharing folder (StepService’s watch: their names, “/” between them), each one the pull brought already, the same here as fetched (remote::overlay): whole for a small file, by its size for a larger one (a log’s round, which only grows). Nothing new to read: the folder’s step is left out. Not when nothing is fetched beside the folder, nor for a name not known.
fetch_mail 🔒
The inbox of each account fetched, every account at once (each in a thread of its own, as the window’s watchers fetch them: one connection each, the account’s lock across processes), what your spam filter moves moved, what your mail filters do done, its arrivals handed to the new-mail notifications, told in one notification once every account is fetched (mailnote::close_now), and to the home screen’s card when any came (homecard::mail_came); whether any came.
follow 🔒
follow_setting 🔒
The service started (with its words) or stopped as this device’s setting says, now.
follow_setting_once 🔒
The service started or stopped as this device’s setting says, asked again every ten minutes while it should run: Android lets an app start its service only while its window is on the screen (or at a restart), and may have stopped it meanwhile. Java does nothing when it runs already.
in_service 🔒
Whether this process is the background service’s.
java 🔒
Java’s answer to verb (StepService.call); null elsewhere, or without one.
mail_due 🔒
Whether mail is fetched at this step: at its rhythm, not while you sleep or pause unless the matrix of what reaches you tells some mail then (as usual, nothing is told then, your safe senders’ and Always through’s shown, not told; it comes when Sioul opens or after), and only when new mail is notified at all.
next 🔒
On a phone, in Sioul’s own process: Android’s alarm back at at (Unix seconds) to apply do-not-disturb again then (DndReceiver), Sioul closed or not; none takes it away. Nothing elsewhere: the window’s minute does it.
next_step 🔒
How long until the next step (seconds): two minutes while another device is in use (its news stays fresh, the doses’ too), fifteen while you sleep, five otherwise.
note 🔒
The background service’s notification as things stand now (StepService; docs/android.md, “In the background”): {title, text, calls}. Its title, what now is for and until when; its text, do-not-disturb on or off, then the calls, screened or every call ringing; calls, the words of its buttons (calls::words). And when what now is for ends (Unix seconds).
rounds_wait 🔒
The sharing’s full rounds wait while the connection is measured slow (share::set_frugal: a round restating the records, a megabyte or two sent whole, waits while this device appended less than four), as the window’s exchanges have them. While a bulk import of texts goes on, none starts at all: share::exchange_here says so before each exchange, an alarm’s too (share::set_importing).
send_now 🔒
A press made on this phone outside the window (a system’s change heard, the tile): sent at once by the background service, or, while it does not run, by this process itself (one exchange, the sync app not asked first). Nothing on a computer: the window sends its own.
set_background 🔒
The setting turned on or off here: written (this device’s own, never shared), then the service follows.
setup 🔒
Settings ▸ Do not disturb, on a phone: {on, running, sharing, battery, line, battery_line}.
sioul_dnd_apply
Do-not-disturb applied in Sioul’s own process (DndReceiver): asked by the service, at its next end, after a restart.
sioul_dnd_heard⚠
A change of this phone’s own do-not-disturb, heard as it happened (DndReceiver, in Sioul’s own process): {on}, the system’s state. A press of the switch when it disagrees with what holds (everywhere::heard_from_system).
sioul_dnd_toggle
Sioul’s switch pressed on the phone’s quick-settings tile (DndTile, through DndReceiver, in Sioul’s own process).
sioul_steps_in_service
Java says this process is the background service’s: Android’s modes are never touched from it (everywhere::apply runs in Sioul’s own process).
sioul_steps_step⚠
Java’s step (StepService, on its worker thread, the phone kept awake).
step 🔒
One step of the background service (see the module’s words): its answer for Java, {next (seconds), folder, own, title, text, channel, calls, stop}, or {skip} for a folder’s step with nothing new (the alarm left as it is). reason: alarm, folder:<names> (“/” between them), messages, heard, calls, start, restart.
tell_note 🔒
The notification’s words told to the background service at once (StepService.call “note”; after each apply in Sioul’s own process: a press of the switch, the phone’s own do-not-disturb heard, the tile, a mode’s end, another device’s change, the calls’ switch, the window’s minute), so that it says the state now without waiting for its next step. Java shows them only when they changed, and never words older than those shown: no copy kept here, which the service’s own steps would make stale. Nothing on a computer, nor from the service’s own process, whose step says it.
words 🔒
The service’s words, in the person’s language.