Hi, and thanks.
I have to admit, bluemail, type, droidmail were what I tested. All of them failed the same way, to use scheduled check reliably.
I switched to push mail and for now it works as expected, 2-3 days later.
Just out of curiosity, I contacted the author of the reminder app I'm using (on JB4.2 before, now on my xiaomi). His app has no problem to be called/awaken by Android on the specified moment in time, always. As a side note - not actually on time to the second but exactly 30 seconds ahead of its scheduled moment. This 30 sec offset was present on JB4.2 as well.
And I've done that because as I got it, aquamail's code wasn't called on time (if at all) by the OS in the first place, so it shouldn't have to do with the fact Aqua uses the network there.
This is the code he is using successfully.
public static void setExactAlarm(final Context ctxt, final int type, final long triggerAtMillis, final PendingIntent pi) {
final AlarmManager alarms = (AlarmManager) ctxt.getSystemService(Context.ALARM_SERVICE);
if (VersionUtils.isMarshmellow23__6_0_OrLater()) {
alarms.setExactAndAllowWhileIdle(type, triggerAtMillis, pi);
} else if (VersionUtils.isKitKat19__4_4_OrLater()) {
alarms.setExact(type, triggerAtMillis, pi);
} else {
alarms.set(type, triggerAtMillis, pi);
}
}
I don't want to sound teaching or something, not at all. Just if this could ring any bells as to how this problem could be resolved.
Thanks.