Add notification and battery optimization permission checks at launch#154
Add notification and battery optimization permission checks at launch#154keithvassallomt wants to merge 1 commit intotimer-machine:developfrom
Conversation
Shows dialogs guiding the user to enable notification permission (Android 13+) and disable battery optimization when the app opens. Includes "Don't ask again" checkbox and a Settings option to reset suppressed reminders.
|
Thank you for your contribution! Asking for permissions right after the app launches is a terrible user experience. Ideally, apps trigger permission requests when the user performs some actions. For example, the app requests the notification permission only when the user starts a timer. The battery optimization exemption isn't enough on many smartphones, which is why the app has a whitelist guideline. What does the broadcast intent support look like? |
|
Thank you for the feedback — you're right that prompting for permissions at launch is poor UX, and the whitelist guideline already handles battery optimization better than a simple exemption request. I'm going to close this PR. The broadcast intent support is in a separate branch, which I'll submit as a new PR shortly. It adds a public broadcast API for external timer control (create, start, pause, resume, reset, dismiss, list) — useful for voice assistant integration. The only permission-related change in the new PR is a settings entry for the full-screen intent permission (Android 14+), which auto-hides once granted. This one doesn't have a natural in-flow prompt point since users won't know it's missing until a timer fires without the full-screen overlay. |
Summary
onResume, so they re-check when the user returns from system settingsNote: This PR is a prerequisite for a follow-up PR that adds broadcast intent support for external app control of timers (see the broadcast-intents branch). The battery optimization exemption in particular is needed for broadcast receivers to start foreground services on Android 12+.
Test plan
./gradlew test— no regressions