From ef6a4cc684e989099fb61d1815368cd5683dd6f5 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 15 Apr 2026 15:45:39 -0400 Subject: [PATCH] Add debug-only receiver to trigger FGS limit notification on demand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maintainers need a screenshot of the "Foreground service limit reached" notification for user-facing docs (docs/user/security.md, docs/user/troubleshooting.md), but reproducing the underlying Android 6-hour daily FGS budget exhaustion organically is impractical. Adds DebugFgsLimitReceiver to the app module's debug source set (never shipped in release builds) which invokes the same FgsLimitNotifier.postLimitReachedNotification call that production uses when startForeground throws ForegroundServiceStartNotAllowedException, so the resulting notification is pixel-identical to what users see. No refactor of FgsLimitNotifier was needed — it was already a public object with a public function. Trigger from a host shell: adb shell am broadcast \ -a com.rousecontext.debug.FIRE_FGS_LIMIT \ -n com.rousecontext.debug/com.rousecontext.app.debug.DebugFgsLimitReceiver Verified both :app:assembleDebug and :app:assembleRelease succeed, and the receiver is present only in the debug APK's merged manifest. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/src/debug/AndroidManifest.xml | 12 +++++ .../app/debug/DebugFgsLimitReceiver.kt | 50 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 app/src/debug/java/com/rousecontext/app/debug/DebugFgsLimitReceiver.kt diff --git a/app/src/debug/AndroidManifest.xml b/app/src/debug/AndroidManifest.xml index 219e5e39..57e4b561 100644 --- a/app/src/debug/AndroidManifest.xml +++ b/app/src/debug/AndroidManifest.xml @@ -12,6 +12,18 @@ + + + + + +