In my application which was supposed to trigger an alarm at a specified time, alarm whose purpose was to inform the user via a Notification, I despaired at obta
Doze mode, introduced in Android 6.0 (API level 23), adds further restrictions to those outlined above: (TL;DR: only setAlarmClock triggers in doze mode, and adds a system icon)
Doze restrictions
The following restrictions apply to your apps while in Doze: [...]
- The system ignores wake locks.
- Standard
AlarmManageralarms (includingsetExact()andsetWindow()) are deferred to the next maintenance window.
- If you need to set alarms that fire while in Doze, use
setAndAllowWhileIdle()orsetExactAndAllowWhileIdle().- Alarms set with
setAlarmClock()continue to fire normally — the system exits Doze shortly before those alarms fire. [...]
The devices enter the low-power doze-state with periodic wake-ups to perform the other alarms etc.