rouse-context/api
Jason Monk 87146cbab7 Fix #102: Outreach SYSTEM_ALERT_WINDOW opt-in + notification fallback for background launches
Android 14+ tightened background-activity-start rules: the sender of a
PendingIntent must hold BAL privilege at send() time. Rouse's
FOREGROUND_SERVICE_TYPE_DATA_SYNC does NOT grant BAL, so open_link and
launch_app silently no-op when the app is backgrounded on Pixel 10 Pro
and similar API 34+ devices.

This change adds a two-part fix:

1. SYSTEM_ALERT_WINDOW opt-in in the Outreach setup screen. When the user
   enables it and grants the OS permission, the PendingIntent path keeps
   working as before. The new SwitchRow only appears on API 34+
   (`directLaunchApplicable`); older devices don't need the workaround.

2. Tap-to-launch notification fallback when the opt-in is off or denied.
   A new LaunchRequestNotifier in :notifications posts a notification
   whose tap fires the PendingIntent — notification-tap launches bypass
   BAL restrictions. The channel `rouse_outreach_launch` defaults to
   IMPORTANCE_DEFAULT so it shows in the shade without heads-up.

OutreachMcpProvider now takes a `canLaunchDirectly` predicate and an
optional `LaunchRequestNotifierApi`. OutreachIntegration wires both from
the IntegrationSettingsStore toggle and the overlay permission check,
so the decision is re-evaluated on every tool call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:59:03 -04:00
..
src Fix #102: Outreach SYSTEM_ALERT_WINDOW opt-in + notification fallback for background launches 2026-04-13 22:59:03 -04:00
build.gradle.kts Fix #18: Update Gradle wrapper and dependencies to latest stable 2026-04-11 17:36:46 -04:00