Repository navigation
aka Alarm 1.2.0
Store "What's new" copy (paste-ready):
aka Alarm 1.2.0 — kinder to your battery, and runs on far more phones.
• New "Start listening" setting: the microphone now stays off until shortly before your wake-up window (1 hour by default, adjustable from "right away" to "5 minutes before"). Less battery use, less mic time.
• Android: now installs on Android 8.0 and newer (was Android 12+).
• iOS: fixed the microphone going deaf while AirPods are connected, and a slow freeze when starting the alarm.
• Fixed buttons hiding behind the navigation bar on phones with 3-button navigation.
Android 8.0+ support (minSdk 34→31→26)
- Lowered
minSdkto 26, fulfilling the promise on issue #1. Legacy
Vibratorfallback below API 31 (VibratorManageris 31+), SDK-gated
canScheduleExactAlarms()(the API itself is 31+; below that exact alarms
need no permission),ServiceCompat.startForeground(the typed overload is
29+), and API-27 theme attributes annotated. Verified on a genuine
Android 8.0 emulator: install, foreground service, monitoring, alarming
with vibration. - Interactive content is now lifted above the navigation bar
(navigationBarsPadding) — on API 26–28's opaque 3-button navbar the
Start button and slide hints were half-hidden behind it.
Configurable mic activation window (iOS + Android) — built on
PR #3 by @nullptroma, who
contributed the deferred-mic architecture (Armed phase + Doze-proof exact
alarm + unit tests).
- New Armed phase: after tapping Start the mic stays off — the app just
holds its foreground notification — until the configurable activation lead
before the wake window. Saves battery and keeps the mic dark overnight. - New "Start listening" setting in the gear sheet: Right away → 8 h → 4 h →
2 h → 1 h (default) → 30 min → 15 min → 5 min before the window. Persisted,
and applies live: changing it while armed re-computes the phase on the spot
(mic starts/stops immediately and the scheduled wakeup is re-armed). - Android wakes from the Armed phase via
AlarmManager.setExactAndAllowWhileIdle
(USE_EXACT_ALARMon 13+,SCHEDULE_EXACT_ALARMon 12), with stale-alarm
validation when re-arming. On top of the PR:- Guarded against
SecurityExceptionwhen the exact-alarm permission is
revoked (possible on Android 12) — falls back to inexact allow-while-idle
delivery. - Added an in-process fallback timer and an on-foreground catch-up check so
a single dropped OEM alarm can't leave the app armed forever with no
wake-up — the alarm always fires by the end of the window.
- Guarded against
- iOS mirrors the same phase machine with in-process timers plus a
foreground catch-up (iOS keeps the screen on while armed, so timers tick). - Notification and status line show the plan: "Alarm armed — mic off until
HH:MM".
iOS mic reliability (found during on-device testing of the above)
- Bluetooth is now output-only. The audio session used
.allowBluetoothHFP,
so connected AirPods became the session input — and their low-bandwidth
HFP mic delivers no usable buffers in.measurementmode, leaving the app
completely deaf until the AirPods happened to switch to another device.
Session options now use.allowBluetoothA2DP(alarm audio can still play
through AirPods when worn) and the input is pinned to the built-in mic via
setPreferredInput— the phone on the nightstand is the sensor, always.
Also removes the ~3 s HFP-negotiation freeze when tapping Start. - The mic watchdog now retries the engine rebuild on every tick while stuck
(previously one attempt on the edge into stuckness — if that single rebuild
landed while the route was still settling, the mic stayed dead), with a
liveness grace period after each attempt so the retry loop can't tear the
engine down faster than it can deliver its first buffer. - Fixed the settings gear drifting toward the screen centre on the armed
screen (the hidden level bar let the container shrink to the status text's
width; it's now pinned full-width).