---
title: "Schedule exact alarms only after checking · Agent Wranglers"
url: https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/exact-alarms
id: MOB-53
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 927
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Schedule exact alarms only after checking the permission

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Privacy declarations](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: MOB-53
- Level: Recommended
- Chapter: [Privacy declarations](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations.md)
- Rule: Use exact alarms only for a feature people see that needs a precise time, such as a reminder they set. Call `canScheduleExactAlarms()` before each exact alarm and fall back to an inexact one.
- Check: A search of the release manifest finds `USE_EXACT_ALARM` only in an alarm, timer or calendar app. A test with the permission revoked sets a reminder without a crash and schedules an inexact alarm.
- How: `SCHEDULE_EXACT_ALARM` is not granted to fresh installs of apps that target Android 13 or later, and people can revoke it. Setting an exact alarm without it fails with a `SecurityException`. `USE_EXACT_ALARM` is granted on install, but Google Play allows it only for apps whose core feature is an alarm, timer or calendar. Other apps send people to the settings screen with `ACTION_REQUEST_SCHEDULE_EXACT_ALARM` after explaining why. Background syncs and reports use WorkManager or inexact alarms instead. Declare the alarm feature with the others in [declare restricted Android permissions in the Play Console](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/play-restricted-permissions.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Kotlin example

```kotlin
fun scheduleReminder(alarmManager: AlarmManager, triggerAt: Long, intent: PendingIntent) {
    if (alarmManager.canScheduleExactAlarms()) {
        alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, triggerAt, intent)
    } else {
        alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, triggerAt, intent)
    }
}
```

### Java example

```java
void scheduleReminder(AlarmManager alarmManager, long triggerAt, PendingIntent intent) {
    if (alarmManager.canScheduleExactAlarms()) {
        alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, triggerAt, intent);
    } else {
        alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, triggerAt, intent);
    }
}
```

## Sources

- [Android, Schedule exact alarms are denied by default](https://developer.android.com/about/versions/14/changes/schedule-exact-alarms)
- [Android, Schedule alarms](https://developer.android.com/develop/background-work/services/alarms/schedule)

## Related rules

- MOB-52 [Declare restricted Android permissions in the Play Console](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/play-restricted-permissions.md) in Mobile apps

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/exact-alarms">Agent Wranglers mobile apps playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Declare restricted Android permissions in the Play Console](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations/play-restricted-permissions.md)
- [Privacy declarations](https://agentwranglers.se/playbook/mobile-apps/privacy-declarations.md)
