Package com.aurelienpierre.sioul
Class DoseAlarms
java.lang.Object
com.aurelienpierre.sioul.DoseAlarms
Doses reminded while Sioul is not on the screen (docs/android.md, "Doses
while Sioul is away"). Android freezes an app it does not show: each coming
dose is given to Android's alarm clock ahead, and at its time DoseReceiver
asks Rust's side what to say (crates/sioul-app/src/alarms.rs), which reads
first what your other devices marked. Here: the alarms, their list kept for
Android's restarts, the reminders, the dose of a tapped one, and Sioul's
library, loaded without its window when Android starts Sioul for an alarm
alone (android/main.cpp).
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final Stringprivate static final Stringprivate static final long"Taken at 08:03" stays half a day in the shade.private static final intprivate static final Stringprivate static final intprivate static final Stringprivate static boolean(package private) static final StringThe dose as the list names it: "Levothyroxine · 75 µg".private static final Stringprivate static final intA reminder is known by its dose's key (its tag) and this number.private static final String(package private) static final String(package private) static final Stringprivate static final int(package private) static final StringThe reminder's title and text, as Rust said them.private static final String[][] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static UriA dose's intents differ by their address, its key: one alarm per dose, whatever the keys' hashes.(package private) static voidA dose asked about again at `at`, Rust waiting for news from your other devices.private static voidA dose's alarm, at its time even while the phone sleeps (Doze).private static IntentalarmIntent(Context context, String key) (package private) static void"Taken" more than half an hour late: when, asked in Sioul, which a tap opens.private static void(package private) static voidThe "Doses" channel: Android's default importance (its sound, no banner over what you do), yours to change in Android's settings.(package private) static void"Taken" recorded: the reminder becomes a quiet line, "Taken at 08:03", for half a day.(package private) static voidA dose's reminder taken away: marked meanwhile, or said for nothing.(package private) static booleanWhether the alarms ring on time: "Alarms & reminders" allowed, which Android 12 lets you take back and gives from Android 13 (USE_EXACT_ALARM).(package private) static voidNo answer from Rust, or none in time: never silence, never a claim.private static voidprivate static SharedPreferences(package private) static StringThe dose an intent is about; "" when none.private static Stringkey(JSONObject dose) private static JSONArray(package private) static voidSioul's library, loaded and started once per process.(package private) static StringnativeDecide(String key) (package private) static voidnativeInit(Context context) (package private) static StringnativeTaken(String key) (package private) static booleannotificationsAllowed(Context context) Whether reminders can show: Sioul's notifications on (from Android 13, your yes), the "Doses" channel too.(package private) static voidA tapped reminder's dose, kept until Sioul takes it (DoseOpener).private static voidput(JSONObject dose, String name, Object value) (package private) static voidRust's reminder, as Rust said it, with "Taken"; a tap opens Sioul on the dose's question.(package private) static voidA dose reminded: out of the list, not to ring again after a restart.private static Notification.Builder(package private) static voidThe alarms given again from the list kept: Android forgets them when it restarts (DoseBootReceiver).private static void(package private) static voidRust's coming doses (android/main.cpp): JSON [{key, at (Unix milliseconds), title}].private static voidshow(Context context, String key, Notification.Builder reminder) (package private) static StringtakeOpened(Context context) The dose of a tapped reminder, once; null when there is none (android/main.cpp, for Rust).private static Stringwords(int which) The few words said here, in Sioul's two languages (crates/sioul-core/ locales), by the phone's language as Sioul takes it (android/main.cpp); all the others are Rust's.
-
Field Details
-
TAG
- See Also:
-
ALARM
- See Also:
-
TAKEN
- See Also:
-
NAME
The dose as the list names it: "Levothyroxine · 75 µg".- See Also:
-
TITLE
The reminder's title and text, as Rust said them.- See Also:
-
BODY
- See Also:
-
SCHEME
- See Also:
-
CHANNEL
- See Also:
-
KEPT
- See Also:
-
LIST
- See Also:
-
OPENED
- See Also:
-
REMINDER
A reminder is known by its dose's key (its tag) and this number.- See Also:
-
CONFIRMED_MS
"Taken at 08:03" stays half a day in the shade.- See Also:
-
loaded
-
TAKEN_WORD
- See Also:
-
LATE_WORDS
- See Also:
-
FALLBACK_WORDS
- See Also:
-
WORDS
-
-
Constructor Details
-
DoseAlarms
private DoseAlarms()
-
-
Method Details
-
nativeInit
-
nativeDecide
-
nativeTaken
-
load
Sioul's library, loaded and started once per process. Android may start Sioul for an alarm alone, without its window: then without Qt's Java side, which Qt's loader starts when the window opens. The library alone is loaded (Qt's libraries come as its own), by its name in the manifest and the processor, as Qt names it: libsioul_arm64-v8a.so. -
set
Rust's coming doses (android/main.cpp): JSON [{key, at (Unix milliseconds), title}]. Their alarms replace those given before, and the list is kept for Android's restarts. Any thread. -
restore
The alarms given again from the list kept: Android forgets them when it restarts (DoseBootReceiver). A dose whose time went by rings at once: Rust says whether it is still to remind. -
again
A dose asked about again at `at`, Rust waiting for news from your other devices. -
reminded
A dose reminded: out of the list, not to ring again after a restart. -
exact
Whether the alarms ring on time: "Alarms & reminders" allowed, which Android 12 lets you take back and gives from Android 13 (USE_EXACT_ALARM). -
schedule
-
alarm
A dose's alarm, at its time even while the phone sleeps (Doze). Not Android's alarm clock (setAlarmClock): it would show an alarm in the status bar for good, a dose always coming within two days, and put the doses before your own alarm on the lock screen. Without "Alarms & reminders", as close as Android allows: up to an hour late. -
cancel
-
alarmIntent
-
address
A dose's intents differ by their address, its key: one alarm per dose, whatever the keys' hashes. -
key
The dose an intent is about; "" when none. -
key
-
put
-
kept
-
list
-
keep
-
opened
A tapped reminder's dose, kept until Sioul takes it (DoseOpener). -
takeOpened
The dose of a tapped reminder, once; null when there is none (android/main.cpp, for Rust). -
channel
The "Doses" channel: Android's default importance (its sound, no banner over what you do), yours to change in Android's settings. -
notificationsAllowed
Whether reminders can show: Sioul's notifications on (from Android 13, your yes), the "Doses" channel too. -
remind
static void remind(Context context, String key, String title, String body, String name, String taken) Rust's reminder, as Rust said it, with "Taken"; a tap opens Sioul on the dose's question. -
confirm
"Taken" recorded: the reminder becomes a quiet line, "Taken at 08:03", for half a day. -
askWhen
"Taken" more than half an hour late: when, asked in Sioul, which a tap opens. Android opens no window from a button's broadcast (Android 12). -
fallback
No answer from Rust, or none in time: never silence, never a claim. A dose to check in Sioul, as Rust says it then ("dose-alarm-fallback"). -
dismiss
A dose's reminder taken away: marked meanwhile, or said for nothing. -
reminder
-
show
-
words
The few words said here, in Sioul's two languages (crates/sioul-core/ locales), by the phone's language as Sioul takes it (android/main.cpp); all the others are Rust's.
-