Package com.aurelienpierre.sioul
Class EventAlarms
java.lang.Object
com.aurelienpierre.sioul.EventAlarms
Reminders before events while Sioul is not on the screen (docs/android.md,
"Events"): Android freezes an app it does not show, so Rust hands the
coming reminders of events ahead (crates/sioul-app/src/eventalarms.rs:
their own alarms, Sioul's before them, the working day before), and each
is given to Android's alarm clock, as the doses are (DoseAlarms). At its
time EventReceiver asks Rust what to say: the event read again, sleep or a
pause holding it or not, the time left said as it is then. Rust shows it
through `show`: Sioul's reminders before an event and the working day
before in the "Events" channel, at low importance (no sound, no banner);
an alarm the event carries in "An event's alarms", at Android's default
importance (its sound, no banner), or, while one of Sioul's modes lets
them through, in its twin that passes do-not-disturb (PauseMode); each
yours to change in Android's settings. A tap opens the event in Sioul
(ReminderOpener). Rust silent, the words given with the list are shown
instead: never nothing. Apart from the doses: its own list, alarms,
channels and receiver. The list also holds when the end of work's notice
and the night's may come (kind "day"): Rust decides those at their alarm
and shows them through DayNotes, or nothing; no words are kept for them.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classAn alarm to set: its reminder's key, and when (Unix ms). -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String"An event's alarms": the alarms an event carries, with their sound.(package private) static final StringThe "Events" channel: Sioul's reminders before an event, and the working day before; quiet.(package private) static final StringWhether a reminder of the list rang and was answered (`done`): kept while Rust lists it, never set again.private static final String[][](package private) static final StringThe time Rust gave a reminder last (Unix ms), kept apart from its "at", the time its alarm is set for, which `again` moves.private static final Stringprivate static final longA reminder stays in the shade until an hour after its event began.private static final String(package private) static final Stringprivate static final intThe question asked again once a day, nothing having rung meanwhile.private static final intA reminder is known by its key (its tag) and this number.private static final String(package private) static final Stringprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidA reminder asked about again at `at`: held now (you sleep), still worth telling then.private static voidA reminder's alarm, at its time even while the phone sleeps (Doze); without "Alarms & reminders", as close as Android allows: up to an hour late.(package private) static JSONArrayThe list with `key` done with (`done`): kept, marked, while Rust lists it, so that it is never set again; gone with the next list without it.(package private) static voidRust asked for the coming reminders, then given them (EventReceiver, on a thread of its own): after a restart, an update, a change of time or of zone, once a day.(package private) static JSONArrayThe list with `key` asked about again at `at` (`again`), set again, not done.private static void(package private) static voidThe channels: "Events" at low importance, without sound or banner, for Sioul's reminders before an event and the working day before; "An event's alarms" at Android's default importance (its sound, no banner), for the alarms an event carries.private static JSONObjectcopied(JSONObject reminder) A copy of `reminder`, or an empty one.(package private) static voidA reminder said for nothing (by the fallback) taken away.(package private) static voidA reminder done with (told, gone): marked, not to ring again, after a restart neither (`answered`).(package private) static voidThe words given with the list, said when Rust cannot be asked at a reminder's time: never nothing.(package private) static booleanWhether a reminder is an alarm its event carries: as Rust says it ("kind": "alarm", "before", "event"), else by its key (`alarm:…`, a list given by an older Sioul).(package private) static booleanWhether an entry of the list is the end of work's notice or the night's (DayNotes), which have no words kept.private static SharedPreferences(package private) static JSONObjectThe words given with a reminder in the list, shown when Rust cannot be asked; null when not kept.(package private) static StringThe reminder an intent is about; "" when none.private static Stringkey(JSONObject reminder) private static JSONArrayprivate static voidThe list asked for again at `at` (inexact: nothing hangs on its minute).(package private) static JSONArraymerged(JSONArray kept, JSONArray coming, long now, List<EventAlarms.Arm> armed) The list kept once Rust gives `coming` (`set`), and the alarms to set for it, put in `armed`: a reminder new to the list, at its time (one past rings at once: Rust says whether it still makes sense); one kept already, at a time Rust moved into the future, or moved earlier than it said before while it is not done, though that be past (the hours edited so that today's end of work was a few minutes ago; a hold that ended early): it rings at once; never one kept already again in the past at the time Rust said before: it rang already, or rings at the time `again` gave it, and keeps that time and whether it is done.(package private) static StringnativeComing(String zone) The coming reminders, in the phone's `zone` (`sioul_event_coming`); "" when Rust failed.(package private) static StringnativeDecide(String key) At a reminder's time (eventalarms.rs, `sioul_event_decide`): {"shown"}, {"again_at"}, {}; null when Rust failed.(package private) static voidA tapped notification's thing, kept until Sioul takes it (ReminderOpener): "event" and its file, "porch".private static voidpost(Context context, String key, boolean alarm, String title, String body, String event, long until) A reminder in the shade: an alarm the event carries in "An event's alarms", or in its twin that passes do-not-disturb while every one of Sioul's modes on lets an event's alarms through (PauseMode); Sioul's own reminders in the quiet "Events".private static voidput(JSONObject object, String name, Object value) (package private) static voidThe alarms given again from the list kept: Android forgets them when it restarts.private static IntentringIntent(Context context, String key) private static void(package private) static voidRust's coming reminders: JSON {reminders: [{key, at (Unix ms), title, body}], look (Unix ms), words}.(package private) static voidRust's reminder (eventalarms.rs, `show`): JSON {key, kind, title, body, event (its file), until (Unix ms, when the event begins), words}.(package private) static StringtakeOpened(Context context) What a tapped notification opens, once, as JSON {kind, key}; null when nothing (android/main.cpp, for Rust).(package private) static StringThe words said here, as Rust gave them with the list (in the person's language, crates/sioul-core/locales); before any list, these, by the phone's language.
-
Field Details
-
RING
- See Also:
-
LOOK
- See Also:
-
CHANNEL
The "Events" channel: Sioul's reminders before an event, and the working day before; quiet.- See Also:
-
ALARMS
"An event's alarms": the alarms an event carries, with their sound.- See Also:
-
SCHEME
- See Also:
-
KEPT
- See Also:
-
LIST
- See Also:
-
WORDS
- See Also:
-
OPENED
- See Also:
-
NOTE
A reminder is known by its key (its tag) and this number.- See Also:
-
LOOK_CODE
The question asked again once a day, nothing having rung meanwhile.- See Also:
-
KEPT_AFTER_MS
A reminder stays in the shade until an hour after its event began.- See Also:
-
DONE
Whether a reminder of the list rang and was answered (`done`): kept while Rust lists it, never set again.- See Also:
-
GIVEN
The time Rust gave a reminder last (Unix ms), kept apart from its "at", the time its alarm is set for, which `again` moves.- See Also:
-
FALLBACK_WORDS
-
-
Constructor Details
-
EventAlarms
private EventAlarms()
-
-
Method Details
-
nativeDecide
At a reminder's time (eventalarms.rs, `sioul_event_decide`): {"shown"}, {"again_at"}, {}; null when Rust failed. -
nativeComing
The coming reminders, in the phone's `zone` (`sioul_event_coming`); "" when Rust failed. -
set
Rust's coming reminders: JSON {reminders: [{key, at (Unix ms), title, body}], look (Unix ms), words}. Their alarms replace those given before, as `merged` says; the list is kept for Android's restarts. Any thread. -
merged
The list kept once Rust gives `coming` (`set`), and the alarms to set for it, put in `armed`: a reminder new to the list, at its time (one past rings at once: Rust says whether it still makes sense); one kept already, at a time Rust moved into the future, or moved earlier than it said before while it is not done, though that be past (the hours edited so that today's end of work was a few minutes ago; a hold that ended early): it rings at once; never one kept already again in the past at the time Rust said before: it rang already, or rings at the time `again` gave it, and keeps that time and whether it is done. So a list given again and again with a past reminder in it (the end of work's, while its ten minutes last) never rings it again and again: Rust's times for it stay put, or only grow ("a second from now"). Pure, checked on a JVM (android/jvm-checks/DayNotesCheck.java).- Parameters:
kept- the list kept until nowcoming- the list Rust givesnow- the time now (Unix ms)armed- the alarms to set, added to- Returns:
- the list to keep
-
asked
The list with `key` asked about again at `at` (`again`), set again, not done. Pure (DayNotesCheck).- Parameters:
kept- the list keptkey- the reminder's keyat- when (Unix ms)- Returns:
- the list to keep
-
answered
The list with `key` done with (`done`): kept, marked, while Rust lists it, so that it is never set again; gone with the next list without it. Pure (DayNotesCheck).- Parameters:
kept- the list keptkey- the reminder's key- Returns:
- the list to keep
-
copied
A copy of `reminder`, or an empty one. -
restore
The alarms given again from the list kept: Android forgets them when it restarts. One whose time went by rings at once: Rust says whether it still makes sense. Those done with stay unset. -
ask
Rust asked for the coming reminders, then given them (EventReceiver, on a thread of its own): after a restart, an update, a change of time or of zone, once a day. Not before the phone's first unlock: Sioul's files cannot be read then. No answer: the list kept goes on. -
again
A reminder asked about again at `at`: held now (you sleep), still worth telling then. -
done
A reminder done with (told, gone): marked, not to ring again, after a restart neither (`answered`). -
schedule
-
alarm
A reminder's alarm, at its time even while the phone sleeps (Doze); without "Alarms & reminders", as close as Android allows: up to an hour late. Never Android's alarm clock: no alarm icon for an appointment. -
cancel
-
look
The list asked for again at `at` (inexact: nothing hangs on its minute). -
ringIntent
-
key
The reminder an intent is about; "" when none. -
key
-
kept
The words given with a reminder in the list, shown when Rust cannot be asked; null when not kept. -
put
-
kept
-
list
-
opened
A tapped notification's thing, kept until Sioul takes it (ReminderOpener): "event" and its file, "porch". -
takeOpened
What a tapped notification opens, once, as JSON {kind, key}; null when nothing (android/main.cpp, for Rust). -
channel
The channels: "Events" at low importance, without sound or banner, for Sioul's reminders before an event and the working day before; "An event's alarms" at Android's default importance (its sound, no banner), for the alarms an event carries. Yours to change. -
isAlarm
Whether a reminder is an alarm its event carries: as Rust says it ("kind": "alarm", "before", "event"), else by its key (`alarm:…`, a list given by an older Sioul). Pure, checked on a JVM (android/jvm-checks/ModeCheck.java). -
show
Rust's reminder (eventalarms.rs, `show`): JSON {key, kind, title, body, event (its file), until (Unix ms, when the event begins), words}. A tap, or Open, brings Sioul up on the event. Any thread. -
fallback
The words given with the list, said when Rust cannot be asked at a reminder's time: never nothing. Not the end of work's notice nor the night's (kind "day"): said by Rust alone, or not at all, as on a computer (Rust's notice may not come: the day closed, a meeting, the notice told on another device). -
isDay
Whether an entry of the list is the end of work's notice or the night's (DayNotes), which have no words kept. Pure, checked on a JVM (android/jvm-checks/DayNotesCheck.java).- Parameters:
kind- the entry's kind, as Rust gave it- Returns:
- whether it is one of the day's
-
dismiss
A reminder said for nothing (by the fallback) taken away. -
post
private static void post(Context context, String key, boolean alarm, String title, String body, String event, long until) A reminder in the shade: an alarm the event carries in "An event's alarms", or in its twin that passes do-not-disturb while every one of Sioul's modes on lets an event's alarms through (PauseMode); Sioul's own reminders in the quiet "Events". -
word
The words said here, as Rust gave them with the list (in the person's language, crates/sioul-core/locales); before any list, these, by the phone's language.
-