I don't know what i'm doing wrong. I scheduled an AlarmManager
that triggers alarm every 10 minutes. I used ELAPSE_REAL_TIME
because i don' care that alarm is synchronized with real time. The alarm triggers even if device goes in deep sleep mode and i cannot understand why.
Here is the code:
int minutes = 10;
if ( PendingIntent.getBroadcast( context, MyUtility.ALARM_UNIQUE_ID, i, PendingIntent.FLAG_NO_CREATE ) == null )
{
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
PendingIntent pi = PendingIntent.getBroadcast( context, 0, i, 0);
am.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 1000 * 60 * minutes, pi);
}
The expected behaviour will be that alarm triggers every 10 minutes from now until devices goes in deep sleep mode and if deep sleep goes one for hours (like when i put airplane mode during night) the alarm won't trigger (until the morning) right?