DriveReply is a premium, high-performance Android companion application designed to automatically detect when you are driving and reply to incoming messages on your behalf using dynamic, highly customizable reply templates.
Built using Kotlin, Jetpack Compose (Material 3), Room Database, Google Play Services Location & Activity Recognition, and DataStore Preferences, the app prioritizes driver safety, battery longevity, and strict local privacy.
- Sensor Activity Transition: Uses the Google Play Services Transition API to seamlessly enter driving mode when physical sensors detect a vehicle entry/exit.
- GPS Speed Activation: Automatically launches driving protection when your speed exceeds a configurable threshold (e.g., 15 km/h, 25 km/h) using low-power background location polling.
- Car Bluetooth Automation: Automatically toggles driving protection on or off upon connecting to selected "Car Bluetooth" paired devices.
- Vehicular Exit Debounce: Employs a 2-minute delay before exiting the driving state. This keeps the auto-reply active during brief stops (e.g., stoplights, fuel stops) and avoids battery-draining state toggles.
- Multi-App Expansion: Auto-replies are platform-agnostic and support WhatsApp, WhatsApp Business, Telegram, Telegram X, Signal, Facebook Messenger, and common Android SMS apps (Google/Samsung/AOSP Messages packages).
- Silent Auto-Replies: Intercepts incoming notifications using a
NotificationListenerServiceand dispatches immediate replies back using Android's nativeRemoteInputframework. - Privacy-First Deduplication: Sends at most one auto-reply per conversation per driving session (keyed by package + conversation identity) with a cross-session cooldown guard. Ignores group chat notifications by default (customizable in Settings).
- Listener Recovery: If notification access is granted but the listener is not bound, DriveReply automatically requests rebind and exposes a manual Rebind Listener action in Home.
- Manual Simulation Override: Developer simulation mode is a hard override; auto triggers cannot force-stop it until you manually turn it off.
- In-App Debug Logs: Built-in opt-in debug log viewer in Settings → Debugging with enable/disable toggle (disabled by default for privacy), PII redaction, clear, and copy-to-clipboard flow for fast support triage.
- GitHub Release Updates (in-app): Settings → Updates & About has a Check for updates button that polls the latest signed GitHub release. When a newer build is available, Download & install streams the APK with a progress bar, verifies the package identity, version code, and signing certificate against the currently installed app, and hands off to the system package installer — no browser, no manual file-shuffling. The GitHub release page is still offered as a fallback.
- Granular Custom Rules: Define contact-specific message templates, active days of the week, and start/end time windows (including overnight schedules) directly from the template editor.
- Dynamic Matching Engine: Prioritizes contact-specific rules, then schedule rules, before falling back to the active global template.
- Protection Summary Cards: At-a-glance metrics displaying total auto-replies sent and unique contacts reached.
- Spline Protection Chart: A smooth cubic-bezier line chart drawn using Jetpack Compose
Canvasshowing auto-replies sent over the last 7 days, complete with visual gridlines and alpha-gradients. - Donut App Breakdown: Segment-based circular donut graph with rounded end-caps and responsive legends showing auto-reply ratios across all 9 supported messaging apps.
The following diagram describes how DriveReply orchestrates transition receivers, active triggers, notification listener interceptors, and database queries:
graph TD
A[DetectedActivity IN_VEHICLE] -->|Trigger State| B[DriveReplyService]
C[GPS Speed > Threshold] -->|Location Event| B
D[Bluetooth Connected ACL_CONNECTED] -->|Matched MAC Address| B
B -->|Toggles Driving State| E[WhatsAppNotificationListener]
F[Incoming Notifications WhatsApp/Telegram/Signal/Messenger/SMS] -->|Intercepted| E
E -->|Checks Active Triggers & Deduplicates| G{Should Reply?}
G -->|Yes| H[Consult Database Rules]
H -->|1. Contact Rule| I[(Room DB)]
H -->|2. Day & Time Rule| I
H -->|3. Fallback Active Global| I
I -->|Returns Template| J[Send RemoteInput Inline Reply]
J -->|Log Reply & PackageName| I
To function reliably in the background, DriveReply utilizes:
- Activity Recognition (
android.permission.ACTIVITY_RECOGNITION)- Allows detecting vehicle entry and exit states via physical device sensors.
- Notification Listener Access (
NotificationListenerService)- A system-level permission that allows DriveReply to inspect notification bundles and execute quick-reply actions.
- Location (Fine & Background) (
ACCESS_FINE_LOCATION,ACCESS_BACKGROUND_LOCATION)- Required to perform low-power speed-based background service activation.
- Bluetooth Connection (
BLUETOOTH_CONNECTfor Android 12+)- Used to fetch and track paired "Car Bluetooth" MAC addresses.
- Notification Post Access (
android.permission.POST_NOTIFICATIONSfor Android 13+)- Standard permission to show the persistent foreground service monitoring indicator.
- Battery Optimization Exemption (
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)- Exempts the background service from aggressive Android Doze limits to guarantee real-time replies.
- Internet Access (
android.permission.INTERNET)- Used to check the latest GitHub release and present APK update links.
- Android SDK API level 29 (Android 10) or higher.
- Google Play Services enabled on the device.
- Clone the repository:
git clone https://github.com/richiesamlie/DriveReply.git
- Open the directory
DriveReplyin Android Studio. - Sync Gradle and build the project.
- Deploy the debug build to your physical device or a Play Services-supported emulator.
- CI release tags are published as
v2.0.<run_number>. - Release APK metadata is aligned to that same value (
versionName = 2.0.<run_number>,versionCode = <run_number>). - In Settings → Updates & About, DriveReply displays the installed GitHub-style version and can compare it against the latest signed GitHub release.
- 🧠 Context-Aware Local AI Auto-Replies (Pending): Incorporate lightweight, privacy-focused on-device models to draft custom contextual replies to complex incoming messages.
- 📱 Quick Settings Tile: Add a quick settings tile for fast manual overrides to force-activate or force-disable driving monitoring.
- 🗺️ Execution Roadmap: See the phased delivery plan in docs/ROADMAP.md.
For developer-focused architectural deep dives, database schemas, service binding lifecycles, and troubleshooting guides, please check: 👉 Developer & Architecture Documentation
For execution tracking and completed roadmap milestones, see: 👉 Progress Log
For the most recent security & quality audit, see: 👉 Security Audit
This project is licensed under the Apache License 2.0.