Automatically enable Do Not Disturb when selected apps are opened.
AutoDND is a lightweight, privacy-focused Android app that monitors which app is in the foreground and toggles Do Not Disturb mode accordingly. No analytics, no tracking, no internet required.
- Per-app DND control — select any installed app to trigger DND when opened
- Three DND modes — Total Silence, Priority Only, or Alarms Only
- Persistent monitoring — foreground service survives screen off and app switching
- Boot resilience — automatically restarts after device reboot or app update
- DND flicker prevention — switching between two monitored apps keeps DND active
- Battery efficient — 1-second polling using
UsageStatsManagerevents (no Accessibility Service) - Material 3 UI — clean, native Android look following Google design guidelines
- Zero tracking — no analytics, no telemetry, no internet permission
| Permission | Why it's needed |
|---|---|
PACKAGE_USAGE_STATS |
Detect which app is currently in the foreground |
ACCESS_NOTIFICATION_POLICY |
Enable and disable Do Not Disturb mode |
FOREGROUND_SERVICE |
Keep monitoring service alive in the background |
RECEIVE_BOOT_COMPLETED |
Restart monitoring after device reboot |
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS |
Optional — improves reliability on aggressive OEMs |
No INTERNET permission is declared. All processing happens on-device.
app/
└── src/main/java/com/rekaapps/autodnd/
├── data/
│ ├── database/ # Room entities & DAO
│ ├── preferences/ # DataStore preferences
│ └── repository/ # AppRepository
├── domain/
│ ├── model/ # MonitoredApp, DndMode
│ └── usecase/ # DndManager, AppMonitor
├── ui/
│ ├── apps/ # Apps screen + ViewModel
│ ├── settings/ # Settings screen + ViewModel
│ ├── about/ # About screen
│ └── theme/ # Material 3 theme
├── services/ # AppMonitorService (foreground)
├── receivers/ # BootReceiver
├── permissions/ # PermissionChecker
└── di/ # Hilt modules
Tech stack: Kotlin · Jetpack Compose · Material 3 · MVVM · Hilt · Room · DataStore · Coroutines/Flow
- Clone the repository:
git clone https://github.com/rekaapps/autodnd.git
- Open in Android Studio Hedgehog (or newer).
- Sync Gradle and run on a device or emulator running Android 10 (API 29)+.
Note:
UsageStatsManagerrequires a real device or an emulator with usage stats populated. Grant Usage Access and DND Access in the app's Settings screen before starting the service.
MIT — see LICENSE.