in our Android application (with foreground Service) we need exact timers. on 4.x all ok. but on 6.0 and even on 5.x (at least on Samsung) any timers didn't work correctly. no difference what amount of time we are requesting. for example I need 600 msec (occasionally), and 30 sec and 5 minutes repeating timers. any of these may delay with unexpected time, even up to several hours (!!!) when device is in idle mode (6.0, Doze).
*Thread.sleep()*, *Timer* class, *pthread_cond_timedwait()* (in C), *AlarmManager.set()* - can't guarantee exact timeout. *AlarmManager.setExact()* is working better, but not always. may not work at all while in idle (Doze) mode. even if app is whitelisted. *AlarmManager.setExactAndAllowWhileIdle()* looks the same as setExact(). the only difference that it works in idle mode but only with 15+ minutes timeout. adding our application to power whitelist didn't help. so, is some method exists to provide exact (at least approximately) repeating timeouts? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/2a540249-a715-4252-80bf-6982979d8ca3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

