From b667e46877c1d09b5a4fad8f3835af3559616a5c Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Tue, 22 Sep 2026 10:23:44 +0200 Subject: [PATCH] feat(stopwatch): the foreground service, its silent notification and the receiver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The service is alive exactly while the stopwatch is not idle, and it is `specialUse` with the subtype spelled out — reusing `systemExempted` would have the app claim it is continuing alarm functionality, which it is not. No wake lock, ever: the notification carries the platform chronometer counting up from a base derived when it is posted and never stored, so the system draws the ticking and the process can sleep through it. Its channel is `IMPORTANCE_LOW` because nothing here ever alerts. The Lap, Pause, Resume and Reset buttons are broadcasts carrying no extras — the receiver reads the stored run rather than trusting an intent — and the body opens the Stopwatch tab. Boot, time change and package replacement all reach the third engine now, alongside the other two. --- app/src/main/AndroidManifest.xml | 28 +++ .../de/jeanlucmakiola/clockula/ClockulaApp.kt | 12 ++ .../alarm/receiver/SystemEventReceiver.kt | 12 ++ .../receiver/StopwatchActionReceiver.kt | 53 ++++++ .../service/StopwatchNotifications.kt | 169 ++++++++++++++++++ .../stopwatch/service/StopwatchService.kt | 161 +++++++++++++++++ 6 files changed, 435 insertions(+) create mode 100644 app/src/main/java/de/jeanlucmakiola/clockula/stopwatch/receiver/StopwatchActionReceiver.kt create mode 100644 app/src/main/java/de/jeanlucmakiola/clockula/stopwatch/service/StopwatchNotifications.kt create mode 100644 app/src/main/java/de/jeanlucmakiola/clockula/stopwatch/service/StopwatchService.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e893c84..1d0acd7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -34,6 +34,13 @@ + + + @@ -126,6 +133,27 @@ android:name=".timer.receiver.TimerActionReceiver" android:exported="false" /> + + + + + + + +