Background
Android 6 has introduced a built in mechanism called "Doze" for better handling the battery while the device sleeps.
The problem
Problem is, I don't see how it really works, and how should apps change to handle this new mechanism, if at all.
Obviously, it depends on what you have in the code, but what should I look for?
What I've found
I've found 2 web pages talking about this :
- https://plus.google.com/+AndroidDevelopers/posts/94jCkmG4jff
- http://developer.android.com/training/monitoring-device-state/doze-standby.html
But they mostly talk about alarms:
To help with scheduling alarms, Android 6.0 (API level 23) introduces two new AlarmManager methods: setAndAllowWhileIdle() and setExactAndAllowWhileIdle(). With these methods, you can set alarms that will fire even if the device is in Doze.
The questions
What should apps developer do in order to handle this new mechanism? Would scheduling APIs work differently because of it? How about changes needed for :
Alarms
Background/foreground service
Wakelocks
JobScheduler and GcmTaskService
Are there any adjustments that need to be done to handle Android 6 and above in this matter?