Lesson 6: Reminders & Alarms

Goal of this lesson

Explain the difference between an alarm and a reminder, the reminder states, the full reminder-call flow, how reliability is handled, and how adaptive timing works.

Alarm vs. reminder

AlarmReminder
PurposeWake up at a timeRemember a deadline, class, or activity
AlertNative ringing screen with Dismiss / SnoozeSimulated incoming call, or notification only
SpeechOptional Morning Briefing after dismissSpoken reminder + voice reply
Sync❌ Stays on this phone✅ Synced with an account
Tablealarmsreminders

How a reminder gets scheduled

Student creates the reminder Manually, or by confirming a review card
Saved to SQLite reminders row (status = pending) + sync outbox, one transaction
Registered with Android AlarmManager With owner + generation number
  • Lead time: a reminder can ring before the item it’s about, with lead times of up to 24 hours.
  • Delivery style per reminder: Call me (simulated call) or Notify only (a notification with Acknowledge and Snooze buttons).
  • Generation number: every rescheduling increases a generation. A late or old alarm with an outdated generation is ignored, so a stale alarm can never ring for a reminder that has moved.
  • SQLite and Android scheduling are not one atomic transaction, so a reconciler re-registers alarms from the database after changes.

Reminder states

pending Scheduled, waiting
triggered The call was answered
acknowledge
acknowledged "Okay" / "Got it" / button
snooze
snoozed Rings again after N minutes
ignored too often
missed Snooze limit reached
A snoozed reminder goes back to ringing. A missed repeating reminder still schedules its next occurrence.
Acknowledged ≠ task done

Acknowledging only means “I heard it”. The linked task stays pending until the student completes it. If the task is already completed when the alarm fires, the call doesn’t ring.

The reminder call, step by step

AlarmManager fires App can be closed. Phone can be locked
Admission checks Active owner? Reminder exists? Right owner? Current generation? Still actionable? Task not done?
Full-screen call (over the lock screen) Answer · Decline
answer
Answer Speak the reminder with phone TTS
decline / timeout
Decline / no answer Auto-snooze, call ends here (Decline works without unlocking)
Listen Mic + Whisper tiny.en on the phone
Keyword matcher "okay", "got it" → acknowledge · "5 more minutes", "in half an hour" → snooze N
Acknowledge Say confirmation, end call
Snooze N min Say confirmation, end call, ring later
Not understood "Please try again". After 3 tries → auto-snooze

Fallbacks: if the microphone or Whisper is unavailable, the call shows Acknowledge / Snooze buttons. Buttons are always available.

Online version: if the student is online with online voice enabled, LAFINA first speaks the reminder and then hands the call to a live online conversation (Lesson 7). If the internet drops mid-call, it switches back to on-device voice.

Time limits: an answered call is limited to about 10 minutes, and a queued call to about 15 minutes.

Snooze rules

SettingHow it works
Spoken snoozeThe minutes you say (“give me 10 minutes” → 10)
Default / auto-snooze lengthFrom the student’s preferences (5 minutes by default)
Snooze limitWhen the limit is reached, an ignored call marks the reminder missed instead of snoozing again

Reliability: why reminders still ring

What LAFINA does

  • Uses Android AlarmManager exact alarms, not an in-app timer.
  • Recovery receivers re-register pending alarms after a reboot or a timezone change.
  • Records delivery jobs and events (reminder_delivery_jobs, reminder_delivery_events) for recovery and audit.
  • Adopts snoozes that native code applied while the app’s JavaScript wasn’t running.
  • Provides Profile → Alarm & Reminder Health: permission checks plus a test alarm.

Honest limitation: notification, exact-alarm, and full-screen permissions, plus aggressive battery saving on some brands (some Infinix, Tecno, and itel phones), can delay alerts. The fix is to set LAFINA’s battery setting to Unrestricted.

Adaptive reminder timing (machine learning)

LAFINA can suggest a better lead time based on how the student usually responds. It runs fully on the phone.

Behavior log How fast you respond, snooze habits, time of day, load
Features Hour, day, workload, peak study hour, priority, snooze tendency
EWMA Tracks your average response delay over time
KNN Picks the channel: call vs. notification
Random Forest Predicts adherence and the best timing offset
Suggestion, clamped to −30 … +15 min Needs at least 5 past samples. Otherwise normal scheduling

The student can turn adaptive timing off, and suggested timing changes appear in the review flow.

Morning Briefing

After dismissing an alarm, LAFINA can speak a short briefing of the day (classes, tasks, reminders), personalized with Memory. It runs locally with the phone’s voice.

Check yourself

  • Give three differences between an alarm and a reminder.
  • Name the five reminder states and what moves a reminder between them.
  • What is the generation number for?
  • What happens on decline, on silence, and after 3 misunderstood replies?
  • How does LAFINA survive a reboot?
  • Which three ML techniques does adaptive timing use, and what are the safety limits?